[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-442-g9c21773

Jelmer Vernooij jelmer at samba.org
Mon Jan 14 18:53:52 GMT 2008


The branch, v4-0-test has been updated
       via  9c21773737ea941b623105352b4625dcb8437706 (commit)
       via  df7e3498824e27f8a6d61b8b6f52577eab248d2c (commit)
       via  0a039fabcba9510ab600b2e4becbf75a58d2134d (commit)
       via  dee64344fb13aaed38a550ebb4048d0fa526d5b6 (commit)
       via  b662c98a9ad461a33a27a918c0d544a96433e48c (commit)
       via  b4754f4683e67a940f18a88e45c0878259f45b97 (commit)
       via  712274b9bdf524da125cbbe6e4bb475b21b1da66 (commit)
       via  3dfcefd8ac640ef1539185f19f7414fbcea9e741 (commit)
       via  6cb78c7634de0f9ab327583844d7860d384356eb (commit)
       via  7e583a7ec4196982bd13cb679d741f37ef7decdb (commit)
       via  16fc69b843e92ae62b15caf927335cc117156499 (commit)
       via  bd3e6c41c42738fcfcc5cef4e65f0e219d358260 (commit)
       via  f1a9fad83cee7754304b3422aa273d5f64868e40 (commit)
       via  e65618fff3299193c27959e2cc5a3937837e1422 (commit)
       via  7516af7c7262240df3b804dda962194a811d4e96 (commit)
       via  25a0cd091bb24e579ceb34472d9c213aae157ba9 (commit)
       via  9c72f652e0d3f14d5db4d3930f0d1f9a1875e93f (commit)
       via  b849b4a6c4c9b03a9704449a69f00a59fc0df9c5 (commit)
       via  4c87af95310e4aaee3f2e2da02d0ea70ed1ec25b (commit)
       via  2f4170b3f7904072f87faa342302027759eb62bd (commit)
       via  ebb78ea4232c1614755844849580e3697b0a53fa (commit)
       via  5ee99ff31c80ece6861b2a0323d71170ef9346b9 (commit)
       via  2d2cb6486e6e1a31ae94223784e49fb4eea8bb26 (commit)
       via  2eb4526599ec6d3c604dd9b1f258496c82288284 (commit)
       via  b00c1a072457e5083ffc24a8b74b3793d0b44eee (commit)
       via  13f2b0380f310b101975d709361a29d4032c3689 (commit)
       via  b4840d1ae283a3853d041f3a9a848aec991e81a6 (commit)
       via  8523740796f3cd739bdc338b5e2855a01bafa540 (commit)
       via  a099d30067a4d965a283f52e56ffd1897137bf1a (commit)
       via  45e7d230385dc8f636157e45f3df4a8cb4e9d587 (commit)
       via  9c038a74113fb55ed5eb12a7d0ae4a46bad9050c (commit)
       via  cf3664594d3540db20d32bc844f18e20abfa0d96 (commit)
       via  9aeb7f31b0fc3b9679e5af07e65e79bc8073c4e1 (commit)
       via  49d91a1a92e226c015db86ddc9ef772030415d76 (commit)
       via  1f3bbb65e5a46715c49225eecc760faaf5dbb9d7 (commit)
       via  48cfd44dc088717c0282436148888e45b2632946 (commit)
       via  9366ddba92e192cd88e12eafba4a90af8c266f1c (commit)
       via  e9037d0f5d222efd4ca04a0f8ce5c39cb3bb6997 (commit)
       via  23add37b729aaa85b83cbf6ba98e7042c01f6472 (commit)
       via  97971f0d8080f3934ea5940cc0f230004afb94a1 (commit)
       via  35a4843f9c75a59ab98e785520114809903575cf (commit)
       via  b8bdbc38c15598e34c55fb9e3ee1f6894964d2c6 (commit)
       via  9a907567c8e0836b731e0ef01f8d097a33de21b0 (commit)
       via  991aa950a377bbc07e0bf05758574f850a6d0ff7 (commit)
       via  1ab617296943dc1d270cbf999dedcfb3073d3d20 (commit)
       via  c2595d3754db4d03bafd53b6f62158516493657e (commit)
       via  02dd02c529d578ad7fa4a6b825097685555604fe (commit)
       via  732c3453f0784d5052705b00735b750809afce61 (commit)
      from  068697706652373d28091cd7594e0276da27dbc4 (commit)

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


- Log -----------------------------------------------------------------
commit 9c21773737ea941b623105352b4625dcb8437706
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 19:51:08 2008 +0100

    python: Convert winreg.py completely to rpc, use new RPC Python bindings.

commit df7e3498824e27f8a6d61b8b6f52577eab248d2c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 19:49:52 2008 +0100

    python: Work around the fact that there are two "security" modules now.
    
    This well demonstrates the fact we need hierarchy.

commit 0a039fabcba9510ab600b2e4becbf75a58d2134d
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 19:05:08 2008 +0100

    python: Add simple test for samr python code.

commit dee64344fb13aaed38a550ebb4048d0fa526d5b6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 18:59:11 2008 +0100

    python: Compile security module, handle uint.

commit b662c98a9ad461a33a27a918c0d544a96433e48c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 18:24:10 2008 +0100

    python: Fix some corner cases handling scalars.

commit b4754f4683e67a940f18a88e45c0878259f45b97
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 18:01:54 2008 +0100

    python: Don't try to free const pointers.

commit 712274b9bdf524da125cbbe6e4bb475b21b1da66
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 16:49:19 2008 +0100

    python: Move some convenience macros to a separate header rather than putting them in every generated py_* file.

commit 3dfcefd8ac640ef1539185f19f7414fbcea9e741
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 16:48:27 2008 +0100

    python: Enable python bindings for samr and lsa interfaces.

commit 6cb78c7634de0f9ab327583844d7860d384356eb
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 16:11:58 2008 +0100

    python: Build epmapper module.

commit 7e583a7ec4196982bd13cb679d741f37ef7decdb
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 16:11:36 2008 +0100

    python: Accept loadparm filename rather than loadparm object, too.

commit 16fc69b843e92ae62b15caf927335cc117156499
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 15:25:09 2008 +0100

    python: Be more pythonic - turn WERROR and NTSTATUS return codes into exceptions.

commit bd3e6c41c42738fcfcc5cef4e65f0e219d358260
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 14:48:59 2008 +0100

    python: Fix python code for winreg, add test.

commit f1a9fad83cee7754304b3422aa273d5f64868e40
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 13:26:21 2008 +0100

    python: Start building winreg module.

commit e65618fff3299193c27959e2cc5a3937837e1422
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 13:26:01 2008 +0100

    pidl/python: Fix processing UUID-less interfaces, external typedefs and certain bitmap elements.

commit 7516af7c7262240df3b804dda962194a811d4e96
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 06:23:13 2008 +0100

    pidl/python: Deal with arrays that are not pointers.

commit 25a0cd091bb24e579ceb34472d9c213aae157ba9
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 06:05:28 2008 +0100

    python: Fix last bugs in rpcecho test. It passes now!

commit 9c72f652e0d3f14d5db4d3930f0d1f9a1875e93f
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 06:05:12 2008 +0100

    pidl/python: Specify memory context explicitly when returning Python objects.

commit b849b4a6c4c9b03a9704449a69f00a59fc0df9c5
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 06:03:33 2008 +0100

    python: Fix deallocation bug in pytalloc.

commit 4c87af95310e4aaee3f2e2da02d0ea70ed1ec25b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 05:16:51 2008 +0100

    pidl/python: Pass credentials and loadparm context when connecting using DCE/RPC.

commit 2f4170b3f7904072f87faa342302027759eb62bd
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 04:00:13 2008 +0100

    selftest: Ignore output generated by html formatter.

commit ebb78ea4232c1614755844849580e3697b0a53fa
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 03:59:36 2008 +0100

    python: Fix rpcecho tests.

commit 5ee99ff31c80ece6861b2a0323d71170ef9346b9
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 02:48:50 2008 +0100

    pidl/python: Fix compilation of py_echo.

commit 2d2cb6486e6e1a31ae94223784e49fb4eea8bb26
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 02:27:40 2008 +0100

    python/pidl: Fix assignment.

commit 2eb4526599ec6d3c604dd9b1f258496c82288284
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 02:04:06 2008 +0100

    pidl/python: Fix more compile errors.

commit b00c1a072457e5083ffc24a8b74b3793d0b44eee
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 01:30:44 2008 +0100

    pidl/python: Fix parsing arguments, fix more pointer issues.

commit 13f2b0380f310b101975d709361a29d4032c3689
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 23:13:30 2008 +0100

    pidl/python: Fix use of pointers.

commit b4840d1ae283a3853d041f3a9a848aec991e81a6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 21:42:42 2008 +0100

    python: Add some more rpc/echo tests.

commit 8523740796f3cd739bdc338b5e2855a01bafa540
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 21:33:35 2008 +0100

    python: Add simple tests for the DCE/RPC echo interface.

commit a099d30067a4d965a283f52e56ffd1897137bf1a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 21:23:12 2008 +0100

    pidl/python: Remove unnecessary talloc_free().

commit 45e7d230385dc8f636157e45f3df4a8cb4e9d587
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 20:43:10 2008 +0100

    Remove accidently committed files.

commit 9c038a74113fb55ed5eb12a7d0ae4a46bad9050c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 20:41:34 2008 +0100

    python: Allow wrapping pointers within talloc'ed memory that are not talloc contexts.

commit cf3664594d3540db20d32bc844f18e20abfa0d96
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 18:38:12 2008 +0100

    pidl/python: Support repr() for python types.

commit 9aeb7f31b0fc3b9679e5af07e65e79bc8073c4e1
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 18:15:12 2008 +0100

    pidl: Move Generate*Env functions to Parse::Pidl::Samba4::Header because they only work with the structures generated by that file.

commit 49d91a1a92e226c015db86ddc9ef772030415d76
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 18:05:43 2008 +0100

    pidl/python: Work towards supporting more complex types (arrays, etc).

commit 1f3bbb65e5a46715c49225eecc760faaf5dbb9d7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 17:15:56 2008 +0100

    pidl/python: Support more scalar types when converting from Python.

commit 48cfd44dc088717c0282436148888e45b2632946
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 16:59:15 2008 +0100

    pidl/python: Use new talloc utility functions.

commit 9366ddba92e192cd88e12eafba4a90af8c266f1c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 16:44:42 2008 +0100

    python: Add some utility functions for working with Python objects based on talloc pointers.

commit e9037d0f5d222efd4ca04a0f8ce5c39cb3bb6997
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 15:51:15 2008 +0100

    pidl/python: Convert unions.

commit 23add37b729aaa85b83cbf6ba98e7042c01f6472
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 15:29:56 2008 +0100

    pidl/python: Fix more warnings in the generated code.

commit 97971f0d8080f3934ea5940cc0f230004afb94a1
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 15:11:28 2008 +0100

    pidl/python: Fix bug accidently filling in the body of enums/bitmaps without body.

commit 35a4843f9c75a59ab98e785520114809903575cf
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 03:15:55 2008 +0100

    pidl/python: Fix const type wrapping.

commit b8bdbc38c15598e34c55fb9e3ee1f6894964d2c6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 01:50:31 2008 +0100

    pidl/python: Fix conversion of last few non-standard types.

commit 9a907567c8e0836b731e0ef01f8d097a33de21b0
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Jan 13 01:35:06 2008 +0100

    pidl/python: Remove references to DECLARE, which has been removed.

commit 991aa950a377bbc07e0bf05758574f850a6d0ff7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sat Jan 12 01:09:28 2008 +0100

    pidl/python: Some more support for special case types.

commit 1ab617296943dc1d270cbf999dedcfb3073d3d20
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Fri Jan 11 20:37:08 2008 +0100

    pidl/python: Convert some Python objects back to C, return proper tuples in client calls.

commit c2595d3754db4d03bafd53b6f62158516493657e
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Fri Jan 11 20:00:46 2008 +0100

    python/pidl: Start wrapping function arguments.

commit 02dd02c529d578ad7fa4a6b825097685555604fe
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Fri Jan 11 18:27:47 2008 +0100

    python/pidl: Handle non-string types.

commit 732c3453f0784d5052705b00735b750809afce61
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Fri Jan 11 18:11:45 2008 +0100

    python/pidl: More work on wrapping enums, bitmaps and structs.

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

Summary of changes:
 .gitignore                                         |    1 +
 source/auth/credentials/credentials.i              |   17 +
 source/auth/credentials/credentials_wrap.c         |   16 +
 source/librpc/config.mk                            |   35 +-
 source/librpc/idl/mgmt.idl                         |    2 +
 source/param/param.i                               |   21 +
 source/param/param_wrap.c                          |   20 +
 source/pidl/lib/Parse/Pidl/NDR.pm                  |   17 +-
 source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm     |    4 +-
 source/pidl/lib/Parse/Pidl/Samba4/EJS.pm           |    2 +-
 source/pidl/lib/Parse/Pidl/Samba4/Header.pm        |   69 ++-
 source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm    |   80 +--
 source/pidl/lib/Parse/Pidl/Samba4/Python.pm        |  882 ++++++++++++++++----
 source/pidl/lib/Parse/Pidl/Typelist.pm             |   17 +-
 source/pidl/pidl                                   |    3 +-
 source/pidl/tests/header.pl                        |   54 ++-
 source/pidl/tests/samba-ndr.pl                     |   51 +--
 source/pidl/tests/samba3-cli.pl                    |    2 +-
 source/scripting/bin/winreg.py                     |  133 ++--
 source/scripting/python/STATUS                     |    6 -
 source/scripting/python/config.mk                  |    2 +-
 source/scripting/python/modules.c                  |    9 +
 source/scripting/python/pyrpc.h                    |   29 +
 source/scripting/python/pytalloc.c                 |   45 +
 source/scripting/python/pytalloc.h                 |   51 ++
 .../python/samba/tests/dcerpc/registry.py          |   50 ++
 .../scripting/python/samba/tests/dcerpc/rpcecho.py |   44 +
 source/scripting/python/samba/tests/dcerpc/sam.py  |   28 +
 source/selftest/samba4_tests.sh                    |    3 +
 29 files changed, 1336 insertions(+), 357 deletions(-)
 mode change 100644 => 100755 source/scripting/bin/winreg.py
 create mode 100644 source/scripting/python/pyrpc.h
 create mode 100644 source/scripting/python/pytalloc.c
 create mode 100644 source/scripting/python/pytalloc.h
 create mode 100644 source/scripting/python/samba/tests/dcerpc/__init__.py
 create mode 100644 source/scripting/python/samba/tests/dcerpc/registry.py
 create mode 100644 source/scripting/python/samba/tests/dcerpc/rpcecho.py
 create mode 100644 source/scripting/python/samba/tests/dcerpc/sam.py


Changeset truncated at 500 lines:

diff --git a/.gitignore b/.gitignore
index 7d87dbf..ccc1265 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+source/test-results
 source/lib/gencache/gencache.h
 source/lib/ldb/bin
 *.pc
diff --git a/source/auth/credentials/credentials.i b/source/auth/credentials/credentials.i
index 8f09ff4..ee09b43 100644
--- a/source/auth/credentials/credentials.i
+++ b/source/auth/credentials/credentials.i
@@ -95,3 +95,20 @@ typedef struct cli_credentials {
         bool wrong_password(void);
     }
 } cli_credentials;
+
+%{
+struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj)
+{
+    struct cli_credentials *ret;
+
+    if (py_obj == Py_None) {
+        return cli_credentials_init_anon(NULL);
+    }
+
+    if (SWIG_ConvertPtr(py_obj, (void *)&ret, SWIGTYPE_p_cli_credentials, 0 |  0 ) < 0) {
+        return NULL; 
+    }
+    return ret;
+}
+
+%}
diff --git a/source/auth/credentials/credentials_wrap.c b/source/auth/credentials/credentials_wrap.c
index ebf7162..146a81a 100644
--- a/source/auth/credentials/credentials_wrap.c
+++ b/source/auth/credentials/credentials_wrap.c
@@ -2774,6 +2774,22 @@ SWIGINTERNINLINE PyObject*
 }
 
 SWIGINTERN void delete_cli_credentials(cli_credentials *self){ talloc_free(self); }
+
+struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj)
+{
+    struct cli_credentials *ret;
+
+    if (py_obj == Py_None) {
+        return cli_credentials_init_anon(NULL);
+    }
+
+    if (SWIG_ConvertPtr(py_obj, (void *)&ret, SWIGTYPE_p_cli_credentials, 0 |  0 ) < 0) {
+        return NULL; 
+    }
+    return ret;
+}
+
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/source/librpc/config.mk b/source/librpc/config.mk
index debfbb6..ddb07dc 100644
--- a/source/librpc/config.mk
+++ b/source/librpc/config.mk
@@ -597,4 +597,37 @@ PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-CONFIG dcerpc_s
 
 [PYTHON::python_echo]
 OBJ_FILES = gen_ndr/py_echo.o
