summaryrefslogtreecommitdiff
path: root/source3/script
diff options
context:
space:
mode:
Diffstat (limited to 'source3/script')
-rw-r--r--source3/script/mkproto.awk39
1 files changed, 39 insertions, 0 deletions
diff --git a/source3/script/mkproto.awk b/source3/script/mkproto.awk
new file mode 100644
index 0000000000..4bf0d3c37d
--- /dev/null
+++ b/source3/script/mkproto.awk
@@ -0,0 +1,39 @@
+# generate prototypes for Samba C code
+
+
+BEGIN {
+ inheader=0;
+}
+
+{
+ if (inheader) {
+ if (match($0,"[)][ \t]*$")) {
+ inheader = 0;
+ printf "%s;\n",$0;
+ } else {
+ printf "%s\n",$0;
+ }
+ next;
+ }
+}
+
+/^static|^extern/ || !/^[a-zA-Z]/ || /[;]/ {
+ next;
+}
+
+!/^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;
+}
+