]> mj.ucw.cz Git - libucw.git/blobdiff - build/doc-defs
Main recio: Avoid calling of read_handler() with zero available bytes.
[libucw.git] / build / doc-defs
index 712968c319b4068c857bc4abd35ee95a2ade4b19..8e398250eadd2f37b6b4bdfcc48cfa5fd8bcc9ef 100755 (executable)
@@ -23,16 +23,31 @@ while( defined( my $line = <> ) ) {
        push @dump, [ split /,/, $line, 5 ];
 }
 
-my %groups = (
-       'enum' => 1,
-       'struct' => 1,
-       'function' => 2,
-       'variable' => 3,
-       'define' => 4
+my @types = (
+       [ 'enum', 'Enumerations' ],
+       [ 'struct', 'Structures' ],
+       [ 'type', 'Types' ],
+       [ 'fun', 'Functions' ],
+       [ 'var', 'Variables' ],
+       [ 'def', 'Preprocessor definitions' ]
 );
 
+my( $index, %groups, %heads ) = ( 0 );
+
+foreach( @types ) {
+       my( $name, $value ) = @{$_};
+       $groups{$name} = ++ $index;
+       $heads{$name} = $value;
+}
+
+my $lasttype = '';
+
 foreach( sort { ( $groups{$a->[2]} <=> $groups{$b->[2]} ) or ( $a->[3] cmp $b->[3] ); } @dump ) {
-       my( $file, $num, $type, $name, $text ) = @{$_};
+       my( $file, $anchor, $type, $name, $text ) = @{$_};
+       if( $lasttype ne $type ) {
+               $lasttype = $type;
+               print OUT "\n== $heads{$type} [[$type]]\n\n";
+       }
        my $dircp = $dir;
        while( shift @{[ $dircp =~ /([^\/]+)/, "//" ]} eq shift @{[ $file =~ /([^\/]+)/, "///" ]} ) {
                $dircp =~ s/[^\/]+\/?//;
@@ -42,8 +57,8 @@ foreach( sort { ( $groups{$a->[2]} <=> $groups{$b->[2]} ) or ( $a->[3] cmp $b->[
        $file = $dircp."/".$file;
        $file =~ s/^\///;
        $file =~ s/\.[^.]+$//;
-       $text =~ s/\(/!!PARENT_OPEN!!/g;
-       print OUT "- <<$file:auto_$num,`$text`>>\n";
+       $text =~ s/(\.\.\.|\*|'|#|_)/\\$1/g;
+       print OUT "<<$file:$anchor,`$name`>>:: `$text`\n";
 }
 
 close OUT;