some playing with bbs - new fm
[mirrors/Programs.git] / bash / bbs / utils / fm / fm / gen_protos.sh
diff --git a/bash/bbs/utils/fm/fm/gen_protos.sh b/bash/bbs/utils/fm/fm/gen_protos.sh
new file mode 100755 (executable)
index 0000000..a000f57
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+TYPES='void|char|int|File|gboolean|GNode|GList|WINDOW'
+
+egrep -h '^('$TYPES').*;$' *.c | sed 's/^/extern /'
+echo
+
+for file in *.c; do
+       echo '/* ' $file ' */'
+       egrep '^('$TYPES').*(\)|,)$' $file | grep -v '^int main(.*)' | sed 's/)$/);/'
+       echo
+done
+echo '#endif'
This page took 0.354767 seconds and 4 git commands to generate.