From 336b56a6cb50a3e0f1f3b32fdb044de445caf06d Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Wed, 10 Sep 2008 21:25:13 +0200 Subject: [PATCH] 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. --- build/doc-defs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 =~ /([^\/]+)/, "///" ]} ) { -- 2.39.2