From: Michal Vaner Date: Wed, 10 Sep 2008 19:25:13 +0000 (+0200) Subject: Doc. systems: definitions are grouped by type X-Git-Tag: holmes-import~315 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=336b56a6cb50a3e0f1f3b32fdb044de445caf06d;p=libucw.git Doc. systems: definitions are grouped by type They are grouped together by type. First are enums and structs, then functions, then variables and preprocessor defines go last. --- diff --git a/build/doc-defs b/build/doc-defs index 38988187..712968c3 100755 --- a/build/doc-defs +++ b/build/doc-defs @@ -23,7 +23,15 @@ while( defined( my $line = <> ) ) { push @dump, [ split /,/, $line, 5 ]; } -foreach( sort { $a->[3] cmp $b->[3]; } @dump ) { +my %groups = ( + 'enum' => 1, + 'struct' => 1, + 'function' => 2, + 'variable' => 3, + 'define' => 4 +); + +foreach( sort { ( $groups{$a->[2]} <=> $groups{$b->[2]} ) or ( $a->[3] cmp $b->[3] ); } @dump ) { my( $file, $num, $type, $name, $text ) = @{$_}; my $dircp = $dir; while( shift @{[ $dircp =~ /([^\/]+)/, "//" ]} eq shift @{[ $file =~ /([^\/]+)/, "///" ]} ) {