api: Fix some basic syntax problems with the plugin API generator

Change-Id: I9e6afa5b75e7fb803ee4c29f8306b56d7f8d7f64
This commit is contained in:
Solomon Peachy 2025-04-20 16:54:29 -04:00
parent 3383060990
commit 6d656814dd
4 changed files with 17 additions and 17 deletions

View file

@ -1,4 +1,4 @@
<? <?php
$svn = "http://svn.rockbox.org/viewvc.cgi/trunk/"; $svn = "http://svn.rockbox.org/viewvc.cgi/trunk/";
$wiki = "http://www.rockbox.org/wiki/"; $wiki = "http://www.rockbox.org/wiki/";
@ -13,8 +13,8 @@ function get_newest()
{ {
global $svn; global $svn;
$mypath = $_SERVER['SCRIPT_FILENAME']; $mypath = "./"; //$_SERVER['SCRIPT_FILENAME'];
$mypath = substr($mypath, 0, strrpos($mypath, "/"))."/"; // $mypath = substr($mypath, 0, strrpos($mypath, "/"))."/";
$text = file_get_contents($mypath."../../apps/plugin.h"); $text = file_get_contents($mypath."../../apps/plugin.h");
@ -196,7 +196,7 @@ function get_args($func)
$buffer = ""; $buffer = "";
for($i=0; $i<strlen($func); $i++) for($i=0; $i<strlen($func); $i++)
{ {
switch($func{$i}) switch($func[$i])
{ {
case "(": case "(":
$level++; $level++;
@ -234,7 +234,7 @@ function get_args($func)
$buffer .= ","; $buffer .= ",";
break; break;
default: default:
$buffer .= $func{$i}; $buffer .= $func[$i];
break; break;
} }
} }
@ -295,8 +295,8 @@ function split_var($var)
function _simplify($text) function _simplify($text)
{ {
$text = ereg_replace('\(!\( (.*)[ ]?\)\)', '!\1', $text); // $text = ereg_replace('\(!\( (.*)[ ]?\)\)', '!\1', $text);
$text = ereg_replace('\(\(([^ ])\)\)', '\1', $text); // $text = preg_replace('/\(\((.*])\)\)/', '${1}', $text);
return $text; return $text;
} }

View file

@ -1,5 +1,5 @@
#!/usr/bin/php #!/usr/bin/php
<? <?php
require_once("functions.php"); require_once("functions.php");
function get_group($text) function get_group($text)

View file

@ -1,5 +1,5 @@
#!/usr/bin/php #!/usr/bin/php
<? <?php
require_once("functions.php"); require_once("functions.php");
echo '# Auto generated documentation by Rockbox plugin API generator v2'."\n"; echo '# Auto generated documentation by Rockbox plugin API generator v2'."\n";

View file

@ -1,5 +1,5 @@
#!/usr/bin/php #!/usr/bin/php
<? <?php
require_once("functions.php"); require_once("functions.php");
$input = file_get_contents($argv[1]); $input = file_get_contents($argv[1]);