summaryrefslogtreecommitdiff
path: root/munch.awk
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-02-18 01:27:10 +0000
committerRoland McGrath <roland@gnu.org>1995-02-18 01:27:10 +0000
commit28f540f45bbacd939bfd07f213bcad2bf730b1bf (patch)
tree15f07c4c43d635959c6afee96bde71fb1b3614ee /munch.awk
initial import
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 }