[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Wed Sep 7 05:45:04 MDT 2011


The branch, master has been updated
       via  c640e92 s4-s3-upgrade: convert password age policies to the negative NTTIME format
       via  6154357 lib/addns: Remove unused TALLOC_ macros
       via  78c2eca build: Replace mkbuildoptions-waf awk script with waf target
       via  47f7e3c samba-tool: Add --filter option to ldapcmp to ignore specified attributes
       via  2fc233b s4-kcc: Fix the list of NCs for DRS replica information
      from  9bc4dec s3:smb2_server: return OBJECT_NAME_INVALID if the path is terminated in SMB2_FIND/QUERY_DIRECTORY

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c640e9235fe0af6eb7dd9474807942ffdecbb8c4
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Sep 7 12:21:00 2011 +1000

    s4-s3-upgrade: convert password age policies to the negative NTTIME format
    
    This previously caused all accounts to be locked out.
    
    Andrew Bartlett
    
    Autobuild-User: Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date: Wed Sep  7 13:44:44 CEST 2011 on sn-devel-104

commit 61543577fa3b7aeaee27800c239f6c78fb74fd26
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Sep 7 14:43:51 2011 +1000

    lib/addns: Remove unused TALLOC_ macros

commit 78c2eca811eb4f4303f46ee88fdbe51e220a6c92
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Sep 7 17:22:22 2011 +1000

    build: Replace mkbuildoptions-waf awk script with waf target

commit 47f7e3c525a79586008f14ad3cb2cb3311917524
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Sep 6 16:15:04 2011 +1000

    samba-tool: Add --filter option to ldapcmp to ignore specified attributes

commit 2fc233b78f35e4bc5062869d77985567d61d0f8a
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Sep 6 16:13:44 2011 +1000

    s4-kcc: Fix the list of NCs for DRS replica information
    
    AD DNS partitions (DomainDnsZones and ForestDnsZones) are listed
    under msDs-hasMasterNCs attribute for post-2003 windows servers.

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_patterns.py            |  174 ++++++++++++++
 lib/addns/dns.h                                  |   42 ----
 source3/script/mkbuildoptions-waf.awk            |  273 ----------------------
 source3/wscript_build                            |    5 +-
 source4/dsdb/kcc/kcc_drs_replica_info.c          |   24 ++-
 source4/scripting/python/samba/netcmd/ldapcmp.py |   29 ++-
 source4/scripting/python/samba/upgrade.py        |   29 ++-
 7 files changed, 237 insertions(+), 339 deletions(-)
 delete mode 100644 source3/script/mkbuildoptions-waf.awk


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index f064608..dc988c5 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -28,3 +28,177 @@ def SAMBA_MKVERSION(bld, target):
                             always=True)
     t.env.is_install = bld.is_install
 Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION
+
+
+def write_build_options_header(fp):
+    '''write preamble for build_options.c'''
+    fp.write("/*\n")
+    fp.write("   Unix SMB/CIFS implementation.\n")
+    fp.write("   Build Options for Samba Suite\n")
+    fp.write("   Copyright (C) Vance Lankhaar <vlankhaar at linux.ca> 2003\n")
+    fp.write("   Copyright (C) Andrew Bartlett <abartlet at samba.org> 2001\n")
+    fp.write("\n")
+    fp.write("   This program is free software; you can redistribute it and/or modify\n")
+    fp.write("   it under the terms of the GNU General Public License as published by\n")
+    fp.write("   the Free Software Foundation; either version 3 of the License, or\n")
+    fp.write("   (at your option) any later version.\n")
+    fp.write("\n")
+    fp.write("   This program is distributed in the hope that it will be useful,\n")
+    fp.write("   but WITHOUT ANY WARRANTY; without even the implied warranty of\n")
+    fp.write("   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n")
+    fp.write("   GNU General Public License for more details.\n")
+    fp.write("\n")
+    fp.write("   You should have received a copy of the GNU General Public License\n")
+    fp.write("   along with this program; if not, see <http://www.gnu.org/licenses/>.\n")
+    fp.write("*/\n")
+    fp.write("\n")
+    fp.write("#include \"includes.h\"\n")
+    fp.write("#include \"build_env.h\"\n")
+    fp.write("#include \"dynconfig/dynconfig.h\"\n")
+    fp.write("\n")
+    fp.write("static int output(bool screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);\n")
+    fp.write("void build_options(bool screen);\n")
+    fp.write("\n")
+    fp.write("\n")
+    fp.write("/****************************************************************************\n")
+    fp.write("helper function for build_options\n")
+    fp.write("****************************************************************************/\n")
+    fp.write("static int output(bool screen, const char *format, ...)\n")
+    fp.write("{\n")
+    fp.write("       char *ptr = NULL;\n")
+    fp.write("       int ret = 0;\n")
+    fp.write("       va_list ap;\n")
+    fp.write("       \n")
+    fp.write("       va_start(ap, format);\n")
+    fp.write("       ret = vasprintf(&ptr,format,ap);\n")
+    fp.write("       va_end(ap);\n")
+    fp.write("\n")
+    fp.write("       if (screen) {\n")
+    fp.write("              d_printf(\"%s\", ptr ? ptr : \"\");\n")
+    fp.write("       } else {\n")
+    fp.write("              DEBUG(4,(\"%s\", ptr ? ptr : \"\"));\n")
+    fp.write("       }\n")
+    fp.write("       \n")
+    fp.write("       SAFE_FREE(ptr);\n")
+    fp.write("       return ret;\n")
+    fp.write("}\n")
+    fp.write("\n")
+    fp.write("/****************************************************************************\n")
+    fp.write("options set at build time for the samba suite\n")
+    fp.write("****************************************************************************/\n")
+    fp.write("void build_options(bool screen)\n")
+    fp.write("{\n")
+    fp.write("       if ((DEBUGLEVEL < 4) && (!screen)) {\n")
+    fp.write("              return;\n")
+    fp.write("       }\n")
+    fp.write("\n")
+    fp.write("#ifdef _BUILD_ENV_H\n")
+    fp.write("       /* Output information about the build environment */\n")
+    fp.write("       output(screen,\"Build environment:\\n\");\n")
+    fp.write("       output(screen,\"   Built by:    %s@%s\\n\",BUILD_ENV_USER,BUILD_ENV_HOST);\n")
+    fp.write("       output(screen,\"   Built on:    %s\\n\",BUILD_ENV_DATE);\n")
+    fp.write("\n")
+    fp.write("       output(screen,\"   Built using: %s\\n\",BUILD_ENV_COMPILER);\n")
+    fp.write("       output(screen,\"   Build host:  %s\\n\",BUILD_ENV_UNAME);\n")
+    fp.write("       output(screen,\"   SRCDIR:      %s\\n\",BUILD_ENV_SRCDIR);\n")
+    fp.write("       output(screen,\"   BUILDDIR:    %s\\n\",BUILD_ENV_BUILDDIR);\n")
+    fp.write("\n")
+    fp.write("\n")
+    fp.write("#endif\n")
+    fp.write("\n")
+    fp.write("       /* Output various paths to files and directories */\n")
+    fp.write("       output(screen,\"\\nPaths:\\n\");\n")
+    fp.write("       output(screen,\"   SBINDIR: %s\\n\", get_dyn_SBINDIR());\n")
+    fp.write("       output(screen,\"   BINDIR: %s\\n\", get_dyn_BINDIR());\n")
+    fp.write("       output(screen,\"   SWATDIR: %s\\n\", get_dyn_SWATDIR());\n")
+    fp.write("       output(screen,\"   CONFIGFILE: %s\\n\", get_dyn_CONFIGFILE());\n")
+    fp.write("       output(screen,\"   LOGFILEBASE: %s\\n\", get_dyn_LOGFILEBASE());\n")
+    fp.write("       output(screen,\"   LMHOSTSFILE: %s\\n\",get_dyn_LMHOSTSFILE());\n")
+    fp.write("       output(screen,\"   LIBDIR: %s\\n\",get_dyn_LIBDIR());\n")
+    fp.write("       output(screen,\"   MODULESDIR: %s\\n\",get_dyn_MODULESDIR());\n")
+    fp.write("       output(screen,\"   SHLIBEXT: %s\\n\",get_dyn_SHLIBEXT());\n")
+    fp.write("       output(screen,\"   LOCKDIR: %s\\n\",get_dyn_LOCKDIR());\n")
+    fp.write("       output(screen,\"   STATEDIR: %s\\n\",get_dyn_STATEDIR());\n")
+    fp.write("       output(screen,\"   CACHEDIR: %s\\n\",get_dyn_CACHEDIR());\n")
+    fp.write("       output(screen,\"   PIDDIR: %s\\n\", get_dyn_PIDDIR());\n")
+    fp.write("       output(screen,\"   SMB_PASSWD_FILE: %s\\n\",get_dyn_SMB_PASSWD_FILE());\n")
+    fp.write("       output(screen,\"   PRIVATE_DIR: %s\\n\",get_dyn_PRIVATE_DIR());\n")
+    fp.write("\n")
+
+def write_build_options_footer(fp):
+    fp.write("       /* Output the sizes of the various types */\n")
+    fp.write("       output(screen, \"\\nType sizes:\\n\");\n")
+    fp.write("       output(screen, \"   sizeof(char):         %lu\\n\",(unsigned long)sizeof(char));\n")
+    fp.write("       output(screen, \"   sizeof(int):          %lu\\n\",(unsigned long)sizeof(int));\n")
+    fp.write("       output(screen, \"   sizeof(long):         %lu\\n\",(unsigned long)sizeof(long));\n")
+    fp.write("#if HAVE_LONGLONG\n")
+    fp.write("       output(screen, \"   sizeof(long long):    %lu\\n\",(unsigned long)sizeof(long long));\n")
+    fp.write("#endif\n")
+    fp.write("       output(screen, \"   sizeof(uint8):        %lu\\n\",(unsigned long)sizeof(uint8));\n")
+    fp.write("       output(screen, \"   sizeof(uint16):       %lu\\n\",(unsigned long)sizeof(uint16));\n")
+    fp.write("       output(screen, \"   sizeof(uint32):       %lu\\n\",(unsigned long)sizeof(uint32));\n")
+    fp.write("       output(screen, \"   sizeof(short):        %lu\\n\",(unsigned long)sizeof(short));\n")
+    fp.write("       output(screen, \"   sizeof(void*):        %lu\\n\",(unsigned long)sizeof(void*));\n")
+    fp.write("       output(screen, \"   sizeof(size_t):       %lu\\n\",(unsigned long)sizeof(size_t));\n")
+    fp.write("       output(screen, \"   sizeof(off_t):        %lu\\n\",(unsigned long)sizeof(off_t));\n")
+    fp.write("       output(screen, \"   sizeof(ino_t):        %lu\\n\",(unsigned long)sizeof(ino_t));\n")
+    fp.write("       output(screen, \"   sizeof(dev_t):        %lu\\n\",(unsigned long)sizeof(dev_t));\n")
+    fp.write("\n")
+    fp.write("       output(screen, \"\\nBuiltin modules:\\n\");\n")
+    fp.write("       output(screen, \"   %s\\n\", STRING_STATIC_MODULES);\n")
+    fp.write("}\n")
+
+def write_build_options_section(fp, keys, section):
+    fp.write("\n\t/* Show %s */\n" % section)
+    fp.write("       output(screen, \"\\n%s:\\n\");\n\n" % section)
+
+    for k in sorted(keys):
+        fp.write("#ifdef %s\n" % k)
+        fp.write("       output(screen, \"   %s\\n\");\n" % k)
+        fp.write("#endif\n")
+    fp.write("\n")
+
+def write_build_options(task):
+    tbl = task.env['defines']
+    keys_option_with = []
+    keys_option_utmp = []
+    keys_option_have = []
+    keys_header_sys = []
+    keys_header_other = []
+    keys_misc = []
+    for key in tbl:
+        if key.startswith("HAVE_UT_UT_") or key.find("UTMP") >= 0:
+            keys_option_utmp.append(key)
+        elif key.startswith("WITH_"):
+            keys_option_with.append(key)
+        elif key.startswith("HAVE_SYS_"):
+            keys_header_sys.append(key)
+        elif key.startswith("HAVE_"):
+            if key.endswith("_H"):
+                keys_header_other.append(key)
+            else:
+                keys_option_have.append(key)
+        else:
+            keys_misc.append(key)
+
+    tgt = task.outputs[0].bldpath(task.env)
+    f = open(tgt, 'w')
+    write_build_options_header(f)
+    write_build_options_section(f, keys_header_sys, "System Headers")
+    write_build_options_section(f, keys_header_other, "Headers")
+    write_build_options_section(f, keys_option_utmp, "UTMP Options")
+    write_build_options_section(f, keys_option_have, "HAVE_* Defines")
+    write_build_options_section(f, keys_option_with, "--with Options")
+    write_build_options_section(f, keys_misc, "Build Options")
+    write_build_options_footer(f)
+    f.close()
+    return 0
+
+
+def SAMBA_BLDOPTIONS(bld, target):
+    '''generate the bld_options.c for Samba'''
+    t = bld.SAMBA_GENERATOR(target,
+                            rule=write_build_options,
+                            target=target,
+                            always=True)
+Build.BuildContext.SAMBA_BLDOPTIONS = SAMBA_BLDOPTIONS
diff --git a/lib/addns/dns.h b/lib/addns/dns.h
index 29f1ed3..6ccdbb6 100644
--- a/lib/addns/dns.h
+++ b/lib/addns/dns.h
@@ -95,48 +95,6 @@
 
 #include <talloc.h>
 