-PRIVATE_DEPENDENCIES = NDR_ECHO
+PRIVATE_DEPENDENCIES = RPC_NDR_ECHO
+
+[PYTHON::python_winreg]
+OBJ_FILES = gen_ndr/py_winreg.o
+PRIVATE_DEPENDENCIES = RPC_NDR_WINREG python_misc
+
+[PYTHON::python_dcerpc_misc]
+OBJ_FILES = gen_ndr/py_misc.o
+
+[PYTHON::python_initshutdown]
+OBJ_FILES = gen_ndr/py_initshutdown.o
+PRIVATE_DEPENDENCIES = RPC_NDR_INITSHUTDOWN
+
+[PYTHON::python_epmapper]
+OBJ_FILES = gen_ndr/py_epmapper.o
+
+[PYTHON::python_mgmt]
+OBJ_FILES = gen_ndr/py_mgmt.o
+PRIVATE_DEPENDENCIES = dcerpc_mgmt
+
+[PYTHON::python_atsvc]
+OBJ_FILES = gen_ndr/py_atsvc.o
+PRIVATE_DEPENDENCIES = dcerpc_atsvc
+
+[PYTHON::python_samr]
+OBJ_FILES = gen_ndr/py_samr.o
+PRIVATE_DEPENDENCIES = dcerpc_samr
+
+[PYTHON::python_lsa]
+OBJ_FILES = gen_ndr/py_lsa.o
+PRIVATE_DEPENDENCIES = RPC_NDR_LSA
+
+[PYTHON::python_dcerpc_security]
+OBJ_FILES = gen_ndr/py_security.o
diff --git a/source/librpc/idl/mgmt.idl b/source/librpc/idl/mgmt.idl
index 60d1ebd..35857f2 100644
--- a/source/librpc/idl/mgmt.idl
+++ b/source/librpc/idl/mgmt.idl
@@ -2,6 +2,8 @@
   dcerpc remote management interface
 */
 
