- added initial support for trusted domains in winbindd_ads
[kai/samba.git] / source3 / script / mkproto.awk
index 8ef414266abe9d826c36ed7b44a29102955577f4..7c8bc3d6cfbc2e11cef5c2322d9ef677c4713fa3 100644 (file)
@@ -2,8 +2,12 @@ BEGIN {
   inheader=0;
 #  use_ldap_define = 0;
   current_file="";
-  print "#ifndef _PROTO_H_"
-  print "#define _PROTO_H_"
+  if (headername=="") {
+    headername="_PROTO_H_";
+  }
+
+  print "#ifndef",headername
+  print "#define",headername
   print "/* This file is automatically generated with \"make proto\". DO NOT EDIT */"
   print ""
 }
@@ -20,13 +24,9 @@ END {
 #      use_ldap_define = 0;
 #    }
     print ""
-    print "/*The following definitions come from ",FILENAME," */"
+    print "/* The following definitions come from",FILENAME," */"
     print ""
     current_file=FILENAME
-#    if (current_file=="ldap.c") {
-#      print "#ifdef USE_LDAP"
-#      use_ldap_define = 1;
-#    }
   }
   if (inheader) {
     if (match($0,"[)][ \t]*$")) {
@@ -39,6 +39,20 @@ END {
   }
 }
 
+# special handling for code merge of TNG to head
+/^#define OLD_NTDOMAIN 1/ {
+  printf "#if OLD_NTDOMAIN\n"
+}
+/^#undef OLD_NTDOMAIN/ {
+  printf "#endif\n"
+}
+/^#define NEW_NTDOMAIN 1/ {
+  printf "#if NEW_NTDOMAIN\n"
+}
+/^#undef NEW_NTDOMAIN/ {
+  printf "#endif\n"
+}
+
 # we handle the loadparm.c fns separately
 
 /^FN_LOCAL_BOOL/ {
@@ -46,6 +60,11 @@ END {
   printf "BOOL %s(int );\n", a[2]
 }
 
+/^FN_LOCAL_LIST/ {
+  split($0,a,"[,()]")
+  printf "char **%s(int );\n", a[2]
+}
+
 /^FN_LOCAL_STRING/ {
   split($0,a,"[,()]")
   printf "char *%s(int );\n", a[2]
@@ -66,6 +85,11 @@ END {
   printf "BOOL %s(void);\n", a[2]
 }
 
+/^FN_GLOBAL_LIST/ {
+  split($0,a,"[,()]")
+  printf "char **%s(void);\n", a[2]
+}
+
 /^FN_GLOBAL_STRING/ {
   split($0,a,"[,()]")
   printf "char *%s(void);\n", a[2]
@@ -90,21 +114,26 @@ END {
 
 {
   gotstart = 0;
-  if( $0 ~ /^connection_struct|^pipes_struct|^file_fd_struct|^files_struct|^connection_struct|^uid_t|^gid_t|^unsigned|^mode_t|^DIR|^user|^int|^pid_t|^ino_t|^off_t/ ) {
+  if( $0 ~ /^const|^connection_struct|^pipes_struct|^file_fd_struct|^files_struct|^connection_struct|^uid_t|^gid_t|^unsigned|^mode_t|^DIR|^user|^int|^pid_t|^ino_t|^off_t/ ) {
     gotstart = 1;
   }
 
-  if( $0 ~ /^LOCAL_GRP|^DOMAIN_GRP|^SMB_STRUCT_DIRENT|^SEC_ACL|^SEC_DESC|^SEC_DESC_BUF|^DOM_SID/ ) {
+  if( $0 ~ /^vuser_key|^UNISTR2|^LOCAL_GRP|^DOMAIN_GRP|^SMB_STRUCT_DIRENT|^SEC_ACL|^SEC_DESC|^SEC_DESC_BUF|^DOM_SID|^RPC_HND_NODE|^BYTE/ ) {
     gotstart = 1;
   }
 
-  if( $0 ~ /^TDB_CONTEXT|^TDB_DATA|^smb_ucs2_t|^TALLOC_CTX/ ) {
+  if( $0 ~ /^ADS_STRUCT|^ADS_RETURN_CODE|^DATA_BLOB|^ASN1_DATA|^TDB_CONTEXT|^TDB_DATA|^smb_ucs2_t|^TALLOC_CTX|^hash_element|^NT_DEVICEMODE|^enum.*\(|^NT_USER_TOKEN|^SAM_ACCOUNT/ ) {
     gotstart = 1;
   }
 
-  if( $0 ~ /^long|^char|^uint|^struct|^BOOL|^void|^time|^smb_shm_offset_t|^shm_offset_t|^enum remote_arch_types|^FILE|^SMB_OFF_T|^size_t|^ssize_t|^SMB_BIG_UINT/ ) {
+  if( $0 ~ /^smb_iconv_t|^long|^char|^uint|^NTSTATUS|^WERROR|^CLI_POLICY_HND|^struct|^BOOL|^void|^time|^smb_shm_offset_t|^shm_offset_t|^FILE|^XFILE|^SMB_OFF_T|^size_t|^ssize_t|^SMB_BIG_UINT/ ) {
     gotstart = 1;
   }
+
+  if( $0 ~ /^SAM_ACCT_INFO_NODE|^SMB_ACL_T/ ) {
+    gotstart = 1;
+  }
+
   if(!gotstart) {
     next;
   }