File: gen_defs

package info (click to toggle)
mutt 0.91.2-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 2,056 kB
  • ctags: 2,189
  • sloc: ansic: 34,582; sh: 203; makefile: 197; perl: 21; awk: 2
file content (31 lines) | stat: -rwxr-xr-x 503 bytes parent folder | download
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
#!/bin/sh

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='s;^[^ ]* *\(.*\);	\1,;'
			;;
		*)
			echo "enum {"
			expr='s;^\([^ ]*\).*;	\1,;'
			;;
	esac
	for i in $*; do
		sed -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