+import "misc.idl";
+
 [
   uuid("afa8bd80-7d8a-11c9-bef4-08002b102989"), 
   version(1.0),
diff --git a/source/param/param.i b/source/param/param.i
index 353fa3c..eeecb0e 100644
--- a/source/param/param.i
+++ b/source/param/param.i
@@ -290,3 +290,24 @@ typedef struct param_section {
 
 %rename(default_config) global_loadparm;
 struct loadparm_context *global_loadparm;
+
+%{
+
+struct loadparm_context *lp_from_py_object(PyObject *py_obj)
+{
+    struct loadparm_context *lp_ctx;
+    if (PyString_Check(py_obj)) {
+        lp_ctx = loadparm_init(NULL);
+        if (!lp_load(lp_ctx, PyString_AsString(py_obj))) {
+            talloc_free(lp_ctx);
+            return NULL;
+        }
+        return lp_ctx;
+    }
+
+    if (SWIG_ConvertPtr(py_obj, (void *)&lp_ctx, SWIGTYPE_p_loadparm_context, 0 |  0 ) < 0)
+        return NULL;
+    return lp_ctx;
+}
+
+%}
diff --git a/source/param/param_wrap.c b/source/param/param_wrap.c
index ca9fbb7..d8be725 100644
--- a/source/param/param_wrap.c
+++ b/source/param/param_wrap.c
@@ -2760,6 +2760,26 @@ SWIGINTERN char const *param_opt___str__(param_opt *self){ return self->value; }
 SWIGINTERN void delete_param_opt(param_opt *self){ talloc_free(self); }
 SWIGINTERN struct param_opt *param_section_first_parameter(param_section *self){ return self->parameters; }
 SWIGINTERN struct param_opt *param_section_next_parameter(param_section *self,struct param_opt *s){ return s->next; }
+
+
+struct loadparm_context *lp_from_py_object(PyObject *py_obj)
+{
+    struct loadparm_context *lp_ctx;
+    if (PyString_Check(py_obj)) {
+        lp_ctx = loadparm_init(NULL);
+        if (!lp_load(lp_ctx, PyString_AsString(py_obj))) {
+            talloc_free(lp_ctx);
+            return NULL;
+        }
+        return lp_ctx;
+    }
+
+    if (SWIG_ConvertPtr(py_obj, (void *)&lp_ctx, SWIGTYPE_p_loadparm_context, 0 |  0 ) < 0)
+        return NULL;
+    return lp_ctx;
+}
+
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/source/pidl/lib/Parse/Pidl/NDR.pm b/source/pidl/lib/Parse/Pidl/NDR.pm
index 1d059eb..fc6bfe4 100644
--- a/source/pidl/lib/Parse/Pidl/NDR.pm
+++ b/source/pidl/lib/Parse/Pidl/NDR.pm
@@ -35,7 +35,7 @@ use vars qw($VERSION);
 $VERSION = '0.01';
 @ISA = qw(Exporter);
 @EXPORT = qw(GetPrevLevel GetNextLevel ContainsDeferred ContainsString);
- at EXPORT_OK = qw(GetElementLevelTable ParseElement ValidElement align_type mapToScalar ParseType can_contain_deferred);
+ at EXPORT_OK = qw(GetElementLevelTable ParseElement ValidElement align_type mapToScalar ParseType can_contain_deferred is_charset_array);
 
 use strict;
 use Parse::Pidl qw(warning fatal);
@@ -1181,4 +1181,19 @@ sub Validate($)
 	}
 }
 
