]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
manpage generation script can now handle recursive structs (where the typedef comes...
authorJelte Jansen <jelte@NLnetLabs.nl>
Wed, 28 May 2008 08:28:39 +0000 (08:28 +0000)
committerJelte Jansen <jelte@NLnetLabs.nl>
Wed, 28 May 2008 08:28:39 +0000 (08:28 +0000)
doc/doxyparse.pl

index ad8560eebd64856b778a3ebdb906c83de8af4716..218825fe1b01941b656e74e85360b1e60270e9a3 100755 (executable)
@@ -100,17 +100,21 @@ my @lines = <STDIN>;
 my $max = @lines;
 
 while($i < $max) {
-if ($lines[$i] =~ /^typedef struct/ and $lines[$i + 1] =~ /^struct/) {
-print("skip: $lines[$i]\n");
-print $lines[$i];
-print $lines[$i+1];
-#$i++;
-#exit(1);
-}
+       $typedef = "";
+       if ($lines[$i] =~ /^typedef struct/ and $lines[$i + 1] =~ /^struct/) {
+               # move typedef to below struct
+               $typedef = $lines[$i];
+               $j = $i;
+               while ($lines[$j] !~ /}/) {
+                       $lines[$j] = $lines[$j+1];
+                       $j++;
+               }
+       $lines[$j] = $lines[$j+1];
+       $lines[$j + 1] = $typedef;
+       }
 
        $cur_line = $lines[$i];
        chomp($cur_line);
-print("new line: $cur_line\n");
        if ($cur_line =~ /^\/\*\*[\t ]*$/) {
                # /** Seen
                #print "Comment seen! [$cur_line]\n";