Added source filename to give crude index
[samba.git] / source / script / mkproto.awk
index d7b042652d1e7fb76ca9a569d9537f1183d2ac27..78f3fa080b3933fcc2aabf67bf5a510aa1aed958 100644 (file)
@@ -1,11 +1,22 @@
 # generate prototypes for Samba C code
 # tridge, June 1996
+# added comment for each source file for use as crude index
+# dan, 17 June 1996
 
 BEGIN {
   inheader=0;
+  current_file="";
+  print "/* This file is automatically generated with \"make proto\". DO NOT EDIT */"
+  print ""
 }
 
 {
+  if (FILENAME!=current_file) {
+    print ""
+    print "/*The following definitions come from ",FILENAME," */"
+    print ""
+    current_file=FILENAME
+  }
   if (inheader) {
     if (match($0,"[)][ \t]*$")) {
       inheader = 0;
@@ -17,6 +28,43 @@ BEGIN {
   }
 }
 
+# we handle the loadparm.c fns separately
+
+/^FN_LOCAL_BOOL/ {
+  split($0,a,"[,()]")
+  printf "BOOL %s(int );\n", a[2]
+}
+
+/^FN_LOCAL_STRING/ {
+  split($0,a,"[,()]")
+  printf "char *%s(int );\n", a[2]
+}
+
+/^FN_LOCAL_INT/ {
+  split($0,a,"[,()]")
+  printf "int %s(int );\n", a[2]
+}
+
+/^FN_LOCAL_CHAR/ {
+  split($0,a,"[,()]")
+  printf "char %s(int );\n", a[2]
+}
+
+/^FN_GLOBAL_BOOL/ {
+  split($0,a,"[,()]")
+  printf "BOOL %s(void);\n", a[2]
+}
+
+/^FN_GLOBAL_STRING/ {
+  split($0,a,"[,()]")
+  printf "char *%s(void);\n", a[2]
+}
+
+/^FN_GLOBAL_INT/ {
+  split($0,a,"[,()]")
+  printf "int %s(void);\n", a[2]
+}
+
 /^static|^extern/ || !/^[a-zA-Z]/ || /[;]/ {
   next;
 }