-#if 0
-
-Disable these now we have checked all code paths and ensured
-NULL returns on zero request. JRA.
-
-void *_talloc_zero_zeronull(const void *ctx, size_t size, const char *name);
-void *_talloc_memdup_zeronull(const void *t, const void *p, size_t size, const char *name);
-void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
-void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
-void *talloc_zeronull(const void *context, size_t size, const char *name);
-
-#define TALLOC(ctx, size) talloc_zeronull(ctx, size, __location__)
-#define TALLOC_P(ctx, type) (type *)talloc_zeronull(ctx, sizeof(type), #type)
-#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array_zeronull(ctx, sizeof(type), count, #type)
-#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup_zeronull(ctx, ptr, size, __location__)
-#define TALLOC_ZERO(ctx, size) _talloc_zero_zeronull(ctx, size, __location__)
-#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero_zeronull(ctx, sizeof(type), #type)
-#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array_zeronull(ctx, sizeof(type), count, #type)
-#define TALLOC_SIZE(ctx, size) talloc_zeronull(ctx, size, __location__)
-#define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero_zeronull(ctx, size, __location__)
-
-#else
-
-#define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__)
-#define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)
-#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type)
-#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__)
-#define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__)
-#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type)
-#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type)
-#define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__)
-#define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__)
-
-#endif
-
-#define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__)
-#define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type)
-#define talloc_destroy(ctx) talloc_free(ctx)
-#ifndef TALLOC_FREE
-#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
-#endif
-
 /*******************************************************************
    Type definitions for int16, int32, uint16 and uint32.  Needed
    for Samba coding style
diff --git a/source3/script/mkbuildoptions-waf.awk b/source3/script/mkbuildoptions-waf.awk
deleted file mode 100644
index 2d7063a..0000000
--- a/source3/script/mkbuildoptions-waf.awk
+++ /dev/null
@@ -1,273 +0,0 @@
-BEGIN {
-	print "/* ";
-	print "   Unix SMB/CIFS implementation.";
-	print "   Build Options for Samba Suite";
-	print "   Copyright (C) Vance Lankhaar <vlankhaar at linux.ca> 2003";
-	print "   Copyright (C) Andrew Bartlett <abartlet at samba.org> 2001";
-	print "   ";
-	print "   This program is free software; you can redistribute it and/or modify";
-	print "   it under the terms of the GNU General Public License as published by";
-	print "   the Free Software Foundation; either version 3 of the License, or";
-	print "   (at your option) any later version.";
-	print "   ";
-	print "   This program is distributed in the hope that it will be useful,";
-	print "   but WITHOUT ANY WARRANTY; without even the implied warranty of";
-	print "   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the";
-	print "   GNU General Public License for more details.";
-	print "   ";
-	print "   You should have received a copy of the GNU General Public License";
-	print "   along with this program; if not, see <http://www.gnu.org/licenses/>."
-	print "*/";
-	print "";
-	print "#include \"includes.h\"";
-	print "#include \"build_env.h\"";
-	print "#include \"dynconfig/dynconfig.h\"";
-	print "";
-	print "static int output(bool screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);";
-	print "void build_options(bool screen);";
-	print "";
-	print "";
-	print "/****************************************************************************";
-	print "helper function for build_options";
-	print "****************************************************************************/";
-	print "static int output(bool screen, const char *format, ...)";
-	print "{";
-	print "       char *ptr = NULL;";
-	print "       int ret = 0;";
-	print "       va_list ap;";
-	print "       ";
-	print "       va_start(ap, format);";
-	print "       ret = vasprintf(&ptr,format,ap);";
-	print "       va_end(ap);";
-	print "";
-	print "       if (screen) {";
-	print "              d_printf(\"%s\", ptr ? ptr : \"\");";
-	print "       } else {";
-	print "	       DEBUG(4,(\"%s\", ptr ? ptr : \"\"));";
-	print "       }";
-	print "       ";
-	print "       SAFE_FREE(ptr);";
-	print "       return ret;";
-	print "}";
-	print "";
-	print "/****************************************************************************";
-	print "options set at build time for the samba suite";
-	print "****************************************************************************/";
-	print "void build_options(bool screen)";
-	print "{";
-	print "       if ((DEBUGLEVEL < 4) && (!screen)) {";
-	print "	       return;";
-	print "       }";
-	print "";
-	print "#ifdef _BUILD_ENV_H";
-	print "       /* Output information about the build environment */";
-	print "       output(screen,\"Build environment:\\n\");";
-	print "       output(screen,\"   Built by:    %s@%s\\n\",BUILD_ENV_USER,BUILD_ENV_HOST);";
-	print "       output(screen,\"   Built on:    %s\\n\",BUILD_ENV_DATE);";
-	print "";
-	print "       output(screen,\"   Built using: %s\\n\",BUILD_ENV_COMPILER);";
-	print "       output(screen,\"   Build host:  %s\\n\",BUILD_ENV_UNAME);";
-	print "       output(screen,\"   SRCDIR:      %s\\n\",BUILD_ENV_SRCDIR);";
-	print "       output(screen,\"   BUILDDIR:    %s\\n\",BUILD_ENV_BUILDDIR);";
-	print "";
-	print "     ";
-	print "#endif";
-	print "";
-
-	print "       /* Output various paths to files and directories */";
-	print "       output(screen,\"\\nPaths:\\n\");";
-
-	print "       output(screen,\"   SBINDIR: %s\\n\", get_dyn_SBINDIR());";
-	print "       output(screen,\"   BINDIR: %s\\n\", get_dyn_BINDIR());";
-	print "       output(screen,\"   SWATDIR: %s\\n\", get_dyn_SWATDIR());";
-
-	print "       output(screen,\"   CONFIGFILE: %s\\n\", get_dyn_CONFIGFILE());";
-	print "       output(screen,\"   LOGFILEBASE: %s\\n\", get_dyn_LOGFILEBASE());";
-	print "       output(screen,\"   LMHOSTSFILE: %s\\n\",get_dyn_LMHOSTSFILE());";
-
-	print "       output(screen,\"   LIBDIR: %s\\n\",get_dyn_LIBDIR());";
-	print "       output(screen,\"   MODULESDIR: %s\\n\",get_dyn_MODULESDIR());";
-	print "       output(screen,\"   SHLIBEXT: %s\\n\",get_dyn_SHLIBEXT());";
-
-	print "       output(screen,\"   LOCKDIR: %s\\n\",get_dyn_LOCKDIR());";
-	print "       output(screen,\"   STATEDIR: %s\\n\",get_dyn_STATEDIR());";
-	print "       output(screen,\"   CACHEDIR: %s\\n\",get_dyn_CACHEDIR());";
-	print "       output(screen,\"   PIDDIR: %s\\n\", get_dyn_PIDDIR());";
-
-	print "       output(screen,\"   SMB_PASSWD_FILE: %s\\n\",get_dyn_SMB_PASSWD_FILE());";
-	print "       output(screen,\"   PRIVATE_DIR: %s\\n\",get_dyn_PRIVATE_DIR());";
-	print "";
-
-
-##################################################
-# predefine first element of *_ary
-# predefine *_i (num of elements in *_ary)
-	with_ary[0]="";
-	with_i=0;
-	have_ary[0]="";
-	have_i=0;
-	utmp_ary[0]="";
-	utmp_i=0;
-	misc_ary[0]="";
-	misc_i=0;
-	sys_ary[0]="";
-	sys_i=0;
-	headers_ary[0]="";
-	headers_i=0;
-	in_comment = 0;
-}
-
-# capture single line comments
-/^\/\* (.*?)\*\// {
-	last_comment = $0;
-	next;
-}
-
-# end capture multi-line comments
-/(.*?)\*\// {
-	last_comment = last_comment $0;
-	in_comment = 0;
-	next;
-}
-
-# capture middle lines of multi-line comments
-in_comment {
-	last_comment = last_comment $0;
-	next;
-}
-
-# begin capture multi-line comments
-/^\/\* (.*?)/ {
-	last_comment = $0;
-	in_comment = 1;
-	next
-}
-
-##################################################
-# if we have an #undef and a last_comment, store it
-/^\#define/ {
-	split($0,a);
-	comments_ary[a[2]] = last_comment;
-	last_comment = "";
-}
-
-##################################################
-# for each line, sort into appropriate section
-# then move on
-
-/^\#define WITH/ {
-	with_ary[with_i++] = a[2];
-	# we want (I think) to allow --with to show up in more than one place, so no next
-}
-
-
-/^\#define HAVE_UT_UT_/ || /^\#define .*UTMP/ {
-	utmp_ary[utmp_i++] = a[2];
-	next;
-}
-
-/^\#define HAVE_SYS_.*?_H$/ {
-	sys_ary[sys_i++] = a[2];
-	next;
-}
-
-/^\#define HAVE_.*?_H$/ {
-	headers_ary[headers_i++] = a[2];
-	next;
-}
-
-/^\#define HAVE_/ {
-	have_ary[have_i++] = a[2];
-	next;
-}
-
-/^\#define/ {
-	misc_ary[misc_i++] = a[2];
-	next;
-}
-
-
-##################################################
-# simple sort function
-function sort(ARRAY, ELEMENTS) {
-        for (i = 1; i <= ELEMENTS; ++i) {
-                for (j = i; (j-1) in ARRAY && (j) in ARRAY && ARRAY[j-1] > ARRAY[j]; --j) {
-                        temp = ARRAY[j];
-			ARRAY[j] = ARRAY[j-1];
-			ARRAY[j-1] = temp;
-		}
-        }
-	return;
-}
-
-
-##################################################
-# output code from list of defined
-# expects: ARRAY     an array of things defined
-#          ELEMENTS  number of elements in ARRAY
-#          TITLE     title for section
-# returns: nothing
-function output(ARRAY, ELEMENTS, TITLE) {
-
-	# add section header
-	print "\n\t/* Show " TITLE " */";
-	print "\toutput(screen, \"\\n " TITLE ":\\n\");\n";
-
-
-	# sort element using bubble sort (slow, but easy)
-	sort(ARRAY, ELEMENTS);
-
-	# loop through array of defines, outputting code
-	for (i = 0; i < ELEMENTS; i++) {
-		print "#ifdef " ARRAY[i];
-
-		# I don't know which one to use....
-
-		print "\toutput(screen, \"   " ARRAY[i] "\\n\");";
-		#printf "\toutput(screen, \"   %s\\n   %s\\n\\n\");\n", comments_ary[ARRAY[i]], ARRAY[i];
-		#printf "\toutput(screen, \"   %-35s   %s\\n\");\n", ARRAY[i], comments_ary[ARRAY[i]];
-
-		print "#endif";
-	}
-	return;
-}
-
-END {
-	##################################################
-	# add code to show various options
-	print "/* Output various other options (as gleaned from include/config.h.in) */";
-	output(sys_ary,     sys_i,     "System Headers");
-	output(headers_ary, headers_i, "Headers");
-	output(utmp_ary,    utmp_i,    "UTMP Options");
-	output(have_ary,    have_i,    "HAVE_* Defines");
-	output(with_ary,    with_i,    "--with Options");
-	output(misc_ary,    misc_i,    "Build Options");
-
-	##################################################
-	# add code to display the various type sizes
-	print "       /* Output the sizes of the various types */";
-	print "       output(screen, \"\\nType sizes:\\n\");";
-	print "       output(screen, \"   sizeof(char):         %lu\\n\",(unsigned long)sizeof(char));";
-	print "       output(screen, \"   sizeof(int):          %lu\\n\",(unsigned long)sizeof(int));";
-	print "       output(screen, \"   sizeof(long):         %lu\\n\",(unsigned long)sizeof(long));";
-	print "#if HAVE_LONGLONG"
-	print "       output(screen, \"   sizeof(long long):    %lu\\n\",(unsigned long)sizeof(long long));";
-	print "#endif"
-	print "       output(screen, \"   sizeof(uint8):        %lu\\n\",(unsigned long)sizeof(uint8));";
-	print "       output(screen, \"   sizeof(uint16):       %lu\\n\",(unsigned long)sizeof(uint16));";
-	print "       output(screen, \"   sizeof(uint32):       %lu\\n\",(unsigned long)sizeof(uint32));";
-	print "       output(screen, \"   sizeof(short):        %lu\\n\",(unsigned long)sizeof(short));";


-- 
Samba Shared Repository


More information about the samba-cvs mailing list