summaryrefslogtreecommitdiff
path: root/navit/script/dump_types
blob: ca1bbdfffa717874354136744f4762f6fc2e1b71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/sh
IFS="(),"
function print_defs
{
	type=$1
	while read a1 a2 a3
	do
		case $a1 in
		*2)
			id=$(($a2))
			name=$a3
			;;
		*)
			name=$a2
		esac
		printf "%s%s 0x%x\n" $type $name $id
		id=$((id+1))
	done
}
dir=$0
dir=${dir%/*}
dir=$dir/../
id=0
grep ^ITEM $dir/item_def.h | print_defs type_
id=0
grep ^ATTR $dir/attr_def.h | print_defs attr_