+sub is_charset_array($$)
+{
+	my ($e,$l) = @_;
+
+	return 0 if ($l->{TYPE} ne "ARRAY");
+
+	my $nl = GetNextLevel($e,$l);
+
+	return 0 unless ($nl->{TYPE} eq "DATA");
+
+	return has_property($e, "charset");
+}
+
+
+
 1;
diff --git a/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
index b7372a8..86b8951 100644
--- a/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
+++ b/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm
@@ -9,7 +9,7 @@ package Parse::Pidl::Samba3::ClientNDR;
 
 use Exporter;
 @ISA = qw(Exporter);
- at EXPORT_OK = qw(GenerateFunctionInEnv ParseFunction $res $res_hdr);
+ at EXPORT_OK = qw(ParseFunction $res $res_hdr);
 
 use strict;
 use Parse::Pidl qw(fatal warning);
@@ -17,7 +17,7 @@ use Parse::Pidl::Typelist qw(hasType getType mapTypeName scalar_is_reference);
 use Parse::Pidl::Util qw(has_property is_constant ParseExpr);
 use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred);
 use Parse::Pidl::Samba4 qw(DeclLong);
-use Parse::Pidl::Samba4::NDR::Parser qw(GenerateFunctionInEnv);
+use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv);
 
 use vars qw($VERSION);
 $VERSION = '0.01';
