sen.awk (244B)
1 BEGIN { 2 print "enum {" 3 print "SEN_printargs = 0," 4 } 5 6 match($0, /SEN\([^)]+\)/) { 7 name = substr($0, RSTART + 4, RLENGTH - 5) 8 if (name != "printargs") 9 print "SEN_" name "," | "sort -u" 10 } 11 12 END { 13 if (close("sort -u")) 14 exit 1 15 print "};" 16 }