#!/usr/bin/php
/*
Raydium - CQFD Corp.
http://raydium.org/
License: GPL - GNU General Public License, see "gpl.txt" file.
*/
// This script generates a Wiki(ni) style documentation from comments of
// all header files of Raydium (raydium/header/*.h)
$page="http://wiki.raydium.org/wiki/RaydiumApiReference";
$intro="
======Raydium API Reference======
=====CQFD Corp.=====
This document is the most up-to-date version. **This is a work in progress**:
there's again some errors and wrong informations. Try, wait, or contribute ;)
\"\"Index of chapters\"\"
\"\"Index of all Raydium functions\"\"
----
This document is autogenerated, any change will be lost,
use RaydiumApiReferenceComments for any need.
{DATE}, for Raydium **{VERSION}**
----
";
function getTagLine($tag,$lines,$from=0)
{
for($i=$from;$i".'""';
$chapters[$i]=$str;
$i++;
}
echo "\n=====$str:=====\n";
}
function h2($str)
{
echo "====$str:====\n";
}
function body($str)
{
echo $str."\n\n";
}
function intro($str)
{
$str=str_replace("{DATE}","Generated: ".date("Y-m-d H:i:s"),$str);
$str=str_replace("{VERSION}",getVersion(),$str);
echo $str;
}
$index=array();
function addToIndex($f)
{
static $i=0;
global $index;
$p=strpos($f,"raydium_");
if($p!==false)
$f=substr($f,$p);
else
$f="unsupported - $f";
$index[$i]=$f."|$i";
return $i++;
}
// Main
$id="";
$files=getHeaders(".");
//var_dump($files);
if($files==-1)
die("No header found");
unset($sorted);
for($i=0;$i".'""'.($i+1).".".($n+1)." $title");
$last=$l+1;
$end=getTagLine("**/",$f,$last);
if($end==-1)
die("expected '**/' (started line $l)");
unset($body);
/* for($j=$l+1;$j<$end;$j++)
{
$lj=trim($f[$j]);
if($lj=="")
$lj="\n\n";
else
$lj.=" ";
$body[]=$lj;
}
$str=implode("",$body);*/
for($j=$l+1;$j<$end;$j++)
{
$lj=trim($f[$j]);
$body[]=$lj;
}
$str=@implode("\n",$body);
body($str);
$last=$end+1;
$n++;
}
}
h1('""""Chapters',false);
foreach($chapters as $key => $val)
{
echo('====""'."$val".'""====')."\n";
}
sort($index);
h1('""""Index');
for($i=0;$i$k".'""'."\n";
}