diff options
Diffstat (limited to 'navit/script/dump_types')
-rwxr-xr-x | navit/script/dump_types | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/navit/script/dump_types b/navit/script/dump_types new file mode 100755 index 000000000..d75ecb67f --- /dev/null +++ b/navit/script/dump_types @@ -0,0 +1,29 @@ +#! /bin/sh +function print_defs +{ + type=$1 + while read line + do + case $line in + *2\(*) + id=${line%%,*} + id=${id#*(} + id=$(($id)) + name=${line%%)*} + name=${name#*,} + printf "%s%s 0x%x\n" $type $name $id + id=$((id+1)) + ;; + *) + name=${line%%)*} + name=${name#*(} + printf "%s%s 0x%x\n" $type $name $id + id=$((id+1)) + esac + done +} + +id=0 +grep ^ITEM ../item_def.h | print_defs type_ +id=0 +grep ^ATTR ../attr_def.h | print_defs attr_ |