]> mj.ucw.cz Git - libucw.git/blobdiff - build/doc-defs
Split autoconf.cfg
[libucw.git] / build / doc-defs
index a39cda40f626983c2150e26e5fc61bdb871d9791..a7f77d1b0dd8e214a63ba9458dc3d84ee0240480 100755 (executable)
@@ -16,9 +16,38 @@ close HEAD;
 my $dir = $out;
 $dir =~ s/\/[^\/]+$//;
 
+my @dump;
+
 while( defined( my $line = <> ) ) {
        chomp $line;
-       my( $file, $num, $text ) = split /,/, $line, 3;
+       push @dump, [ split /,/, $line, 5 ];
+}
+
+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, $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/[^\/]+\/?//;
@@ -28,8 +57,8 @@ while( defined( my $line = <> ) ) {
        $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;