Blob


1 BEGIN {
2 FS = "[(,)]";
4 print "static struct cmds { const char *cmd; void(*fn)(struct buffer*); } cmds[] = {";
5 }
7 /^CMD/ {
8 s = $2;
9 sub("^cmd_", "", s);
10 gsub("_", "-", s);
11 printf("\t{ \"%s\", %s },\n", s, $2);
12 next;
13 }
15 /^DEFALIAS/ {
16 s = $2;
17 d = $3;
18 printf("\t{ \"%s\", %s },\n", s, d);
19 next
20 }
22 {
23 next;
24 }
26 END {
27 printf("\t{ NULL, NULL },\n");
28 print "};";
29 }