- pre1:
[davej-history.git] / net / 802 / pseudo / actionnm.awk
blobb5ca782896421272b59803205859689bbec05667
1 # usage: awk -f actionnm.awk pseudocode.h
3 BEGIN { "date" | getline
4 today = $0
5 printf("\n/* this file generated on %s */\n", today )
6 printf("\nstatic char *action_names[] = { \n " )
7 opl = 0
10 /^#define/ {
11 if ( opl > 3 ) {
12 printf("\n ")
13 opl = 0
15 opl = opl +1
16 t = sprintf("\"%s\"", $2 )
17 printf("%-15s ,", t )
18 # printf("%-10s", $2 )
21 END {
22 if ( opl > 3 ) {
23 printf("\n ")
25 printf("\t 0\n};\n\n")