From: Jelmer Vernooij Date: Thu, 29 Nov 2007 13:49:35 +0000 (+0100) Subject: r26194: Wrap the events subsystem in a separate file. X-Git-Tag: samba-4.0.0alpha6~801^3~1231 X-Git-Url: http://git.samba.org/samba.git/?p=kamenim%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=e1733d72441ec5aff6d48abf6dd41a91e459df01 r26194: Wrap the events subsystem in a separate file. (This used to be commit cfb6bbdc31083308dbff29cf226a092c8a137c2a) --- diff --git a/.bzrignore b/.bzrignore index 9161e8554bd..270f318819c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -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/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 diff --git a/source4/autogen.sh b/source4/autogen.sh index 67a3df3bd97..9288cba9868 100755 --- a/source4/autogen.sh +++ b/source4/autogen.sh @@ -65,7 +65,7 @@ rm -rf autom4te*.cache # 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 diff --git a/source4/lib/events/config.mk b/source4/lib/events/config.mk index 2e0a8a6028d..7f4bfafb549 100644 --- a/source4/lib/events/config.mk +++ b/source4/lib/events/config.mk @@ -36,3 +36,7 @@ PUBLIC_HEADERS = events.h events_internal.h 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 index 00000000000..a89763a3d63 --- /dev/null +++ b/source4/lib/events/events.i @@ -0,0 +1,31 @@ +/* + Unix SMB/CIFS implementation. + Copyright (C) Jelmer Vernooij 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 . +*/ + +%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); +} diff --git a/source4/libcli/swig/libcli_nbt.i b/source4/libcli/swig/libcli_nbt.i index 56d6d4206e2..6fd85c2b8cd 100644 --- a/source4/libcli/swig/libcli_nbt.i +++ b/source4/libcli/swig/libcli_nbt.i @@ -29,7 +29,6 @@ #include "includes.h" #include "lib/talloc/talloc.h" -#include "lib/events/events.h" #include "libcli/nbt/libnbt.h" #include "param/param.h" @@ -40,27 +39,11 @@ %} %import "stdint.i" +%import "../util/errors.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 */ - -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); diff --git a/source4/libcli/swig/libcli_smb.i b/source4/libcli/swig/libcli_smb.i index c3b8edd7e96..32e043b2c65 100644 --- a/source4/libcli/swig/libcli_smb.i +++ b/source4/libcli/swig/libcli_smb.i @@ -1,6 +1,7 @@ %module libcli_smb %import "../../lib/talloc/talloc.i" +%import "../../lib/events/events.i" %{ #include "includes.h" @@ -8,8 +9,6 @@ #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);