diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-10-25 12:43:09 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-10-25 12:43:09 +0000 |
commit | 9131f702ab477db46a904b8f8c133ec2617b220d (patch) | |
tree | 9d3d9ddce6b09bb0a0f77603d78d2496b7f47d9b /navit/script/itemgra.pl | |
parent | 5b6e460438c8265c6b121e65ce0514f401ad2bae (diff) | |
download | navit-svn-9131f702ab477db46a904b8f8c133ec2617b220d.tar.gz |
Add:Script:Script to check itemgra definitions
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2687 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/script/itemgra.pl')
-rwxr-xr-x | navit/script/itemgra.pl | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/navit/script/itemgra.pl b/navit/script/itemgra.pl new file mode 100755 index 00000000..bbe02b00 --- /dev/null +++ b/navit/script/itemgra.pl @@ -0,0 +1,57 @@ +#! /usr/bin/perl +my $layout; +my $type,$types; +my $order,$orders,@orders; +my @layouts; +open(IN,"../navit.xml"); +while (<IN>) { + if (/<layout name="([^"]*)"/) { + $layout=$1; + push(@layouts,$layout); + } + if (/<itemgra item_types="([^"]*)"/) { + $types=$1; + if (/order="([^"]*)"/) { + $order=$1; + foreach $type (split(",",$types)) { + $result->{$type}->{$layout}->{$order}=1; + } + } + } +} +close(IN); +open(IN,"../item_def.h"); +while (<IN>) { + if (/^ITEM2\([^,]*,(.*)\)/) { + $type=$1; + $result->{$type}->{"none"}=1; + } + if (/^ITEM\((.*)\)/) { + $type=$1; + $result->{$type}->{"none"}=1; + } +} +close(IN); +my $typefmt="%-30s"; +my $layoutfmt="%10s"; +printf($typefmt,""); +foreach $layout (@layouts) { + printf($layoutfmt,$layout); +} +printf("\n"); +foreach $type (sort keys %$result) { + $marker=""; + if (!$result->{$type}->{"none"}) { + $marker="#"; + } + printf($typefmt,$marker.$type); + foreach $layout (@layouts) { + @orders=sort keys %{$result->{$type}->{$layout}}; + $order=""; + if ($#orders >= 0) { + $order="*"; + } + printf($layoutfmt,$order); + } + printf("\n"); +} |