r26194: Wrap the events subsystem in a separate file.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 29 Nov 2007 13:49:35 +0000 (14:49 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:46:45 +0000 (05:46 +0100)
(This used to be commit cfb6bbdc31083308dbff29cf226a092c8a137c2a)

.bzrignore
source4/autogen.sh
source4/lib/events/config.mk
source4/lib/events/events.i [new file with mode: 0644]
source4/libcli/swig/libcli_nbt.i
source4/libcli/swig/libcli_smb.i

index 9161e8554bdb6ff3b66ef94565dd4827b57d067e..270f318819c68f4bebd95e30d2c9b37db4504733 100644 (file)
@@ -220,3 +220,13 @@ source/auth/auth.py
 source/lib/registry/tests/proto.h
 source/auth/auth_wrap.c
 source/auth/credentials/credentials_wrap.c
 source/lib/registry/tests/proto.h
 source/auth/auth_wrap.c
 source/auth/credentials/credentials_wrap.c
+source/lib/registry/registry_wrap.c
+source/lib/talloc/talloc.py
+source/lib/talloc/talloc_wrap.c
+source/lib/ldb/ldb_wrap.c
+source/librpc/rpc/dcerpc_wrap.c
+source/libcli/swig/libcli_smb.py
+source/libcli/swig/libcli_smb_wrap.c
+source/libcli/swig/libcli_nbt_wrap.c
+source/lib/events/events.py
+source/lib/events/events_wrap.c
index 67a3df3bd973aeaa957c691a68305cd634596458..9288cba9868094b22ea5b3b5e4cf9c3344460c9d 100755 (executable)
@@ -65,7 +65,7 @@ rm -rf autom4te*.cache
 
 # Run swig if it is available
 SWIG=swig
 
 # Run swig if it is available
 SWIG=swig
-SWIG_FILES="./scripting/python/misc.i ./auth/auth.i ./auth/credentials/credentials.i ./lib/talloc/talloc.i ./lib/ldb/ldb.i ./lib/registry/registry.i ./lib/tdb/tdb.i ./libcli/swig/libcli_smb.i ./libcli/swig/libcli_nbt.i ./librpc/rpc/dcerpc.i"
+SWIG_FILES="./scripting/python/misc.i ./auth/auth.i ./auth/credentials/credentials.i ./lib/talloc/talloc.i ./lib/ldb/ldb.i ./lib/registry/registry.i ./lib/tdb/tdb.i ./libcli/swig/libcli_smb.i ./libcli/swig/libcli_nbt.i ./librpc/rpc/dcerpc.i lib/events/events.i"
 if which $SWIG >/dev/null 2>&1; then
        for I in $SWIG_FILES
        do
 if which $SWIG >/dev/null 2>&1; then
        for I in $SWIG_FILES
        do
index 2e0a8a6028dba59dae654e7ba55b5f8a8b4c53a1..7f4bfafb549ed470b440999ceb15c6ef52c29794 100644 (file)
@@ -36,3 +36,7 @@ PUBLIC_HEADERS = events.h events_internal.h
 PUBLIC_DEPENDENCIES = LIBTALLOC
 # End SUBSYSTEM LIBEVENTS
 ##############################
 PUBLIC_DEPENDENCIES = LIBTALLOC
 # End SUBSYSTEM LIBEVENTS
 ##############################
+
+[PYTHON::swig_python]
+SWIG_FILE = events.i
+PRIVATE_DEPENDENCIES = LIBEVENTS
diff --git a/source4/lib/events/events.i b/source4/lib/events/events.i
new file mode 100644 (file)
index 0000000..a89763a
--- /dev/null
@@ -0,0 +1,31 @@
+/* 
+   Unix SMB/CIFS implementation.
+   Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
+   
+   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(package="samba.events") events;
+
+%import "../talloc/talloc.i";
+
+%{
+#include "lib/events/events.h"
+%}
+
+struct event_context *event_context_init(TALLOC_CTX *mem_ctx);
+
+%typemap(default) struct event_context * {
+    $1 = event_context_init(NULL);
+}
index 56d6d4206e2634bac94cc3f49b3f8e6dccba4e4c..6fd85c2b8cd374d3786198712b55dfaa248fbc69 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "includes.h"
 #include "lib/talloc/talloc.h"
 
 #include "includes.h"
 #include "lib/talloc/talloc.h"
-#include "lib/events/events.h"
 #include "libcli/nbt/libnbt.h"
 #include "param/param.h"
 
 #include "libcli/nbt/libnbt.h"
 #include "param/param.h"
 
 %}
 
 %import "stdint.i"
 %}
 
 %import "stdint.i"
+%import "../util/errors.i"
 %import "../../lib/talloc/talloc.i"
 %import "../../lib/talloc/talloc.i"
-
-%typemap(in) NTSTATUS {
-        if (PyLong_Check($input))
-                $1 = NT_STATUS(PyLong_AsUnsignedLong($input));
-        else if (PyInt_Check($input))
-                $1 = NT_STATUS(PyInt_AsLong($input));
-        else {
-                PyErr_SetString(PyExc_TypeError, "Expected a long or an int");
-                return NULL;
-        }
-}
-
-%typemap(out) NTSTATUS {
-        $result = PyLong_FromUnsignedLong(NT_STATUS_V($1));
-}
+%import "../../lib/events/events.i"
 
 /* Function prototypes */
 
 /* Function prototypes */
-
-struct event_context *event_context_init(TALLOC_CTX *mem_ctx);
-
 struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx, 
                                             struct event_context *event_ctx);
 
 struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx, 
                                             struct event_context *event_ctx);
 
index c3b8edd7e969ab151dcd694d5e1ea4ee75209570..32e043b2c651f005213c085486f014977e9cd978 100644 (file)
@@ -1,6 +1,7 @@
 %module libcli_smb
 
 %import "../../lib/talloc/talloc.i"
 %module libcli_smb
 
 %import "../../lib/talloc/talloc.i"
+%import "../../lib/events/events.i"
 
 %{
 #include "includes.h"
 
 %{
 #include "includes.h"
@@ -8,8 +9,6 @@
 #include "libcli/raw/libcliraw.h"
 %}
 
 #include "libcli/raw/libcliraw.h"
 %}
 
-struct event_context *event_context_init(TALLOC_CTX *mem_ctx);
-
 struct smbcli_socket *smbcli_sock_connect_byname(const char *host, int port,
                                                 TALLOC_CTX *mem_ctx,
                                                 struct event_context *event_ctx);
 struct smbcli_socket *smbcli_sock_connect_byname(const char *host, int port,
                                                 TALLOC_CTX *mem_ctx,
                                                 struct event_context *event_ctx);