From c627d61324e9dcd5df833ee6236dd10415f5bac4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Jun 1996 05:04:20 +0000 Subject: Initial revision --- mkproto.awk | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 mkproto.awk (limited to 'mkproto.awk') 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; +} + -- cgit v1.2.1