- $doc = "";
- $func = <>;
- chop $func;
- $func =~ s/^ \* //;
- $func =~ s/:$//;
- print "Function: $func\n" if (!$html);
- $args = "";
- $inbody = 0;
- $returns = "";
- $body = "";
- $functions[$fn++] = $func;
- $deprecated = 0;
- # Process arguments
- while (<>){
- s/NULL/<code>NULL<\/code>/g;
- s/TRUE/<code>TRUE<\/code>/g;
- s/FALSE/<code>FALSE<\/code>/g;
- if (/^ \*\*?\//){
- $body =~ s/@(\w+)/<i>\1<\/i>/g;
- $returns =~ s/@(\w+)/<i>\1<\/i>/g;
- $args =~ s/@(\w+)/<i>\1<\/i>/g;
-
- $body =~ s/#(\w+)/<code>\1<\/code>/g;
- $returns =~ s/#(\w+)/<code>\1<\/code>/g;
- $args =~ s/#(\w+)/<code>\1<\/code>/g;
-
- $returns =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
- $args =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
- $body =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
-
- $body =~ s/\n/ /;
- $bodies{$func} = $body;
- $arguments{$func} = $args;
- $deprecated{$func} = $deprecated;
- $returns{$func} = $returns;
- $proto = "";
- while (<>){
- $proto .= $_;
- last if (/\{/);
- }
- $proto =~ s/{//;
- # clean it up a little, remove newlines, empty space at end
- $proto =~ s/ +$//;
- # Turn "Type * xxx" into "Type* xxx"
- $proto =~ s/^(\w+)\W+\*/\1\*/;
- $prototype{$func} = $proto;
- return;
- }
- chop;
- s/^\ \*//;
- $_ = "<p>" if (/^\s*$/);
-
- if ($inbody == 0){
- if (/\s*(\w+):(.*)/){
- if ($1 eq "deprecated"){
- $deprecated = $2;
- } else {
- #$args .= "<dt><i>$1:</i></dt><dd>$2</dd>";
- $args .= "<tr><td><i>$1</i><td>$2</td></td></tr>";
- }
- } else {
-
- $body = "\t$_\n";
-
- $inbody = 1;
- }
- } elsif ($inbody == 1) {
- if (/Returns?:/){
- s/Returns?://;
- $returns = "\t$_\n";
- $inbody = 2;
- } else {
- $body .= "\n\t$_";
- }
- } else {
- $returns .= "\n\t$_";
- }
-
- }
+ $doc = "";
+ $func = <>;
+ chop $func;
+ $func =~ s/^ \* //;
+ $func =~ s/:$//;
+ print "Function: $func\n" if (!$html);
+ $args = "";
+ $inbody = 0;
+ $returns = "";
+ $body = "";
+ $functions[$fn++] = $func;
+ $deprecated = 0;
+ # Process arguments
+ while (<>) {
+ s/NULL/<code>NULL<\/code>/g;
+ s/TRUE/<code>TRUE<\/code>/g;
+ s/FALSE/<code>FALSE<\/code>/g;
+ if (/^ \*\*?\//) {
+ $body =~ s/@(\w+)/<i>\1<\/i>/g;
+ $returns =~ s/@(\w+)/<i>\1<\/i>/g;
+ $args =~ s/@(\w+)/<i>\1<\/i>/g;
+
+ $body =~ s/#(\w+)/<code>\1<\/code>/g;
+ $returns =~ s/#(\w+)/<code>\1<\/code>/g;
+ $args =~ s/#(\w+)/<code>\1<\/code>/g;
+
+ $returns =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
+ $args =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
+ $body =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
+
+ $body =~ s/\n/ /;
+ $bodies{$func} = $body;
+ $arguments{$func} = $args;
+ $deprecated{$func} = $deprecated;
+ $returns{$func} = $returns;
+ $proto = "";
+ while (<>) {
+ $proto .= $_;
+ last if (/\{/);
+ }
+ $proto =~ s/{//;
+ # clean it up a little, remove newlines, empty space at end
+ $proto =~ s/ +$//;
+ # Turn "Type * xxx" into "Type* xxx"
+ $proto =~ s/^(\w+)\W+\*/\1\*/;
+ $prototype{$func} = $proto;
+ return;
+ }
+ chop;
+ s/^\ \*//;
+ $_ = "<p>" if (/^\s*$/);
+
+ if ($inbody == 0) {
+ if (/\s*(\w+):(.*)/) {
+ if ($1 eq "deprecated") {
+ $deprecated = $2;
+ } else {
+ # $args .= "<dt><i>$1:</i></dt><dd>$2</dd>";
+ $args .= "<tr><td><i>$1</i><td>$2</td></td></tr>";
+ }
+ } else {
+
+ $body = "\t$_\n";
+
+ $inbody = 1;
+ }
+ } elsif ($inbody == 1) {
+ if (/Returns?:/) {
+ s/Returns?://;
+ $returns = "\t$_\n";
+ $inbody = 2;
+ } else {
+ $body .= "\n\t$_";
+ }
+ } else {
+ $returns .= "\n\t$_";
+ }
+
+ }