[BACK]Return to actionnm.awk CVS log [TXT][DIR] Up to [Development] / linux-2.4-xfs / net / 802 / pseudo

File: [Development] / linux-2.4-xfs / net / 802 / pseudo / actionnm.awk (download)

Revision 1.1, Wed Dec 31 00:54:49 2003 UTC (13 years, 10 months ago) by cattelan
Branch: MAIN
CVS Tags: HEAD

Initial Import 2.4.24pre2

# usage: awk -f actionnm.awk pseudocode.h
#
BEGIN { "date" | getline
	today = $0
	printf("\n/* this file generated on %s  */\n", today )
	printf("\nstatic char *action_names[] = { \n    " )
	opl = 0
}

/^#define/ {			
	if ( opl > 3 ) {
	    printf("\n    ")
	    opl = 0
	}
	opl = opl +1
	t = sprintf("\"%s\"", $2 )
	printf("%-15s ,", t )
#	printf("%-10s", $2 )
}

END {		
	if ( opl > 3 ) {
	    printf("\n    ")
	}
	printf("\t  0\n};\n\n")
}