patch-2.1.15 linux/net/802/pseudo/actionnm.awk
Next file: linux/net/802/pseudo/actionnm.h
Previous file: linux/net/802/pseudo/Makefile
Back to the patch index
Back to the overall index
- Lines: 28
- Date:
Thu Dec 12 16:54:22 1996
- Orig file:
v2.1.14/linux/net/802/pseudo/actionnm.awk
- Orig date:
Thu Jan 1 02:00:00 1970
diff -u --recursive --new-file v2.1.14/linux/net/802/pseudo/actionnm.awk linux/net/802/pseudo/actionnm.awk
@@ -0,0 +1,27 @@
+# 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")
+}
+
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov