[SCM] Samba Shared Repository - branch master updated -
6878295636116e17165dc8f7e195ca97cde14633
Stefan Metzmacher
metze at samba.org
Wed Dec 17 12:32:25 GMT 2008
The branch, master has been updated
via 6878295636116e17165dc8f7e195ca97cde14633 (commit)
via b97f17ddf110fd7538e4dc61a8701feb81370992 (commit)
via 46eda790905e0ca70d9ecd2822578dbfde456e63 (commit)
via 504f8816e3058b9358a18ef42e442753fe2657ba (commit)
from 09e6dfb8e8d1447306951e34e4e2211037edb9be (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 6878295636116e17165dc8f7e195ca97cde14633
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 17 13:30:05 2008 +0100
s4:headermap: we need the pathes for gen_ndr headers with and without ../
This should fix the OpenChange build
metze
commit b97f17ddf110fd7538e4dc61a8701feb81370992
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 17 11:34:41 2008 +0100
lib/util: make it possible to use debug.h with using xfile.h
metze
commit 46eda790905e0ca70d9ecd2822578dbfde456e63
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Dec 16 19:57:09 2008 +0100
s4:lib/tevent: add lib/events/ compat and let things compile
metze
commit 504f8816e3058b9358a18ef42e442753fe2657ba
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Dec 16 16:10:22 2008 +0100
s4:lib/events: move to toplevel directory as lib/tevent/
This commit will not compile on its own.
metze
-----------------------------------------------------------------------
Summary of changes:
lib/tevent/Makefile.in | 81 +
{source4/lib/events => lib/tevent}/autogen.sh | 0
{source4/lib/events => lib/tevent}/build_macros.m4 | 0
lib/tevent/config.mk | 59 +
lib/tevent/configure.ac | 40 +
lib/tevent/events.i | 54 +
{source4/lib/events => lib/tevent}/events.py | 0
lib/tevent/events_wrap.c | 3348 ++++++++++++++++++++
{source4/lib/events => lib/tevent}/libtalloc.m4 | 0
lib/tevent/libtevent.m4 | 51 +
{source4/lib/events => lib/tevent}/pkg.m4 | 0
{source4/lib/events => lib/tevent}/rules.mk | 0
{source4/lib/events => lib/tevent}/tests.py | 0
{source4/lib/events => lib/tevent}/testsuite.c | 0
lib/tevent/tevent.c | 310 ++
lib/tevent/tevent.h | 98 +
.../lib/events/events.mk => lib/tevent/tevent.mk | 0
lib/tevent/tevent.pc.in | 11 +
lib/tevent/tevent_aio.c | 567 ++++
lib/tevent/tevent_debug.c | 83 +
lib/tevent/tevent_epoll.c | 482 +++
.../tevent/tevent_internal.h | 0
.../events_liboop.c => lib/tevent/tevent_liboop.c | 0
lib/tevent/tevent_s4.c | 108 +
lib/tevent/tevent_select.c | 302 ++
lib/tevent/tevent_signal.c | 291 ++
lib/tevent/tevent_standard.c | 607 ++++
lib/tevent/tevent_timed.c | 230 ++
lib/tevent/tevent_util.c | 86 +
.../events_util.h => lib/tevent/tevent_util.h | 0
lib/util/debug.h | 3 +-
lib/util/xfile.h | 2 +-
source3/samba4.m4 | 4 +-
source3/samba4.mk | 1 +
source4/Makefile | 1 +
source4/configure.ac | 4 +-
source4/headermap.txt | 77 +-
source4/lib/events/Makefile.in | 81 -
source4/lib/events/config.mk | 57 +-
source4/lib/events/configure.ac | 40 -
source4/lib/events/events.c | 310 --
source4/lib/events/events.h | 99 +-
source4/lib/events/events.i | 54 -
source4/lib/events/events.pc.in | 11 -
source4/lib/events/events_aio.c | 567 ----
source4/lib/events/events_debug.c | 83 -
source4/lib/events/events_dummy.c | 4 +
source4/lib/events/events_epoll.c | 482 ---
source4/lib/events/events_internal.h | 159 +-
source4/lib/events/events_s4.c | 108 -
source4/lib/events/events_select.c | 302 --
source4/lib/events/events_signal.c | 291 --
source4/lib/events/events_standard.c | 607 ----
source4/lib/events/events_timed.c | 230 --
source4/lib/events/events_util.c | 86 -
source4/lib/events/events_wrap.c | 3348 --------------------
source4/lib/events/libevents.m4 | 49 -
source4/main.mk | 1 +
source4/torture/local/config.mk | 2 +-
59 files changed, 6880 insertions(+), 6991 deletions(-)
create mode 100644 lib/tevent/Makefile.in
rename {source4/lib/events => lib/tevent}/autogen.sh (100%)
rename {source4/lib/events => lib/tevent}/build_macros.m4 (100%)
create mode 100644 lib/tevent/config.mk
create mode 100644 lib/tevent/configure.ac
create mode 100644 lib/tevent/events.i
rename {source4/lib/events => lib/tevent}/events.py (100%)
create mode 100644 lib/tevent/events_wrap.c
rename {source4/lib/events => lib/tevent}/libtalloc.m4 (100%)
create mode 100644 lib/tevent/libtevent.m4
rename {source4/lib/events => lib/tevent}/pkg.m4 (100%)
rename {source4/lib/events => lib/tevent}/rules.mk (100%)
rename {source4/lib/events => lib/tevent}/tests.py (100%)
rename {source4/lib/events => lib/tevent}/testsuite.c (100%)
create mode 100644 lib/tevent/tevent.c
create mode 100644 lib/tevent/tevent.h
rename source4/lib/events/events.mk => lib/tevent/tevent.mk (100%)
create mode 100644 lib/tevent/tevent.pc.in
create mode 100644 lib/tevent/tevent_aio.c
create mode 100644 lib/tevent/tevent_debug.c
create mode 100644 lib/tevent/tevent_epoll.c
copy source4/lib/events/events_internal.h => lib/tevent/tevent_internal.h (100%)
rename source4/lib/events/events_liboop.c => lib/tevent/tevent_liboop.c (100%)
create mode 100644 lib/tevent/tevent_s4.c
create mode 100644 lib/tevent/tevent_select.c
create mode 100644 lib/tevent/tevent_signal.c
create mode 100644 lib/tevent/tevent_standard.c
create mode 100644 lib/tevent/tevent_timed.c
create mode 100644 lib/tevent/tevent_util.c
rename source4/lib/events/events_util.h => lib/tevent/tevent_util.h (100%)
delete mode 100644 source4/lib/events/Makefile.in
delete mode 100644 source4/lib/events/configure.ac
delete mode 100644 source4/lib/events/events.c
delete mode 100644 source4/lib/events/events.i
delete mode 100644 source4/lib/events/events.pc.in
delete mode 100644 source4/lib/events/events_aio.c
delete mode 100644 source4/lib/events/events_debug.c
create mode 100644 source4/lib/events/events_dummy.c
delete mode 100644 source4/lib/events/events_epoll.c
delete mode 100644 source4/lib/events/events_s4.c
delete mode 100644 source4/lib/events/events_select.c
delete mode 100644 source4/lib/events/events_signal.c
delete mode 100644 source4/lib/events/events_standard.c
delete mode 100644 source4/lib/events/events_timed.c
delete mode 100644 source4/lib/events/events_util.c
delete mode 100644 source4/lib/events/events_wrap.c
delete mode 100644 source4/lib/events/libevents.m4
Changeset truncated at 500 lines:
diff --git a/lib/tevent/Makefile.in b/lib/tevent/Makefile.in
new file mode 100644
index 0000000..9765d35
--- /dev/null
+++ b/lib/tevent/Makefile.in
@@ -0,0 +1,81 @@
+#!gmake
+#
+# Makefile for tdb directory
+#
+
+CC = @CC@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+includedir = @includedir@
+libdir = @libdir@
+VPATH = @srcdir@:@libreplacedir@
+srcdir = @srcdir@
+builddir = @builddir@
+sharedbuilddir = @sharedbuilddir@
+INSTALLCMD = @INSTALL@
+CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -Iinclude -I.
+LDFLAGS = @LDFLAGS@
+EXEEXT = @EXEEXT@
+SHLD = @SHLD@
+SHLD_FLAGS = @SHLD_FLAGS@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PICFLAG = @PICFLAG@
+SHLIBEXT = @SHLIBEXT@
+SWIG = swig
+PYTHON = @PYTHON@
+PYTHON_CONFIG = @PYTHON_CONFIG@
+PYTHON_BUILD_TARGET = @PYTHON_BUILD_TARGET@
+PYTHON_INSTALL_TARGET = @PYTHON_INSTALL_TARGET@
+PYTHON_CHECK_TARGET = @PYTHON_CHECK_TARGET@
+LIB_PATH_VAR = @LIB_PATH_VAR@
+teventdir = @teventdir@
+
+TALLOC_CFLAGS = @TALLOC_CFLAGS@
+TALLOC_LDFLAGS = @TALLOC_CFLAGS@
+TALLOC_LIBS = @TALLOC_LIBS@
+
+TEVENT_CFLAGS = @TEVENT_CFLAGS@
+TEVENT_LDFLAGS = @TEVENT_CFLAGS@
+TEVENT_LIBS = @TEVENT_LIBS@
+
+CFLAGS = $(CPPFLAGS) $(TALLOC_CFLAGS) $(TEVENT_CFLAGS) @CFLAGS@
+LDFLAGS = $(TALLOC_LDFLAGS) $(TEVENT_LDFLAGS) @LDFLAGS@
+LIBS = $(TALLOC_LIBS) $(TEVENT_LIBS) @LIBS@
+
+TEVENT_OBJ = @TEVENT_OBJ@ @LIBREPLACEOBJ@
+
+default: all
+
+include $(teventdir)/tevent.mk
+include $(teventdir)/rules.mk
+
+all:: showflags dirs $(PROGS) $(TEVENT_SOLIB) libtevent.a $(PYTHON_BUILD_TARGET)
+
+install:: all
+$(TEVENT_SOLIB): $(TEVENT_OBJ)
+ $(SHLD) $(SHLD_FLAGS) $(LDFLAGS) $(LIBS) -o $@ $(TEVENT_OBJ) @SONAMEFLAG@$(TEVENT_SONAME)
+
+shared-build: all
+ ${INSTALLCMD} -d $(sharedbuilddir)/lib
+ ${INSTALLCMD} -m 644 libtevent.a $(sharedbuilddir)/lib
+ ${INSTALLCMD} -m 755 $(TEVENT_SOLIB) $(sharedbuilddir)/lib
+ ln -sf $(TEVENT_SOLIB) $(sharedbuilddir)/lib/$(TEVENT_SONAME)
+ ln -sf $(TEVENT_SOLIB) $(sharedbuilddir)/lib/libtevent.so
+ ${INSTALLCMD} -d $(sharedbuilddir)/include
+ ${INSTALLCMD} -m 644 $(srcdir)/tevent.h $(sharedbuilddir)/include
+
+check: test
+
+test:: $(PYTHON_CHECK_TARGET)
+installcheck:: test install
+
+clean::
+ rm -f *.o *.a */*.o
+
+distclean:: clean
+ rm -f config.log config.status include/config.h config.cache
+ rm -f Makefile
+
+realdistclean:: distclean
+ rm -f configure include/config.h.in
diff --git a/source4/lib/events/autogen.sh b/lib/tevent/autogen.sh
similarity index 100%
rename from source4/lib/events/autogen.sh
rename to lib/tevent/autogen.sh
diff --git a/source4/lib/events/build_macros.m4 b/lib/tevent/build_macros.m4
similarity index 100%
rename from source4/lib/events/build_macros.m4
rename to lib/tevent/build_macros.m4
diff --git a/lib/tevent/config.mk b/lib/tevent/config.mk
new file mode 100644
index 0000000..5f9508a
--- /dev/null
+++ b/lib/tevent/config.mk
@@ -0,0 +1,59 @@
+##############################
+[MODULE::TEVENT_AIO]
+PRIVATE_DEPENDENCIES = LIBAIO_LINUX
+SUBSYSTEM = LIBTEVENT
+INIT_FUNCTION = s4_events_aio_init
+##############################
+
+TEVENT_AIO_OBJ_FILES = $(libteventsrcdir)/tevent_aio.o
+
+##############################
+[MODULE::TEVENT_EPOLL]
+SUBSYSTEM = LIBTEVENT
+INIT_FUNCTION = s4_events_epoll_init
+##############################
+
+TEVENT_EPOLL_OBJ_FILES = $(libteventsrcdir)/tevent_epoll.o
+
+##############################
+[MODULE::TEVENT_SELECT]
+SUBSYSTEM = LIBTEVENT
+INIT_FUNCTION = s4_events_select_init
+##############################
+
+TEVENT_SELECT_OBJ_FILES = $(libteventsrcdir)/tevent_select.o
+
+##############################
+[MODULE::TEVENT_STANDARD]
+SUBSYSTEM = LIBTEVENT
+INIT_FUNCTION = s4_events_standard_init
+##############################
+
+TEVENT_STANDARD_OBJ_FILES = $(libteventsrcdir)/tevent_standard.o
+
+################################################
+# Start SUBSYSTEM LIBTEVENT
+[LIBRARY::LIBTEVENT]
+PUBLIC_DEPENDENCIES = LIBTALLOC
+OUTPUT_TYPE = MERGED_OBJ
+CFLAGS = -I../lib/tevent
+#
+# End SUBSYSTEM LIBTEVENT
+################################################
+
+LIBTEVENT_OBJ_FILES = $(addprefix $(libteventsrcdir)/, tevent.o tevent_timed.o tevent_signal.o tevent_debug.o tevent_util.o tevent_s4.o)
+
+PUBLIC_HEADERS += $(addprefix $(libteventsrcdir)/, tevent.h tevent_internal.h)
+
+# TODO: Change python stuff to tevent
+[PYTHON::swig_events]
+LIBRARY_REALNAME = samba/_events.$(SHLIBEXT)
+PRIVATE_DEPENDENCIES = LIBTEVENT LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL
+
+swig_events_OBJ_FILES = $(libteventsrcdir)/events_wrap.o
+
+$(eval $(call python_py_module_template,samba/events.py,$(libteventsrcdir)/events.py))
+
+$(swig_events_OBJ_FILES): CFLAGS+=$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)
+
+PC_FILES += $(libteventsrcdir)/tevent.pc
diff --git a/lib/tevent/configure.ac b/lib/tevent/configure.ac
new file mode 100644
index 0000000..75719d1
--- /dev/null
+++ b/lib/tevent/configure.ac
@@ -0,0 +1,40 @@
+AC_PREREQ(2.50)
+AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
+AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
+AC_DEFUN([SMB_ENABLE], [echo -n ""])
+AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
+AC_INIT(tevent, 1.0.0)
+AC_CONFIG_SRCDIR([tevent.c])
+AC_CONFIG_HEADER(config.h)
+AC_LIBREPLACE_ALL_CHECKS
+
+AC_LD_EXPORT_DYNAMIC
+AC_LD_SONAMEFLAG
+AC_LD_PICFLAG
+AC_LD_SHLIBEXT
+AC_LIBREPLACE_SHLD
+AC_LIBREPLACE_SHLD_FLAGS
+AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR
+
+m4_include(build_macros.m4)
+BUILD_WITH_SHARED_BUILD_DIR
+
+m4_include(pkg.m4)
+m4_include(libtalloc.m4)
+
+m4_include(libtevent.m4)
+AC_PATH_PROGS([PYTHON_CONFIG], [python2.6-config python2.5-config python2.4-config python-config])
+AC_PATH_PROGS([PYTHON], [python2.6 python2.5 python2.4 python])
+
+PYTHON_BUILD_TARGET="build-python"
+PYTHON_INSTALL_TARGET="install-python"
+PYTHON_CHECK_TARGET="check-python"
+AC_SUBST(PYTHON_BUILD_TARGET)
+AC_SUBST(PYTHON_INSTALL_TARGET)
+AC_SUBST(PYTHON_CHECK_TARGET)
+if test -z "$PYTHON_CONFIG"; then
+ PYTHON_BUILD_TARGET=""
+ PYTHON_INSTALL_TARGET=""
+ PYTHON_CHECK_TARGET=""
+fi
+AC_OUTPUT(Makefile events.pc)
diff --git a/lib/tevent/events.i b/lib/tevent/events.i
new file mode 100644
index 0000000..7a604a9
--- /dev/null
+++ b/lib/tevent/events.i
@@ -0,0 +1,54 @@
+/*
+ Unix SMB/CIFS implementation.
+ Copyright (C) Jelmer Vernooij <jelmer at 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(docstring="Event management.",package="samba.events") events;
+
+%import "../../lib/talloc/talloc.i";
+
+%{
+#include "tevent.h"
+typedef struct event_context event;
+%}
+
+typedef struct event_context {
+ %extend {
+ %feature("docstring") event "S.__init__()";
+ event(TALLOC_CTX *mem_ctx) { return event_context_init(mem_ctx); }
+ %feature("docstring") loop_once "S.loop_once() -> int";
+ int loop_once(void);
+ %feature("docstring") loop_wait "S.loop_wait() -> int";
+ int loop_wait(void);
+ }
+} event;
+%talloctype(event);
+
+%typemap(default,noblock=1) struct event_context * {
+ $1 = event_context_init(NULL);
+}
+
+%typemap(default,noblock=1) struct event_context * {
+ $1 = event_context_init(NULL);
+}
+
+struct event_context *event_context_init_byname(TALLOC_CTX *mem_ctx, const char *name);
+
+%feature("docstring") event_backend_list "event_backend_list() -> list";
+const char **event_backend_list(TALLOC_CTX *mem_ctx);
+%feature("docstring") event_set_default_backend "event_set_default_backend(name) -> None";
+%rename(set_default_backend) event_set_default_backend;
+void event_set_default_backend(const char *backend);
diff --git a/source4/lib/events/events.py b/lib/tevent/events.py
similarity index 100%
rename from source4/lib/events/events.py
rename to lib/tevent/events.py
diff --git a/lib/tevent/events_wrap.c b/lib/tevent/events_wrap.c
new file mode 100644
index 0000000..b8b3a96
--- /dev/null
+++ b/lib/tevent/events_wrap.c
@@ -0,0 +1,3348 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.36
+ *
+ * This file is not intended to be easily readable and contains a number of
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPYTHON
+#define SWIG_PYTHON_NO_BUILD_NONE
+/* -----------------------------------------------------------------------------
+ * This section contains generic SWIG labels for method/variable
+ * declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+# define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+# define SWIGINLINE inline
+# else
+# define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+# elif defined(__ICC)
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+# pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+# define SWIGUNUSEDPARM(p)
+# else
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# ifndef GCC_HASCLASSVISIBILITY
+# define GCC_HASCLASSVISIBILITY
+# endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# if defined(STATIC_LINKED)
+# define SWIGEXPORT
+# else
+# define SWIGEXPORT __declspec(dllexport)
+# endif
+# else
+# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+# define SWIGEXPORT __attribute__ ((visibility("default")))
+# else
+# define SWIGEXPORT
+# endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# define SWIGSTDCALL __stdcall
+# else
+# define SWIGSTDCALL
+# endif
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+
+/* Python.h has to appear first */
+#include <Python.h>
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+ or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "4"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+ creating a static or dynamic library from the swig runtime code.
+ In 99.9% of the cases, swig just needs to declare them as 'static'.
+
+ But only do this if is strictly necessary, ie, if you have problems
+ with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/* Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN 0x1
+#define SWIG_CAST_NEW_MEMORY 0x2
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN 0x1
+
+
+/*
+ Flags/methods for returning states.
+
+ The swig conversion methods, as ConvertPtr, return and integer
+ that tells if the conversion was successful or not. And if not,
+ an error code can be returned (see swigerrors.swg for the codes).
+
+ Use the following macros/flags to set or process the returning
+ states.
+
+ In old swig versions, you usually write code as:
+
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+ // success code
+ } else {
+ //fail code
+ }
+
+ Now you can be more explicit as:
+
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+ if (SWIG_IsOK(res)) {
+ // success code
+ } else {
+ // fail code
+ }
+
+ that seems to be the same, but now you can also do
+
+ Type *ptr;
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+ if (SWIG_IsOK(res)) {
+ // success code
+ if (SWIG_IsNewObj(res) {
+ ...
+ delete *ptr;
+ } else {
+ ...
+ }
+ } else {
+ // fail code
+ }
+
+ I.e., now SWIG_ConvertPtr can return new objects and you can
+ identify the case and take care of the deallocation. Of course that
+ requires also to SWIG_ConvertPtr to return new result values, as
+
+ int SWIG_ConvertPtr(obj, ptr,...) {
+ if (<obj is ok>) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list