diff --git a/source/pidl/lib/Parse/Pidl/Samba4/EJS.pm b/source/pidl/lib/Parse/Pidl/Samba4/EJS.pm
index 2427034..efb3f28 100644
--- a/source/pidl/lib/Parse/Pidl/Samba4/EJS.pm
+++ b/source/pidl/lib/Parse/Pidl/Samba4/EJS.pm
@@ -15,7 +15,7 @@ use Parse::Pidl::Typelist qw(typeHasBody);
 use Parse::Pidl::CUtil qw(get_pointer_to get_value_of);
 use Parse::Pidl::Util qw(has_property ParseExpr);
 use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel);
-use Parse::Pidl::Samba4::NDR::Parser qw(GenerateStructEnv GenerateFunctionInEnv
+use Parse::Pidl::Samba4::Header qw(GenerateStructEnv GenerateFunctionInEnv
                                         GenerateFunctionOutEnv);
 
 use vars qw($VERSION);
diff --git a/source/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source/pidl/lib/Parse/Pidl/Samba4/Header.pm
index b96a587..2b3a9df 100644
--- a/source/pidl/lib/Parse/Pidl/Samba4/Header.pm
+++ b/source/pidl/lib/Parse/Pidl/Samba4/Header.pm
@@ -6,10 +6,15 @@
 
 package Parse::Pidl::Samba4::Header;
 
+require Exporter;
+
+ at ISA = qw(Exporter);
+ at EXPORT_OK = qw(GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv);
+
 use strict;
 use Parse::Pidl qw(fatal);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
-use Parse::Pidl::Util qw(has_property is_constant unmake_str);
+use Parse::Pidl::Util qw(has_property is_constant unmake_str ParseExpr);
 use Parse::Pidl::Samba4 qw(is_intree ElementStars ArrayBrackets choose_header);
 
 use vars qw($VERSION);
@@ -406,4 +411,66 @@ sub Parse($)
 	return $res;
 }
 
