summaryrefslogtreecommitdiff
path: root/mkproto.awk
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-06-22 05:04:20 +0000
committerAndrew Tridgell <tridge@samba.org>1996-06-22 05:04:20 +0000
commitc627d61324e9dcd5df833ee6236dd10415f5bac4 (patch)
tree384b9c6d306a026fa5336d585622e9960cefcc83 /mkproto.awk
downloadrsync-c627d61324e9dcd5df833ee6236dd10415f5bac4.tar.gz
Initial revision
Diffstat (limited to 'mkproto.awk')
-rw-r--r--mkproto.awk41
1 files changed, 41 insertions, 0 deletions
diff --git a/mkproto.awk b/mkproto.awk
new file mode 100644
index 00000000..0eb03de6
--- /dev/null
+++ b/mkproto.awk
@@ -0,0 +1,41 @@
+# generate prototypes for Samba C code
+# tridge, June 1996
+
+BEGIN {
+ inheader=0;
+ print "/* This file is automatically generated with \"make proto\". DO NOT EDIT */"
+ print ""
+}
+
+{
+ if (inheader) {
+ if (match($0,"[)][ \t]*$")) {
+ inheader = 0;
+ printf "%s;\n",$0;
+ } else {
+ printf "%s\n",$0;
+ }
+ next;
+ }
+}
+
+/^static|^extern/ || !/^[a-zA-Z]/ || /[;]/ {
+ next;
+}
+
+!/^off_t|^unsigned|^mode_t|^DIR|^user|^int|^char|^uint|^struct|^BOOL|^void|^time/ {
+ next;
+}
+
+
+/[(].*[)][ \t]*$/ {
+ printf "%s;\n",$0;
+ next;
+}
+
+/[(]/ {
+ inheader=1;
+ printf "%s\n",$0;
+ next;
+}
+