]> mj.ucw.cz Git - libucw.git/blobdiff - build/doc-defs
Opt: Constify
[libucw.git] / build / doc-defs
index fc8112d842a31332e7898e02cec4c4118d97bf0c..8e398250eadd2f37b6b4bdfcc48cfa5fd8bcc9ef 100755 (executable)
@@ -23,21 +23,22 @@ while( defined( my $line = <> ) ) {
        push @dump, [ split /,/, $line, 5 ];
 }
 
-my %groups = (
-       'enum' => 0,
-       'struct' => 1,
-       'fun' => 2,
-       'var' => 3,
-       'def' => 4
+my @types = (
+       [ 'enum', 'Enumerations' ],
+       [ 'struct', 'Structures' ],
+       [ 'type', 'Types' ],
+       [ 'fun', 'Functions' ],
+       [ 'var', 'Variables' ],
+       [ 'def', 'Preprocessor definitions' ]
 );
 
-my %heads = (
-       'enum' => 'Enums',
-       'struct' => 'Structs',
-       '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 = '';
 
@@ -56,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,`$name`>> +\n`$text`\n";
+       $text =~ s/(\.\.\.|\*|'|#|_)/\\$1/g;
+       print OUT "<<$file:$anchor,`$name`>>:: `$text`\n";
 }
 
 close OUT;