From 67d6660a883e5545744d4c3e604632034d806d8a Mon Sep 17 00:00:00 2001 From: martin-s Date: Sun, 25 Oct 2009 12:43:09 +0000 Subject: [PATCH] Add:Script:Script to check itemgra definitions git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2687 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/script/itemgra.pl | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 navit/navit/script/itemgra.pl diff --git a/navit/navit/script/itemgra.pl b/navit/navit/script/itemgra.pl new file mode 100755 index 0000000..bbe02b0 --- /dev/null +++ b/navit/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 () { + if (/{$type}->{$layout}->{$order}=1; + } + } + } +} +close(IN); +open(IN,"../item_def.h"); +while () { + 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"); +} -- 2.7.4