3 printf "/* %s.c - automatically generated from %s.ct */\n", \
4 rootname, rootname > outfile
5 print "#include <ss/ss.h>" > outfile
7 print "#ifndef __STDC__" > outfile
8 print "#define const" > outfile
9 print "#endif" > outfile
17 printf "static char const * const ssu%05d[] = {\n", cmdnum > outfile
21 subr = substr($0, 6, length($0)-5)
25 help = substr($0, 6, length($0)-5)
29 cmd = substr($0, 6, length($0)-5)
30 printf "%s\"%s\",\n", cmdtab, cmd > outfile
35 opt = substr($0, 6, length($0)-5)
36 if (opt == "dont_list") {
39 if (opt == "dont_summarize") {
45 print " (char const *)0" > outfile
47 printf "extern void %s __SS_PROTO;\n", subr > outfile
48 subr_tab[cmdnum] = subr
49 options_tab[cmdnum] = options
50 help_tab[cmdnum] = help
58 error = substr($0, 8, length($0)-7)
59 printf "Error in line %d: %s\n", linenum, error
60 print "#__ERROR_IN_FILE__" > outfile
64 printf "static ss_request_entry ssu%05d[] = {\n", cmdnum+1 > outfile
65 for (i=1; i <= cmdnum; i++) {
66 printf " { ssu%05d,\n", i > outfile
67 printf " %s,\n", subr_tab[i] > outfile
68 printf " \"%s\",\n", help_tab[i] > outfile
69 printf " %d },\n", options_tab[i] > outfile
71 print " { 0, 0, 0, 0 }" > outfile
74 printf "ss_request_table %s = { 2, ssu%05d };\n", \
75 cmdtbl, cmdnum+1 > outfile