File: ctlwords.awk

package info (click to toggle)
mgp 1.13a+upstream20090219-11
  • links: PTS
  • area: main
  • in suites: buster
  • size: 4,128 kB
  • sloc: ansic: 32,387; sh: 4,295; lisp: 1,405; yacc: 945; lex: 264; makefile: 158; perl: 117; awk: 9
file content (9 lines) | stat: -rw-r--r-- 255 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
BEGIN {
	counter = 0;	# 0 origin
	printf("/* generated by ctlwords.awk. do not edit by hand. */\n");
}
/^\/\*CTL\*\// {
	word = substr($0, index($0, "CTL_"));
	word = substr(word, 0, index(word, ",") - 1);
	printf("#define\t%s\t%d\n", word, counter++);
}