+sub GenerateStructEnv($$)
+{
+	my ($x, $v) = @_;
+	my %env;
+
+	foreach my $e (@{$x->{ELEMENTS}}) {
+		$env{$e->{NAME}} = "$v->$e->{NAME}";
+	}
+
+	$env{"this"} = $v;
+
+	return \%env;
+}
+
+sub EnvSubstituteValue($$)
+{
+	my ($env,$s) = @_;
+
+	# Substitute the value() values in the env
+	foreach my $e (@{$s->{ELEMENTS}}) {
+		next unless (defined(my $v = has_property($e, "value")));
+		
+		$env->{$e->{NAME}} = ParseExpr($v, $env, $e);
+	}
+
+	return $env;
+}
+
+sub GenerateFunctionInEnv($;$)
+{
+	my ($fn, $base) = @_;
+	my %env;
+
+	$base = "r->" unless defined($base);
+
+	foreach my $e (@{$fn->{ELEMENTS}}) {
+		if (grep (/in/, @{$e->{DIRECTION}})) {
+			$env{$e->{NAME}} = $base."in.$e->{NAME}";
+		}
+	}
+
+	return \%env;
+}
+
+sub GenerateFunctionOutEnv($;$)
+{
+	my ($fn, $base) = @_;
+	my %env;
+
+	$base = "r->" unless defined($base);
+
+	foreach my $e (@{$fn->{ELEMENTS}}) {
+		if (grep (/out/, @{$e->{DIRECTION}})) {
+			$env{$e->{NAME}} = $base."out.$e->{NAME}";
+		} elsif (grep (/in/, @{$e->{DIRECTION}})) {
+			$env{$e->{NAME}} = $base."in.$e->{NAME}";
+		}
+	}
+
+	return \%env;
+}
+
 1;
diff --git a/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 8eb2f9a..02d3a80 100644
--- a/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -9,14 +9,15 @@ package Parse::Pidl::Samba4::NDR::Parser;
 
 require Exporter;
 @ISA = qw(Exporter);
- at EXPORT_OK = qw(check_null_pointer GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv NeededFunction NeededElement NeededType $res NeededInterface TypeFunctionName ParseElementPrint);
+ at EXPORT_OK = qw(check_null_pointer NeededFunction NeededElement NeededType $res NeededInterface TypeFunctionName ParseElementPrint);
 
 use strict;
 use Parse::Pidl::Typelist qw(hasType getType mapTypeName typeHasBody);
 use Parse::Pidl::Util qw(has_property ParseExpr ParseExprExt print_uuid);
 use Parse::Pidl::CUtil qw(get_pointer_to get_value_of);
-use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred);
+use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred is_charset_array);
 use Parse::Pidl::Samba4 qw(is_intree choose_header);
+use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv);
 use Parse::Pidl qw(warning);
 
 use vars qw($VERSION);
@@ -77,19 +78,6 @@ sub has_fast_array($$)
 	return ($t->{NAME} eq "uint8") or ($t->{NAME} eq "string");
 }
 
