summary refs log tree commit diff
path: root/munch.awk
diff options
context:
space:
mode:
Diffstat (limited to 'munch.awk')
-rw-r--r--munch.awk11
1 files changed, 11 insertions, 0 deletions
diff --git a/munch.awk b/munch.awk
new file mode 100644
index 0000000000..1ed68686c1
--- /dev/null
+++ b/munch.awk
@@ -0,0 +1,11 @@
+BEGIN { special = 0 }
+
+/EXTERNS/ { ndirs = split(subdirs, dirs)
+	    for (i = 1; i <= ndirs; ++i)
+	    	printf "extern void __init_%s __P ((int argc, char **argv, char **envp));\n", dirs[i]
+	    special = 1 }
+/CALLS/ { ndirs = split(subdirs, dirs)
+	  for (i = 1; i <= ndirs; ++i) printf "  __init_%s (argc, argv, envp);\n", dirs[i]
+	  special = 1 }
+
+{ if (special == 0) print $0; special = 0 }