[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha3-17-gd777a83

Jelmer Vernooij jelmer at samba.org
Wed Apr 2 14:53:38 GMT 2008


The branch, v4-0-test has been updated
       via  d777a83b8478bf09a45eccde38036eccbd219df8 (commit)
       via  9692a48aeb1c22a86a98ca736f173b2332a87480 (commit)
       via  4d1fb503de31c5c81eb22cdd0a61eae5e4813b40 (commit)
       via  e67d8c7b6a5035c64d96ff92494ae38f7b6d8205 (commit)
       via  ba91b609f5a6e2dd93b931a155cbce0c27ebd6d6 (commit)
       via  873941d8a8dca8e7ace83f9af9939e4264f78c96 (commit)
       via  d4272bc6bcfcd71fa93edb25bb33d6458e8b33cd (commit)
       via  c46b7e90e347da76156ddcae4866adb88e9fec21 (commit)
       via  03226035aaa8d4fc68996b08bc6beb43feabbd3a (commit)
       via  2dc2bb800dab3f7dbdba01f5ca5076edd1a2b0f3 (commit)
      from  696b58f5dd8370b7ee0670c7a3e5db10234b41ff (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit d777a83b8478bf09a45eccde38036eccbd219df8
Merge: 9692a48aeb1c22a86a98ca736f173b2332a87480 696b58f5dd8370b7ee0670c7a3e5db10234b41ff
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Apr 2 16:53:10 2008 +0200

    Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into tmp

commit 9692a48aeb1c22a86a98ca736f173b2332a87480
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 1 16:08:21 2008 +0200

    Include right perl directory when installed.

commit 4d1fb503de31c5c81eb22cdd0a61eae5e4813b40
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 1 16:05:54 2008 +0200

    Install samba-hostconfig library.

commit e67d8c7b6a5035c64d96ff92494ae38f7b6d8205
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 1 16:03:31 2008 +0200

    Install pidl to the same directory as Samba.

commit ba91b609f5a6e2dd93b931a155cbce0c27ebd6d6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 1 15:53:45 2008 +0200

    Fix dependency on samba-hostconfig.

commit 873941d8a8dca8e7ace83f9af9939e4264f78c96
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 1 15:26:00 2008 +0200

    Add context pointer to secrets functions.

commit d4272bc6bcfcd71fa93edb25bb33d6458e8b33cd
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 1 15:17:18 2008 +0200

    Add userdata argument to reseed callback function.

commit c46b7e90e347da76156ddcae4866adb88e9fec21
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 1 15:08:30 2008 +0200

    Rename libsamba-config to libsamba-hostconfig.

commit 03226035aaa8d4fc68996b08bc6beb43feabbd3a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 1 15:03:24 2008 +0200

    Add README file explaining param/.

commit 2dc2bb800dab3f7dbdba01f5ca5076edd1a2b0f3
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Apr 1 14:51:06 2008 +0200

    Move ini-like file parser to the utility library.

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

Summary of changes:
 source/client/config.mk                            |    4 +-
 source/configure.ac                                |    2 +-
 source/heimdal_build/config.mk                     |    2 +-
 source/ldap_server/config.mk                       |    2 +-
 source/lib/policy/config.mk                        |    4 +-
 source/lib/registry/config.mk                      |    8 +-
 source/lib/tls/config.mk                           |    2 +-
 source/lib/util/config.mk                          |    3 +-
 source/lib/util/genrand.c                          |    8 +-
 source/lib/util/tests/genrand.c                    |    4 +-
 source/lib/util/util.h                             |   10 +-
 source/libcli/auth/config.mk                       |    2 +-
 source/libcli/config.mk                            |    6 +-
 source/librpc/config.mk                            |    6 +-
 source/librpc/ndr.pc.in                            |    2 +-
 source/nbt_server/config.mk                        |    2 +-
 source/nsswitch/config.mk                          |    2 +-
 source/param/README                                |    4 +
 source/param/config.mk                             |    8 +-
 source/param/params.c                              |  587 --------------------
 .../{samba-config.pc.in => samba-hostconfig.pc.in} |    6 +-
 source/param/secrets.c                             |   33 +-
 source/param/secrets.h                             |    3 +-
 source/pidl/config.mk                              |    5 +-
 source/pidl/pidl                                   |    2 +-
 source/scripting/ejs/config.mk                     |    2 +-
 source/smbd/config.mk                              |    2 +-
 source/smbd/process_model.mk                       |    2 +-
 source/smbd/process_standard.c                     |    3 -
 source/smbd/server.c                               |    2 +-
 source/torture/config.mk                           |    8 +-
 source/utils/config.mk                             |    8 +-
 source/utils/net/config.mk                         |    2 +-
 33 files changed, 78 insertions(+), 668 deletions(-)
 create mode 100644 source/param/README
 delete mode 100644 source/param/params.c
 rename source/param/{samba-config.pc.in => samba-hostconfig.pc.in} (59%)


Changeset truncated at 500 lines:

diff --git a/source/client/config.mk b/source/client/config.mk
index 9f78500..2085faf 100644
--- a/source/client/config.mk
+++ b/source/client/config.mk
@@ -7,7 +7,7 @@ INSTALLDIR = BINDIR
 OBJ_FILES = \
 		client.o
 PRIVATE_DEPENDENCIES = \
-		LIBSAMBA-CONFIG \
+		LIBSAMBA-HOSTCONFIG \
 		SMBREADLINE \
 		LIBSAMBA-UTIL \
 		LIBCLI_SMB \
@@ -28,7 +28,7 @@ OBJ_FILES = \
 		cifsdd.o \
 		cifsddio.o
 PRIVATE_DEPENDENCIES = \
-		LIBSAMBA-CONFIG \
+		LIBSAMBA-HOSTCONFIG \
 		LIBCLI_SMB \
 		LIBPOPT \
 		POPT_SAMBA \
diff --git a/source/configure.ac b/source/configure.ac
index 41f1bcf..0e264d3 100644
--- a/source/configure.ac
+++ b/source/configure.ac
@@ -32,7 +32,7 @@ AC_CONFIG_FILES(librpc/dcerpc.pc)
 AC_CONFIG_FILES(librpc/ndr.pc)
 AC_CONFIG_FILES(torture/torture.pc)
 AC_CONFIG_FILES(auth/gensec/gensec.pc)
-AC_CONFIG_FILES(param/samba-config.pc)
+AC_CONFIG_FILES(param/samba-hostconfig.pc)
 AC_CONFIG_FILES(librpc/dcerpc_samr.pc)
 
 SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.2.0,
diff --git a/source/heimdal_build/config.mk b/source/heimdal_build/config.mk
index 65b49b7..24d50ac 100644
--- a/source/heimdal_build/config.mk
+++ b/source/heimdal_build/config.mk
@@ -452,7 +452,7 @@ PUBLIC_DEPENDENCIES = \
 [SUBSYSTEM::HEIMDAL_GLUE]
 CFLAGS = -Iheimdal_build -Iheimdal/lib/krb5 -Iheimdal/lib/asn1 -Iheimdal/lib/com_err 
 OBJ_FILES = glue.o
-PUBLIC_DEPENDENCIES = LIBNETIF LIBSAMBA-CONFIG
+PUBLIC_DEPENDENCIES = LIBNETIF LIBSAMBA-HOSTCONFIG
 # End SUBSYSTEM HEIMDAL_GLUE
 #######################
 
diff --git a/source/ldap_server/config.mk b/source/ldap_server/config.mk
index 9892376..5f8c530 100644
--- a/source/ldap_server/config.mk
+++ b/source/ldap_server/config.mk
@@ -15,6 +15,6 @@ PRIVATE_DEPENDENCIES = CREDENTIALS \
 		LIBCLI_LDAP SAMDB \
 		process_model \
 		gensec \
-		LIBSAMBA-CONFIG
+		LIBSAMBA-HOSTCONFIG
 # End SUBSYSTEM SMB
 #######################
diff --git a/source/lib/policy/config.mk b/source/lib/policy/config.mk
index aae98b8..6763884 100644
--- a/source/lib/policy/config.mk
+++ b/source/lib/policy/config.mk
@@ -1,7 +1,7 @@
 [SUBSYSTEM::LIBPOLICY]
 CFLAGS = -Iheimdal/lib/roken
 OBJ_FILES = lex.o parse_adm.o 
-PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBSAMBA-CONFIG LIBTALLOC CHARSET 
+PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBSAMBA-HOSTCONFIG LIBTALLOC CHARSET 
 
 lib/policy/lex.l: lib/policy/parse_adm.h
 
@@ -9,4 +9,4 @@ lib/policy/parse_adm.h: lib/policy/parse_adm.c
 
 [BINARY::dumpadm]
 OBJ_FILES = dumpadm.o
-PRIVATE_DEPENDENCIES = LIBPOLICY LIBPOPT LIBSAMBA-CONFIG LIBTALLOC LIBSAMBA-UTIL CHARSET
+PRIVATE_DEPENDENCIES = LIBPOLICY LIBPOPT LIBSAMBA-HOSTCONFIG LIBTALLOC LIBSAMBA-UTIL CHARSET
diff --git a/source/lib/registry/config.mk b/source/lib/registry/config.mk
index b2d7ce2..70ffce0 100644
--- a/source/lib/registry/config.mk
+++ b/source/lib/registry/config.mk
@@ -52,7 +52,7 @@ PRIVATE_PROTO_HEADER = tools/common.h
 INSTALLDIR = BINDIR
 OBJ_FILES = tools/regdiff.o
 PRIVATE_DEPENDENCIES = \
-		LIBSAMBA-CONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS
+		LIBSAMBA-HOSTCONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS
 # End BINARY regdiff
 ################################################
 
@@ -64,7 +64,7 @@ MANPAGES += lib/registry/man/regdiff.1
 INSTALLDIR = BINDIR
 OBJ_FILES = tools/regpatch.o
 PRIVATE_DEPENDENCIES = \
-		LIBSAMBA-CONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS \
+		LIBSAMBA-HOSTCONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS \
 		registry_common
 # End BINARY regpatch
 ################################################
@@ -77,7 +77,7 @@ MANPAGES += lib/registry/man/regpatch.1
 INSTALLDIR = BINDIR
 OBJ_FILES = tools/regshell.o
 PRIVATE_DEPENDENCIES = \
-		LIBSAMBA-CONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS \
+		LIBSAMBA-HOSTCONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS \
 		SMBREADLINE registry_common
 # End BINARY regshell
 ################################################
@@ -90,7 +90,7 @@ MANPAGES += lib/registry/man/regshell.1
 INSTALLDIR = BINDIR
 OBJ_FILES = tools/regtree.o
 PRIVATE_DEPENDENCIES = \
-		LIBSAMBA-CONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS \
+		LIBSAMBA-HOSTCONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS \
 		registry_common
 # End BINARY regtree
 ################################################
diff --git a/source/lib/tls/config.mk b/source/lib/tls/config.mk
index f75c613..8e8330f 100644
--- a/source/lib/tls/config.mk
+++ b/source/lib/tls/config.mk
@@ -5,7 +5,7 @@ OBJ_FILES = \
 		tls.o \
 		tlscert.o
 PUBLIC_DEPENDENCIES = \
-		LIBTALLOC GNUTLS LIBSAMBA-CONFIG samba-socket
+		LIBTALLOC GNUTLS LIBSAMBA-HOSTCONFIG samba-socket
 #
 # End SUBSYSTEM LIBTLS
 ################################################
diff --git a/source/lib/util/config.mk b/source/lib/util/config.mk
index 22e6617..c6afad1 100644
--- a/source/lib/util/config.mk
+++ b/source/lib/util/config.mk
@@ -18,7 +18,8 @@ OBJ_FILES = xfile.o \
 		ms_fnmatch.o \
 		mutex.o \
 		idtree.o \
-		become_daemon.o
+		become_daemon.o \
+		params.o
 PUBLIC_DEPENDENCIES = \
 		LIBTALLOC LIBCRYPTO \
 		SOCKET_WRAPPER LIBREPLACE_NETWORK \
diff --git a/source/lib/util/genrand.c b/source/lib/util/genrand.c
index 5751db2..7df4ec4 100644
--- a/source/lib/util/genrand.c
+++ b/source/lib/util/genrand.c
@@ -37,15 +37,17 @@ static unsigned int bytes_since_reseed = 0;
 
 static int urand_fd = -1;
 
-static void (*reseed_callback)(int *newseed);
+static void (*reseed_callback)(void *userdata, int *newseed);
+static void *reseed_callback_userdata = NULL;
 
 /**
  Copy any user given reseed data.
 **/
 
-_PUBLIC_ void set_rand_reseed_callback(void (*fn)(int *))
+_PUBLIC_ void set_rand_reseed_callback(void (*fn)(void *, int *), void *userdata)
 {
 	reseed_callback = fn;
+	reseed_callback_userdata = userdata;
 	set_need_random_reseed();
 }
 
@@ -61,7 +63,7 @@ _PUBLIC_ void set_need_random_reseed(void)
 static void get_rand_reseed_data(int *reseed_data)
 {
 	if (reseed_callback) {
-		reseed_callback(reseed_data);
+		reseed_callback(reseed_callback_userdata, reseed_data);
 	} else {
 		*reseed_data = 0;
 	}
diff --git a/source/lib/util/tests/genrand.c b/source/lib/util/tests/genrand.c
index 205a663..5fe229c 100644
--- a/source/lib/util/tests/genrand.c
+++ b/source/lib/util/tests/genrand.c
@@ -22,14 +22,14 @@
 #include "includes.h"
 #include "torture/torture.h"
 
-static void dummy_reseed(int *d)
+static void dummy_reseed(void *userdata, int *d)
 {
 	*d = 42;
 }
 
 static bool test_reseed_callback(struct torture_context *tctx)
 {
-	set_rand_reseed_callback(dummy_reseed);
+	set_rand_reseed_callback(dummy_reseed, NULL);
 	return true;
 }
 
diff --git a/source/lib/util/util.h b/source/lib/util/util.h
index 550b60c..60c8437 100644
--- a/source/lib/util/util.h
+++ b/source/lib/util/util.h
@@ -218,7 +218,7 @@ _PUBLIC_ struct in_addr sys_inet_makeaddr(int net, int host);
 /**
  Copy any user given reseed data.
 **/
-_PUBLIC_ void set_rand_reseed_callback(void (*fn)(int *));
+_PUBLIC_ void set_rand_reseed_callback(void (*fn)(void *, int *), void *);
 
 /**
  * Tell the random number generator it needs to reseed.
@@ -795,4 +795,12 @@ _PUBLIC_ int idr_remove(struct idr_context *idp, int id);
 **/
 _PUBLIC_ void become_daemon(bool fork);
 
+/**
+ * Load a ini-style file.
+ */
+bool pm_process( const char *fileName,
+                 bool (*sfunc)(const char *, void *),
+                 bool (*pfunc)(const char *, const char *, void *),
+				 void *userdata);
+
 #endif /* _SAMBA_UTIL_H_ */
diff --git a/source/libcli/auth/config.mk b/source/libcli/auth/config.mk
index 61d3fe8..f786c71 100644
--- a/source/libcli/auth/config.mk
+++ b/source/libcli/auth/config.mk
@@ -8,7 +8,7 @@ OBJ_FILES = credentials.o \
 		smbdes.o
 PUBLIC_DEPENDENCIES = \
 		MSRPC_PARSE \
-		LIBSAMBA-CONFIG
+		LIBSAMBA-HOSTCONFIG
 # End SUBSYSTEM LIBCLI_AUTH
 #################################
 
diff --git a/source/libcli/config.mk b/source/libcli/config.mk
index d3a3bea..0aa67f3 100644
--- a/source/libcli/config.mk
+++ b/source/libcli/config.mk
@@ -53,11 +53,11 @@ PUBLIC_DEPENDENCIES = LIBNDR NDR_NBT LIBCLI_COMPOSITE LIBEVENTS \
 
 [PYTHON::python_libcli_nbt]
 SWIG_FILE = swig/libcli_nbt.i
-PUBLIC_DEPENDENCIES = LIBCLI_NBT DYNCONFIG LIBSAMBA-CONFIG
+PUBLIC_DEPENDENCIES = LIBCLI_NBT DYNCONFIG LIBSAMBA-HOSTCONFIG
 
 [PYTHON::python_libcli_smb]
 SWIG_FILE = swig/libcli_smb.i
-PUBLIC_DEPENDENCIES = LIBCLI_SMB DYNCONFIG LIBSAMBA-CONFIG
+PUBLIC_DEPENDENCIES = LIBCLI_SMB DYNCONFIG LIBSAMBA-HOSTCONFIG
 
 [SUBSYSTEM::LIBCLI_DGRAM]
 OBJ_FILES = \
@@ -96,7 +96,7 @@ OBJ_FILES = \
 	resolve/wins.o \
 	resolve/host.o \
 	resolve/resolve_lp.o
-PRIVATE_DEPENDENCIES = LIBCLI_NBT LIBSAMBA-CONFIG LIBNETIF 
+PRIVATE_DEPENDENCIES = LIBCLI_NBT LIBSAMBA-HOSTCONFIG LIBNETIF 
 
 [SUBSYSTEM::LIBCLI_FINDDCS]
 PRIVATE_PROTO_HEADER = finddcs.h
diff --git a/source/librpc/config.mk b/source/librpc/config.mk
index a316e05..4bbce62 100644
--- a/source/librpc/config.mk
+++ b/source/librpc/config.mk
@@ -11,7 +11,7 @@ OBJ_FILES = \
 		ndr/ndr_string.o \
 		ndr/uuid.o
 PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBTALLOC LIBSAMBA-UTIL CHARSET \
-					  LIBSAMBA-CONFIG
+					  LIBSAMBA-HOSTCONFIG
 # End SUBSYSTEM LIBNDR
 ################################################
 
@@ -24,7 +24,7 @@ INSTALLDIR = BINDIR
 OBJ_FILES = \
 		tools/ndrdump.o
 PRIVATE_DEPENDENCIES = \
-		LIBSAMBA-CONFIG \
+		LIBSAMBA-HOSTCONFIG \
 		LIBSAMBA-UTIL \
 		LIBPOPT \
 		POPT_SAMBA \
@@ -606,7 +606,7 @@ PRIVATE_DEPENDENCIES = dcerpc NDR_IRPC EJSRPC
 
 [PYTHON::swig_dcerpc]
 SWIG_FILE = rpc/dcerpc.i
-PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-CONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG
+PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-HOSTCONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG
 
 [PYTHON::python_echo]
 OBJ_FILES = gen_ndr/py_echo.o
diff --git a/source/librpc/ndr.pc.in b/source/librpc/ndr.pc.in
index ed4c459..2f4d950 100644
--- a/source/librpc/ndr.pc.in
+++ b/source/librpc/ndr.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@
 
 Name: ndr
 Description: Network Data Representation Core Library
-Requires: samba-config talloc
+Requires: samba-hostconfig talloc
 Version: 0.0.1
 Libs: -L${libdir} -lndr 
 Cflags: -I${includedir}  -DHAVE_IMMEDIATE_STRUCTURES=1
diff --git a/source/nbt_server/config.mk b/source/nbt_server/config.mk
index 9285044..b510a6e 100644
--- a/source/nbt_server/config.mk
+++ b/source/nbt_server/config.mk
@@ -21,7 +21,7 @@ INIT_FUNCTION = &ldb_wins_ldb_module_ops
 OBJ_FILES = \
 		wins/wins_ldb.o
 PRIVATE_DEPENDENCIES = \
-		LIBNETIF LIBSAMBA-CONFIG LIBSAMBA-UTIL
+		LIBNETIF LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL
 # End MODULE ldb_wins_ldb
 #######################
 
diff --git a/source/nsswitch/config.mk b/source/nsswitch/config.mk
index e53e064..c7c70c1 100644
--- a/source/nsswitch/config.mk
+++ b/source/nsswitch/config.mk
@@ -11,7 +11,7 @@ OBJ_FILES = \
 PRIVATE_DEPENDENCIES = \
 		LIBSAMBA-UTIL \
 		LIBREPLACE_EXT \
-		LIBSAMBA-CONFIG
+		LIBSAMBA-HOSTCONFIG
 # End BINARY nsstest
 #################################
 
diff --git a/source/param/README b/source/param/README
new file mode 100644
index 0000000..403a217
--- /dev/null
+++ b/source/param/README
@@ -0,0 +1,4 @@
+This directory contains "libsamba-hostconfig". 
+
+The libsamba-hostconfig library provides access to all host-wide configuration
+such as the configured shares, default parameter values and host secret keys.
diff --git a/source/param/config.mk b/source/param/config.mk
index f43c9d8..eee22cf 100644
--- a/source/param/config.mk
+++ b/source/param/config.mk
@@ -1,9 +1,11 @@
-[SUBSYSTEM::LIBSAMBA-CONFIG]
+[LIBRARY::LIBSAMBA-HOSTCONFIG]
+VERSION = 0.0.1
+SO_VERSION = 1
 OBJ_FILES = loadparm.o \
-			params.o \
 			generic.o \
 			util.o \
 			../lib/version.o
+PC_FILE = samba-hostconfig.pc
 PUBLIC_DEPENDENCIES = LIBSAMBA-UTIL 
 PRIVATE_DEPENDENCIES = DYNCONFIG LIBREPLACE_EXT CHARSET
 PRIVATE_PROTO_HEADER = proto.h
@@ -47,4 +49,4 @@ PRIVATE_DEPENDENCIES = LIBLDB TDB_WRAP UTIL_TDB NDR_SECURITY
 
 [PYTHON::param]
 SWIG_FILE = param.i
-PRIVATE_DEPENDENCIES = LIBSAMBA-CONFIG
+PRIVATE_DEPENDENCIES = LIBSAMBA-HOSTCONFIG
diff --git a/source/param/params.c b/source/param/params.c
deleted file mode 100644
index 3a9e2b9..0000000
--- a/source/param/params.c
+++ /dev/null
@@ -1,587 +0,0 @@
-/* -------------------------------------------------------------------------- **
- * Microsoft Network Services for Unix, AKA., Andrew Tridgell's SAMBA.
- *
- * This module Copyright (C) 1990-1998 Karl Auer
- *
- * Rewritten almost completely by Christopher R. Hertel
- * at the University of Minnesota, September, 1997.
- * This module Copyright (C) 1997-1998 by the University of Minnesota
- * -------------------------------------------------------------------------- **
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- * -------------------------------------------------------------------------- **
- *
- * Module name: params
- *
- * -------------------------------------------------------------------------- **
- *
- *  This module performs lexical analysis and initial parsing of a
- *  Windows-like parameter file.  It recognizes and handles four token
- *  types:  section-name, parameter-name, parameter-value, and
- *  end-of-file.  Comments and line continuation are handled
- *  internally.
- *
- *  The entry point to the module is function pm_process().  This
- *  function opens the source file, calls the Parse() function to parse
- *  the input, and then closes the file when either the EOF is reached
- *  or a fatal error is encountered.
- *
- *  A sample parameter file might look like this:
- *
- *  [section one]
- *  parameter one = value string
- *  parameter two = another value
- *  [section two]
- *  new parameter = some value or t'other
- *
- *  The parameter file is divided into sections by section headers:
- *  section names enclosed in square brackets (eg. [section one]).
- *  Each section contains parameter lines, each of which consist of a
- *  parameter name and value delimited by an equal sign.  Roughly, the
- *  syntax is:
- *
- *    <file>            :==  { <section> } EOF
- *
- *    <section>         :==  <section header> { <parameter line> }
- *
- *    <section header>  :==  '[' NAME ']'
- *
- *    <parameter line>  :==  NAME '=' VALUE '\n'
- *
- *  Blank lines and comment lines are ignored.  Comment lines are lines
- *  beginning with either a semicolon (';') or a pound sign ('#').
- *
- *  All whitespace in section names and parameter names is compressed
- *  to single spaces.  Leading and trailing whitespace is stipped from
- *  both names and values.
- *
- *  Only the first equals sign in a parameter line is significant.
- *  Parameter values may contain equals signs, square brackets and
- *  semicolons.  Internal whitespace is retained in parameter values,
- *  with the exception of the '\r' character, which is stripped for
- *  historic reasons.  Parameter names may not start with a left square
- *  bracket, an equal sign, a pound sign, or a semicolon, because these
- *  are used to identify other tokens.
- *
- * -------------------------------------------------------------------------- **
- */
-
-#include "includes.h"
-#include "system/locale.h"
-
-/* -------------------------------------------------------------------------- **
- * Constants...
- */
-
-#define BUFR_INC 1024
-
-
-/* we can't use FILE* due to the 256 fd limit - use this cheap hack
-   instead */
-typedef struct {
-	char *buf;
-	char *p;
-	size_t size;
-	char *bufr;
-	int   bSize;
-} myFILE;
-
-static int mygetc(myFILE *f)
-{
-	if (f->p >= f->buf+f->size) return EOF;
-        /* be sure to return chars >127 as positive values */
-	return (int)( *(f->p++) & 0x00FF );
-}
-
-static void myfile_close(myFILE *f)
-{
-	talloc_free(f);
-}
-
-/* -------------------------------------------------------------------------- **
- * Functions...
- */
-
-static int EatWhitespace( myFILE *InFile )
-  /* ------------------------------------------------------------------------ **
-   * Scan past whitespace (see ctype(3C)) and return the first non-whitespace
-   * character, or newline, or EOF.
-   *
-   *  Input:  InFile  - Input source.
-   *
-   *  Output: The next non-whitespace character in the input stream.


-- 
Samba Shared Repository


More information about the samba-cvs mailing list