-sub is_charset_array($$)
-{
-	my ($e,$l) = @_;
-
-	return 0 if ($l->{TYPE} ne "ARRAY");
-
-	my $nl = GetNextLevel($e,$l);
-
-	return 0 unless ($nl->{TYPE} eq "DATA");
-
-	return has_property($e, "charset");
-}
-
 
 ####################################
 # pidl() is our basic output routine
@@ -193,68 +181,6 @@ sub end_flags($$)
 	}
 }
 
-sub GenerateStructEnv($$)
-{
-	my ($x, $v) = @_;
-	my %env;
-
-	foreach my $e (@{$x->{ELEMENTS}}) {
-		$env{$e->{NAME}} = "$v->$e->{NAME}";
-	}
-
-	$env{"this"} = $v;
-
-	return \%env;
-}
-
-sub EnvSubstituteValue($$)
-{
-	my ($env,$s) = @_;
-
-	# Substitute the value() values in the env
-	foreach my $e (@{$s->{ELEMENTS}}) {
-		next unless (defined(my $v = has_property($e, "value")));
-		
-		$env->{$e->{NAME}} = ParseExpr($v, $env, $e);
-	}
-
-	return $env;
-}
-
-sub GenerateFunctionInEnv($;$)
-{
-	my ($fn, $base) = @_;
-	my %env;
-
-	$base = "r->" unless defined($base);
-
-	foreach my $e (@{$fn->{ELEMENTS}}) {
-		if (grep (/in/, @{$e->{DIRECTION}})) {
-			$env{$e->{NAME}} = $base."in.$e->{NAME}";
-		}
-	}
-
-	return \%env;
-}
-
-sub GenerateFunctionOutEnv($;$)
-{
-	my ($fn, $base) = @_;
-	my %env;
-
-	$base = "r->" unless defined($base);
-
-	foreach my $e (@{$fn->{ELEMENTS}}) {
-		if (grep (/out/, @{$e->{DIRECTION}})) {
-			$env{$e->{NAME}} = $base."out.$e->{NAME}";
-		} elsif (grep (/in/, @{$e->{DIRECTION}})) {
-			$env{$e->{NAME}} = $base."in.$e->{NAME}";
-		}
-	}
-
-	return \%env;
-}
-
 #####################################################################
 # parse the data of an array - push side
 sub ParseArrayPushHeader($$$$$$)
diff --git a/source/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 8effff9..31b06d1 100644
--- a/source/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/source/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -1,6 +1,6 @@
 ###################################################
 # Python function wrapper generator
-# Copyright jelmer at samba.org 2007
+# Copyright jelmer at samba.org 2007-2008
 # released under the GNU GPL
 
 package Parse::Pidl::Samba4::Python;
@@ -9,15 +9,19 @@ use Exporter;
 @ISA = qw(Exporter);
 
 use strict;
-use Parse::Pidl::Typelist;
+use Parse::Pidl::Typelist qw(hasType resolveType getType mapTypeName expandAlias);
 use Parse::Pidl::Util qw(has_property ParseExpr);
+use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred is_charset_array);
+use Parse::Pidl::CUtil qw(get_value_of get_pointer_to);
+use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv);
 
 use vars qw($VERSION);
 $VERSION = '0.01';
 
 sub new($) {
 	my ($class) = @_;
-	my $self = { res => "", res_hdr => "", tabs => "", constants => {}};
+	my $self = { res => "", res_hdr => "", tabs => "", constants => {},
+	             module_methods => []};
 	bless($self, $class);
 }
 
@@ -63,121 +67,371 @@ sub Import
 sub Const($$)
 {
     my ($self, $const) = @_;
-    $self->{constants}->{$const->{NAME}} = [$const->{DATA}->{TYPE}, $const->{VALUE}];
+	$self->register_constant($const->{NAME}, $const->{DTYPE}, $const->{VALUE});
 }
 
-sub FromTypeToPythonFunction($$)
+sub register_constant($$$$)
 {
-	my ($self, $type) = @_;
+	my ($self, $name, $type, $value) = @_;
 
-	#FIXME
+	$self->{constants}->{$name} = [$type, $value];
 }
 
-sub FromPythonToTypeFunction($$)
+sub EnumAndBitmapConsts($$$)
 {
-	my ($self, $type) = @_;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list