X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=build%2Fdoc-defs;h=8e398250eadd2f37b6b4bdfcc48cfa5fd8bcc9ef;hb=634be141f3f014e31d5931a968c0c0f7e07205fb;hp=140cb2ed39c46e3d94cda9bfed8fdadea27ffe83;hpb=7dba56835cc4a7a130c1f57b5fb61be446b5cc31;p=libucw.git diff --git a/build/doc-defs b/build/doc-defs index 140cb2ed..8e398250 100755 --- a/build/doc-defs +++ b/build/doc-defs @@ -23,16 +23,31 @@ while( defined( my $line = <> ) ) { push @dump, [ split /,/, $line, 5 ]; } -my %groups = ( - 'enum' => 1, - 'struct' => 1, - 'fun' => 2, - 'var' => 3, - 'def' => 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, $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,9 +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; - $text =~ s/(\.\.\.)/\\$1/g; - print OUT "- <<$file:$anchor,`$text`>>\n"; + $text =~ s/(\.\.\.|\*|'|#|_)/\\$1/g; + print OUT "<<$file:$anchor,`$name`>>:: `$text`\n"; } close OUT;