summaryrefslogtreecommitdiffstats
path: root/gen_defs
blob: 7a3d9a0c2d350e7488fbc9f428c7e7cec2cfd900 (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
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

# $Id$

echo '/* Automatically generated by gen_defs.  Do not edit! */'
echo ''

for mode in help defs; do
	case $mode in
		help)
			echo "#ifdef HELP_C"
			echo "const char *HelpStrings[] = {"
			expr='i\
	/* L10N: Help screen function description.\
	         Generated from one of the OPS files. */
s;^[^ ]* *\(.*\);	N_(\1),;'
			;;
		*)
			echo "enum {"
			expr='s;^\([^ ]*\).*;	\1,;'
			;;
	esac
	for i in $*; do
		sed -e '/^\/\*/d' -e "$expr" < $i
	done
	if test $mode = help; then
		echo '	NULL'
	else
		echo '	OP_MAX'
	fi
	echo "};"
	if test $mode = help; then
		echo "#endif /* MAIN_C */"
		echo ''
	fi
done

exit 0