Freeswitch-trunk
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
February 2009
- 17 participants
- 681 discussions
Author: anthm
Date: Tue Feb 17 10:12:48 2009
New Revision: 12094
Log:
add python to esl
Added:
freeswitch/trunk/libs/esl/python/
freeswitch/trunk/libs/esl/python/Makefile
freeswitch/trunk/libs/esl/python/esl_wrap.cpp
Added: freeswitch/trunk/libs/esl/python/Makefile
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/python/Makefile Tue Feb 17 10:12:48 2009
@@ -0,0 +1,22 @@
+LOCAL_CFLAGS=
+LOCAL_LDFLAGS=
+
+all: ESL.so
+
+esl_wrap.cpp:
+ swig -module ESL -python -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
+
+esl_wrap.o: esl_wrap.cpp
+ $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o
+
+ESL.so: esl_wrap.o
+ $(CXX) $(SOLINK) esl_wrap.o $(MYLIB) $(LOCAL_LDFLAGS) -o ESL.so -L. $(LIBS)
+
+clean:
+ rm -f *.o *.so *~
+
+swigclean:
+ rm -f esl_wrap.* ESL.so
+
+reswig: swigclean esl_wrap.cpp
+
Added: freeswitch/trunk/libs/esl/python/esl_wrap.cpp
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/python/esl_wrap.cpp Tue Feb 17 10:12:48 2009
@@ -0,0 +1,2930 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org)
+ * Version 1.3.35
+ *
+ * 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.
+ * ----------------------------------------------------------------------------- */
+
+
+#ifdef __cplusplus
+template<typename T> class SwigValueWrapper {
+ T *tt;
+public:
+ SwigValueWrapper() : tt(0) { }
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
+ SwigValueWrapper(const T& t) : tt(new T(t)) { }
+ ~SwigValueWrapper() { delete tt; }
+ SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
+ operator T&() const { return *tt; }
+ T *operator&() { return tt; }
+private:
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+};
+
+template <typename T> T SwigValueInit() {
+ return T();
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * 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 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
+
+
+/* -----------------------------------------------------------------------------
+ * 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>) {
+ if (<need new object>) {
+ *ptr = <ptr to new allocated object>;
+ return SWIG_NEWOBJ;
+ } else {
+ *ptr = <ptr to old object>;
+ return SWIG_OLDOBJ;
+ }
+ } else {
+ return SWIG_BADOBJ;
+ }
+ }
+
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+ swig errors code.
+
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+ allows to return the 'cast rank', for example, if you have this
+
+ int food(double)
+ int fooi(int);
+
+ and you call
+
+ food(1) // cast rank '1' (1 -> 1.0)
+ fooi(1) // cast rank '0'
+
+ just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK (0)
+#define SWIG_ERROR (-1)
+#define SWIG_IsOK(r) (r >= 0)
+#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ (SWIG_ERROR)
+#define SWIG_OLDOBJ (SWIG_OK)
+#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+# ifndef SWIG_TypeRank
+# define SWIG_TypeRank unsigned long
+# endif
+# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
+# define SWIG_MAXCASTRANK (2)
+# endif
+# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
+# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) {
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) {
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
+}
+#else /* no cast-rank mode */
+# define SWIG_AddCast
+# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *, int *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store information on one type */
+typedef struct swig_type_info {
+ const char *name; /* mangled name of this type */
+ const char *str; /* human readable name of this type */
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
+ void *clientdata; /* language specific type data */
+ int owndata; /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
+ swig_converter_func converter; /* function to cast the void pointers */
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
+ struct swig_cast_info *prev; /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
+ size_t size; /* Number of types in this module */
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
+ swig_type_info **type_initial; /* Array of initially generated type structures */
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
+ void *clientdata; /* Language specific module data */
+} swig_module_info;
+
+/*
+ Compare two type names skipping the space characters, therefore
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+ Return 0 when the two name types are equivalent, as in
+ strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+ const char *f2, const char *l2) {
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+ }
+ return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+ Check type equivalence in a name list like <name1>|<name2>|...
+ Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') break;
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) ++ne;
+ }
+ return equiv;
+}
+
+/*
+ Check type equivalence in a name list like <name1>|<name2>|...
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') break;
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) ++ne;
+ }
+ return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty) \
+ if (ty) { \
+ swig_cast_info *iter = ty->cast; \
+ while (iter) { \
+ if (comparison) { \
+ if (iter == ty->cast) return iter; \
+ /* Move iter to the top of the linked list */ \
+ iter->prev->next = iter->next; \
+ if (iter->next) \
+ iter->next->prev = iter->prev; \
+ iter->next = ty->cast; \
+ iter->prev = 0; \
+ if (ty->cast) ty->cast->prev = iter; \
+ ty->cast = iter; \
+ return iter; \
+ } \
+ iter = iter->next; \
+ } \
+ } \
+ return 0
+
+/*
+ Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+ SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+ SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+ Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+}
+
+/*
+ Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+ swig_type_info *lastty = ty;
+ if (!ty || !ty->dcast) return ty;
+ while (ty && (ty->dcast)) {
+ ty = (*ty->dcast)(ptr);
+ if (ty) lastty = ty;
+ }
+ return lastty;
+}
+
+/*
+ Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+ return ty->name;
+}
+
+/*
+ Return the pretty name associated with this type,
+ that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+ /* The "str" field contains the equivalent pretty names of the
+ type, separated by vertical-bar characters. We choose
+ to print the last name, as it is often (?) the most
+ specific. */
+ if (!type) return NULL;
+ if (type->str != NULL) {
+ const char *last_name = type->str;
+ const char *s;
+ for (s = type->str; *s; s++)
+ if (*s == '|') last_name = s+1;
+ return last_name;
+ }
+ else
+ return type->name;
+}
+
+/*
+ Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+ swig_cast_info *cast = ti->cast;
+ /* if (ti->clientdata == clientdata) return; */
+ ti->clientdata = clientdata;
+
+ while (cast) {
+ if (!cast->converter) {
+ swig_type_info *tc = cast->type;
+ if (!tc->clientdata) {
+ SWIG_TypeClientData(tc, clientdata);
+ }
+ }
+ cast = cast->next;
+ }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+ SWIG_TypeClientData(ti, clientdata);
+ ti->owndata = 1;
+}
+
+/*
+ Search for a swig_type_info structure only by mangled name
+ Search is a O(log #types)
+
+ We start searching at module start, and finish searching when start == end.
+ Note: if start == end at the beginning of the function, we go all the way around
+ the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name) {
+ swig_module_info *iter = start;
+ do {
+ if (iter->size) {
+ register size_t l = 0;
+ register size_t r = iter->size - 1;
+ do {
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+ register size_t i = (l + r) >> 1;
+ const char *iname = iter->types[i]->name;
+ if (iname) {
+ register int compare = strcmp(name, iname);
+ if (compare == 0) {
+ return iter->types[i];
+ } else if (compare < 0) {
+ if (i) {
+ r = i - 1;
+ } else {
+ break;
+ }
+ } else if (compare > 0) {
+ l = i + 1;
+ }
+ } else {
+ break; /* should never happen */
+ }
+ } while (l <= r);
+ }
+ iter = iter->next;
+ } while (iter != end);
+ return 0;
+}
+
+/*
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
+ It first searches the mangled names of the types, which is a O(log #types)
+ If a type is not found it then searches the human readable names, which is O(#types).
+
+ We start searching at module start, and finish searching when start == end.
+ Note: if start == end at the beginning of the function, we go all the way around
+ the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name) {
+ /* STEP 1: Search the name field using binary search */
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+ if (ret) {
+ return ret;
+ } else {
+ /* STEP 2: If the type hasn't been found, do a complete search
+ of the str field (the human readable name) */
+ swig_module_info *iter = start;
+ do {
+ register size_t i = 0;
+ for (; i < iter->size; ++i) {
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+ return iter->types[i];
+ }
+ iter = iter->next;
+ } while (iter != end);
+ }
+
+ /* neither found a match */
+ return 0;
+}
+
+/*
+ Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+ static const char hex[17] = "0123456789abcdef";
+ register const unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register unsigned char uu = *u;
+ *(c++) = hex[(uu & 0xf0) >> 4];
+ *(c++) = hex[uu & 0xf];
+ }
+ return c;
+}
+
+/*
+ Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+ register unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register char d = *(c++);
+ register unsigned char uu;
+ if ((d >= '0') && (d <= '9'))
+ uu = ((d - '0') << 4);
+ else if ((d >= 'a') && (d <= 'f'))
+ uu = ((d - ('a'-10)) << 4);
+ else
+ return (char *) 0;
+ d = *(c++);
+ if ((d >= '0') && (d <= '9'))
+ uu |= (d - '0');
+ else if ((d >= 'a') && (d <= 'f'))
+ uu |= (d - ('a'-10));
+ else
+ return (char *) 0;
+ *u = uu;
+ }
+ return c;
+}
+
+/*
+ Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+ char *r = buff;
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
+ *(r++) = '_';
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+ strcpy(r,name);
+ return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ *ptr = (void *) 0;
+ return name;
+ } else {
+ return 0;
+ }
+ }
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+ char *r = buff;
+ size_t lname = (name ? strlen(name) : 0);
+ if ((2*sz + 2 + lname) > bsz) return 0;
+ *(r++) = '_';
+ r = SWIG_PackData(r,ptr,sz);
+ if (lname) {
+ strncpy(r,name,lname+1);
+ } else {
+ *r = 0;
+ }
+ return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ memset(ptr,0,sz);
+ return name;
+ } else {
+ return 0;
+ }
+ }
+ return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * luarun.swg
+ *
+ * This file contains the runtime support for Lua modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "lua.h"
+#include "lauxlib.h"
+#include <stdlib.h> /* for malloc */
+#include <assert.h> /* for a few sanity tests */
+
+/* -----------------------------------------------------------------------------
+ * global swig types
+ * ----------------------------------------------------------------------------- */
+/* Constant table */
+#define SWIG_LUA_INT 1
+#define SWIG_LUA_FLOAT 2
+#define SWIG_LUA_STRING 3
+#define SWIG_LUA_POINTER 4
+#define SWIG_LUA_BINARY 5
+#define SWIG_LUA_CHAR 6
+
+/* Structure for variable linking table */
+typedef struct {
+ const char *name;
+ lua_CFunction get;
+ lua_CFunction set;
+} swig_lua_var_info;
+
+/* Constant information structure */
+typedef struct {
+ int type;
+ char *name;
+ long lvalue;
+ double dvalue;
+ void *pvalue;
+ swig_type_info **ptype;
+} swig_lua_const_info;
+
+typedef struct {
+ const char *name;
+ lua_CFunction method;
+} swig_lua_method;
+
+typedef struct {
+ const char *name;
+ lua_CFunction getmethod;
+ lua_CFunction setmethod;
+} swig_lua_attribute;
+
+typedef struct swig_lua_class {
+ const char *name;
+ swig_type_info **type;
+ lua_CFunction constructor;
+ void (*destructor)(void *);
+ swig_lua_method *methods;
+ swig_lua_attribute *attributes;
+ struct swig_lua_class **bases;
+ const char **base_names;
+} swig_lua_class;
+
+/* this is the struct for wrappering all pointers in SwigLua
+*/
+typedef struct {
+ swig_type_info *type;
+ int own; /* 1 if owned & must be destroyed */
+ void *ptr;
+} swig_lua_userdata;
+
+/* this is the struct for wrapping arbitary packed binary data
+(currently it is only used for member function pointers)
+the data ordering is similar to swig_lua_userdata, but it is currently not possible
+to tell the two structures apart within Swig, other than by looking at the type
+*/
+typedef struct {
+ swig_type_info *type;
+ int own; /* 1 if owned & must be destroyed */
+ char data[1]; /* arbitary amount of data */
+} swig_lua_rawdata;
+
+/* Common SWIG API */
+#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
+#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
+#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
+#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
+
+/* Runtime API */
+#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
+#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
+#define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
+
+/* Contract support */
+#define SWIG_contract_assert(expr, msg) \
+ if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else
+
+/* helper #defines */
+#define SWIG_fail {goto fail;}
+#define SWIG_fail_arg(func_name,argnum,type) \
+ {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
+ func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
+ goto fail;}
+#define SWIG_fail_ptr(func_name,argnum,type) \
+ SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
+#define SWIG_check_num_args(func_name,a,b) \
+ if (lua_gettop(L)<a || lua_gettop(L)>b) \
+ {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
+ goto fail;}
+
+
+#define SWIG_Lua_get_table(L,n) \
+ (lua_pushstring(L, n), lua_rawget(L,-2))
+
+#define SWIG_Lua_add_function(L,n,f) \
+ (lua_pushstring(L, n), \
+ lua_pushcfunction(L, f), \
+ lua_rawset(L,-3))
+
+/* special helper for allowing 'nil' for usertypes */
+#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
+
+#ifdef __cplusplus
+/* Special helper for member function pointers
+it gets the address, casts it, then dereferences it */
+//#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a)))
+#endif
+
+/* storing/access of swig_module_info */
+SWIGRUNTIME swig_module_info *
+SWIG_Lua_GetModule(lua_State* L) {
+ swig_module_info *ret = 0;
+ lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
+ lua_rawget(L,LUA_REGISTRYINDEX);
+ if (lua_islightuserdata(L,-1))
+ ret=(swig_module_info*)lua_touserdata(L,-1);
+ lua_pop(L,1); /* tidy */
+ return ret;
+}
+
+SWIGRUNTIME void
+SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
+ /* add this all into the Lua registry: */
+ lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
+ lua_pushlightuserdata(L,(void*)module);
+ lua_rawset(L,LUA_REGISTRYINDEX);
+}
+
+/* -----------------------------------------------------------------------------
+ * global variable support code: modules
+ * ----------------------------------------------------------------------------- */
+
+/* this function is called when trying to set an immutable.
+default value is to print an error.
+This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
+SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
+{
+/* there should be 1 param passed in: the new value */
+#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
+ lua_pop(L,1); /* remove it */
+ lua_pushstring(L,"This variable is immutable");
+ lua_error(L);
+#endif
+ return 0; /* should not return anything */
+}
+
+/* the module.get method used for getting linked data */
+SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
+{
+/* there should be 2 params passed in
+ (1) table (not the meta table)
+ (2) string name of the attribute
+ printf("SWIG_Lua_module_get %p(%s) '%s'\n",
+ lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
+ lua_tostring(L,2));
+*/
+ /* get the metatable */
+ assert(lua_istable(L,1)); /* just in case */
+ lua_getmetatable(L,1); /* get the metatable */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_get_table(L,".get"); /* get the .get table */
+ lua_remove(L,3); /* remove metatable */
+ if (lua_istable(L,-1))
+ {
+ /* look for the key in the .get table */
+ lua_pushvalue(L,2); /* key */
+ lua_rawget(L,-2);
+ lua_remove(L,3); /* remove .get */
+ if (lua_iscfunction(L,-1))
+ { /* found it so call the fn & return its value */
+ lua_call(L,0,1);
+ return 1;
+ }
+ lua_pop(L,1); /* remove the top */
+ }
+ lua_pop(L,1); /* remove the .get */
+ lua_pushnil(L); /* return a nil */
+ return 1;
+}
+
+/* the module.set method used for setting linked data */
+SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
+{
+/* there should be 3 params passed in
+ (1) table (not the meta table)
+ (2) string name of the attribute
+ (3) any for the new value
+*/
+ /* get the metatable */
+ assert(lua_istable(L,1)); /* just in case */
+ lua_getmetatable(L,1); /* get the metatable */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_get_table(L,".set"); /* get the .set table */
+ lua_remove(L,4); /* remove metatable */
+ if (lua_istable(L,-1))
+ {
+ /* look for the key in the .set table */
+ lua_pushvalue(L,2); /* key */
+ lua_rawget(L,-2);
+ lua_remove(L,4); /* remove .set */
+ if (lua_iscfunction(L,-1))
+ { /* found it so call the fn & return its value */
+ lua_pushvalue(L,3); /* value */
+ lua_call(L,1,0);
+ return 0;
+ }
+ }
+ lua_settop(L,3); /* reset back to start */
+ /* we now have the table, key & new value, so just set directly */
+ lua_rawset(L,1); /* add direct */
+ return 0;
+}
+
+/* registering a module in lua */
+SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name)
+{
+ assert(lua_istable(L,-1)); /* just in case */
+ lua_pushstring(L,name);
+ lua_newtable(L); /* the table */
+ /* add meta table */
+ lua_newtable(L); /* the meta table */
+ SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
+ SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
+ lua_pushstring(L,".get");
+ lua_newtable(L); /* the .get table */
+ lua_rawset(L,-3); /* add .get into metatable */
+ lua_pushstring(L,".set");
+ lua_newtable(L); /* the .set table */
+ lua_rawset(L,-3); /* add .set into metatable */
+ lua_setmetatable(L,-2); /* sets meta table in module */
+ lua_rawset(L,-3); /* add module into parent */
+ SWIG_Lua_get_table(L,name); /* get the table back out */
+}
+
+/* ending the register */
+SWIGINTERN void SWIG_Lua_module_end(lua_State* L)
+{
+ lua_pop(L,1); /* tidy stack (remove module) */
+}
+
+/* adding a linked variable to the module */
+SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
+{
+ assert(lua_istable(L,-1)); /* just in case */
+ lua_getmetatable(L,-1); /* get the metatable */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_get_table(L,".get"); /* find the .get table */
+ assert(lua_istable(L,-1)); /* should be a table: */
+ SWIG_Lua_add_function(L,name,getFn);
+ lua_pop(L,1); /* tidy stack (remove table) */
+ if (setFn) /* if there is a set fn */
+ {
+ SWIG_Lua_get_table(L,".set"); /* find the .set table */
+ assert(lua_istable(L,-1)); /* should be a table: */
+ SWIG_Lua_add_function(L,name,setFn);
+ lua_pop(L,1); /* tidy stack (remove table) */
+ }
+ lua_pop(L,1); /* tidy stack (remove meta) */
+}
+
+/* adding a function module */
+SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
+{
+ SWIG_Lua_add_function(L,name,fn);
+}
+
+/* -----------------------------------------------------------------------------
+ * global variable support code: classes
+ * ----------------------------------------------------------------------------- */
+
+/* the class.get method, performs the lookup of class attributes */
+SWIGINTERN int SWIG_Lua_class_get(lua_State* L)
+{
+/* there should be 2 params passed in
+ (1) userdata (not the meta table)
+ (2) string name of the attribute
+*/
+ assert(lua_isuserdata(L,-2)); /* just in case */
+ lua_getmetatable(L,-2); /* get the meta table */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_get_table(L,".get"); /* find the .get table */
+ assert(lua_istable(L,-1)); /* just in case */
+ /* look for the key in the .get table */
+ lua_pushvalue(L,2); /* key */
+ lua_rawget(L,-2);
+ lua_remove(L,-2); /* stack tidy, remove .get table */
+ if (lua_iscfunction(L,-1))
+ { /* found it so call the fn & return its value */
+ lua_pushvalue(L,1); /* the userdata */
+ lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */
+ lua_remove(L,-2); /* stack tidy, remove metatable */
+ return 1;
+ }
+ lua_pop(L,1); /* remove whatever was there */
+ /* ok, so try the .fn table */
+ SWIG_Lua_get_table(L,".fn"); /* find the .get table */
+ assert(lua_istable(L,-1)); /* just in case */
+ lua_pushvalue(L,2); /* key */
+ lua_rawget(L,-2); /* look for the fn */
+ lua_remove(L,-2); /* stack tidy, remove .fn table */
+ if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
+ { /* found it so return the fn & let lua call it */
+ lua_remove(L,-2); /* stack tidy, remove metatable */
+ return 1;
+ }
+ lua_pop(L,1); /* remove whatever was there */
+ /* NEW: looks for the __getitem() fn
+ this is a user provided get fn */
+ SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
+ if (lua_iscfunction(L,-1)) /* if its there */
+ { /* found it so call the fn & return its value */
+ lua_pushvalue(L,1); /* the userdata */
+ lua_pushvalue(L,2); /* the parameter */
+ lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */
+ lua_remove(L,-2); /* stack tidy, remove metatable */
+ return 1;
+ }
+ return 0; /* sorry not known */
+}
+
+/* the class.set method, performs the lookup of class attributes */
+SWIGINTERN int SWIG_Lua_class_set(lua_State* L)
+{
+/* there should be 3 params passed in
+ (1) table (not the meta table)
+ (2) string name of the attribute
+ (3) any for the new value
+printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n",
+ lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
+ lua_tostring(L,2),
+ lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/
+
+ assert(lua_isuserdata(L,1)); /* just in case */
+ lua_getmetatable(L,1); /* get the meta table */
+ assert(lua_istable(L,-1)); /* just in case */
+
+ SWIG_Lua_get_table(L,".set"); /* find the .set table */
+ if (lua_istable(L,-1))
+ {
+ /* look for the key in the .set table */
+ lua_pushvalue(L,2); /* key */
+ lua_rawget(L,-2);
+ if (lua_iscfunction(L,-1))
+ { /* found it so call the fn & return its value */
+ lua_pushvalue(L,1); /* userdata */
+ lua_pushvalue(L,3); /* value */
+ lua_call(L,2,0);
+ return 0;
+ }
+ lua_pop(L,1); /* remove the value */
+ }
+ lua_pop(L,1); /* remove the value .set table */
+ /* NEW: looks for the __setitem() fn
+ this is a user provided set fn */
+ SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
+ if (lua_iscfunction(L,-1)) /* if its there */
+ { /* found it so call the fn & return its value */
+ lua_pushvalue(L,1); /* the userdata */
+ lua_pushvalue(L,2); /* the parameter */
+ lua_pushvalue(L,3); /* the value */
+ lua_call(L,3,0); /* 3 values in ,0 out */
+ lua_remove(L,-2); /* stack tidy, remove metatable */
+ return 1;
+ }
+ return 0;
+}
+
+/* the class.destruct method called by the interpreter */
+SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L)
+{
+/* there should be 1 params passed in
+ (1) userdata (not the meta table) */
+ swig_lua_userdata* usr;
+ swig_lua_class* clss;
+ assert(lua_isuserdata(L,-1)); /* just in case */
+ usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
+ /* if must be destroyed & has a destructor */
+ if (usr->own) /* if must be destroyed */
+ {
+ clss=(swig_lua_class*)usr->type->clientdata; /* get the class */
+ if (clss && clss->destructor) /* there is a destroy fn */
+ {
+ clss->destructor(usr->ptr); /* bye bye */
+ }
+ }
+ return 0;
+}
+
+/* gets the swig class registry (or creates it) */
+SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L)
+{
+ /* add this all into the swig registry: */
+ lua_pushstring(L,"SWIG");
+ lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */
+ if (!lua_istable(L,-1)) /* not there */
+ { /* must be first time, so add it */
+ lua_pop(L,1); /* remove the result */
+ lua_pushstring(L,"SWIG");
+ lua_newtable(L);
+ lua_rawset(L,LUA_REGISTRYINDEX);
+ /* then get it */
+ lua_pushstring(L,"SWIG");
+ lua_rawget(L,LUA_REGISTRYINDEX);
+ }
+}
+
+/* helper fn to get the classes metatable from the register */
+SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname)
+{
+ SWIG_Lua_get_class_registry(L); /* get the registry */
+ lua_pushstring(L,cname); /* get the name */
+ lua_rawget(L,-2); /* get it */
+ lua_remove(L,-2); /* tidy up (remove registry) */
+}
+
+/* helper add a variable to a registered class */
+SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
+{
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_get_table(L,".get"); /* find the .get table */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_add_function(L,name,getFn);
+ lua_pop(L,1); /* tidy stack (remove table) */
+ if (setFn)
+ {
+ SWIG_Lua_get_table(L,".set"); /* find the .set table */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_add_function(L,name,setFn);
+ lua_pop(L,1); /* tidy stack (remove table) */
+ }
+}
+
+/* helper to recursively add class details (attributes & operations) */
+SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
+{
+ int i;
+ /* call all the base classes first: we can then override these later: */
+ for(i=0;clss->bases[i];i++)
+ {
+ SWIG_Lua_add_class_details(L,clss->bases[i]);
+ }
+ /* add fns */
+ for(i=0;clss->attributes[i].name;i++){
+ SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
+ }
+ /* add methods to the metatable */
+ SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
+ assert(lua_istable(L,-1)); /* just in case */
+ for(i=0;clss->methods[i].name;i++){
+ SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
+ }
+ lua_pop(L,1); /* tidy stack (remove table) */
+ /* add operator overloads
+ these look ANY method which start with "__" and assume they
+ are operator overloads & add them to the metatable
+ (this might mess up is someone defines a method __gc (the destructor)*/
+ for(i=0;clss->methods[i].name;i++){
+ if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
+ SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
+ }
+ }
+}
+
+/* set up the base classes pointers.
+Each class structure has a list of pointers to the base class structures.
+This function fills them.
+It cannot be done at compile time, as this will not work with hireachies
+spread over more than one swig file.
+Therefore it must be done at runtime, querying the SWIG type system.
+*/
+SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
+{
+ int i=0;
+ swig_module_info* module=SWIG_GetModule(L);
+ for(i=0;clss->base_names[i];i++)
+ {
+ if (clss->bases[i]==0) /* not found yet */
+ {
+ /* lookup and cache the base class */
+ swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
+ if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
+ }
+ }
+}
+
+/* performs the entire class registration process */
+SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
+{
+ /* add its constructor to module with the name of the class
+ so you can do MyClass(...) as well as new_MyClass(...)
+ BUT only if a constructor is defined
+ (this overcomes the problem of pure virtual classes without constructors)*/
+ if (clss->constructor)
+ SWIG_Lua_add_function(L,clss->name,clss->constructor);
+
+ SWIG_Lua_get_class_registry(L); /* get the registry */
+ lua_pushstring(L,clss->name); /* get the name */
+ lua_newtable(L); /* create the metatable */
+ /* add string of class name called ".type" */
+ lua_pushstring(L,".type");
+ lua_pushstring(L,clss->name);
+ lua_rawset(L,-3);
+ /* add a table called ".get" */
+ lua_pushstring(L,".get");
+ lua_newtable(L);
+ lua_rawset(L,-3);
+ /* add a table called ".set" */
+ lua_pushstring(L,".set");
+ lua_newtable(L);
+ lua_rawset(L,-3);
+ /* add a table called ".fn" */
+ lua_pushstring(L,".fn");
+ lua_newtable(L);
+ lua_rawset(L,-3);
+ /* add accessor fns for using the .get,.set&.fn */
+ SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
+ SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
+ SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
+ /* add it */
+ lua_rawset(L,-3); /* metatable into registry */
+ lua_pop(L,1); /* tidy stack (remove registry) */
+
+ SWIG_Lua_get_class_metatable(L,clss->name);
+ SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */
+ lua_pop(L,1); /* tidy stack (remove class metatable) */
+}
+
+/* -----------------------------------------------------------------------------
+ * Class/structure conversion fns
+ * ----------------------------------------------------------------------------- */
+
+/* helper to add metatable to new lua object */
+SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type)
+{
+ if (type->clientdata) /* there is clientdata: so add the metatable */
+ {
+ SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
+ if (lua_istable(L,-1))
+ {
+ lua_setmetatable(L,-2);
+ }
+ else
+ {
+ lua_pop(L,1);
+ }
+ }
+}
+
+/* pushes a new object into the lua stack */
+SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own)
+{
+ swig_lua_userdata* usr;
+ if (!ptr){
+ lua_pushnil(L);
+ return;
+ }
+ usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */
+ usr->ptr=ptr; /* set the ptr */
+ usr->type=type;
+ usr->own=own;
+ _SWIG_Lua_AddMetatable(L,type); /* add metatable */
+}
+
+/* takes a object from the lua stack & converts it into an object of the correct type
+ (if possible) */
+SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags)
+{
+ swig_lua_userdata* usr;
+ swig_cast_info *cast;
+ if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */
+ usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */
+ if (usr)
+ {
+ if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
+ {
+ usr->own=0;
+ }
+ if (!type) /* special cast void*, no casting fn */
+ {
+ *ptr=usr->ptr;
+ return SWIG_OK; /* ok */
+ }
+ cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
+ if (cast)
+ {
+ int newmemory = 0;
+ *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
+ assert(!newmemory); /* newmemory handling not yet implemented */
+ return SWIG_OK; /* ok */
+ }
+ }
+ return SWIG_ERROR; /* error */
+}
+
+SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags,
+ int argnum,const char* func_name){
+ void* result;
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
+ lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n",
+ func_name,(type && type->str)?type->str:"void*",argnum);
+ lua_error(L);
+ }
+ return result;
+}
+
+/* pushes a packed userdata. user for member fn pointers only */
+SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
+{
+ swig_lua_rawdata* raw;
+ assert(ptr); /* not acceptable to pass in a NULL value */
+ raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */
+ raw->type=type;
+ raw->own=0;
+ memcpy(raw->data,ptr,size); /* copy the data */
+ _SWIG_Lua_AddMetatable(L,type); /* add metatable */
+}
+
+/* converts a packed userdata. user for member fn pointers only */
+SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
+{
+ swig_lua_rawdata* raw;
+ raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */
+ if (!raw) return SWIG_ERROR; /* error */
+ if (type==0 || type==raw->type) /* void* or identical type */
+ {
+ memcpy(ptr,raw->data,size); /* copy it */
+ return SWIG_OK; /* ok */
+ }
+ return SWIG_ERROR; /* error */
+}
+
+/* a function to get the typestring of a piece of data */
+SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
+{
+ swig_lua_userdata* usr;
+ if (lua_isuserdata(L,tp))
+ {
+ usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
+ if (usr && usr->type && usr->type->str)
+ return usr->type->str;
+ return "userdata (unknown type)";
+ }
+ return lua_typename(L,lua_type(L,tp));
+}
+
+/* lua callable function to get the userdata's type */
+SWIGRUNTIME int SWIG_Lua_type(lua_State* L)
+{
+ lua_pushstring(L,SWIG_Lua_typename(L,1));
+ return 1;
+}
+
+/* lua callable function to compare userdata's value
+the issue is that two userdata may point to the same thing
+but to lua, they are different objects */
+SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
+{
+ int result;
+ swig_lua_userdata *usr1,*usr2;
+ if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */
+ return 0; /* nil reply */
+ usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
+ usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */
+ /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
+ result=(usr1->ptr==usr2->ptr);
+ lua_pushboolean(L,result);
+ return 1;
+}
+
+/* -----------------------------------------------------------------------------
+ * global variable support code: class/struct typemap functions
+ * ----------------------------------------------------------------------------- */
+
+/* Install Constants */
+SWIGINTERN void
+SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
+ int i;
+ for (i = 0; constants[i].type; i++) {
+ switch(constants[i].type) {
+ case SWIG_LUA_INT:
+ lua_pushstring(L,constants[i].name);
+ lua_pushnumber(L,(lua_Number)constants[i].lvalue);
+ lua_rawset(L,-3);
+ break;
+ case SWIG_LUA_FLOAT:
+ lua_pushstring(L,constants[i].name);
+ lua_pushnumber(L,(lua_Number)constants[i].dvalue);
+ lua_rawset(L,-3);
+ break;
+ case SWIG_LUA_CHAR:
+ lua_pushstring(L,constants[i].name);
+ lua_pushfstring(L,"%c",(char)constants[i].lvalue);
+ lua_rawset(L,-3);
+ break;
+ case SWIG_LUA_STRING:
+ lua_pushstring(L,constants[i].name);
+ lua_pushstring(L,(char *) constants[i].pvalue);
+ lua_rawset(L,-3);
+ break;
+ case SWIG_LUA_POINTER:
+ lua_pushstring(L,constants[i].name);
+ SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
+ lua_rawset(L,-3);
+ break;
+ case SWIG_LUA_BINARY:
+ lua_pushstring(L,constants[i].name);
+ SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
+ lua_rawset(L,-3);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+/* -----------------------------------------------------------------------------
+ * executing lua code from within the wrapper
+ * ----------------------------------------------------------------------------- */
+
+#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
+#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
+#endif
+/* Executes a C string in Lua a really simple way of calling lua from C
+Unfortunately lua keeps changing its API's, so we need a conditional compile
+In lua 5.0.X its lua_dostring()
+In lua 5.1.X its luaL_dostring()
+*/
+SWIGINTERN int
+SWIG_Lua_dostring(lua_State *L, const char* str) {
+ int ok,top;
+ if (str==0 || str[0]==0) return 0; /* nothing to do */
+ top=lua_gettop(L); /* save stack */
+#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
+ ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */
+#else
+ ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */
+#endif
+ if (ok!=0) {
+ SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
+ }
+ lua_settop(L,top); /* restore the stack */
+ return ok;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* ------------------------------ end luarun.swg ------------------------------ */
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_eslConnection swig_types[0]
+#define SWIGTYPE_p_eslEvent swig_types[1]
+#define SWIGTYPE_p_esl_event_t swig_types[2]
+#define SWIGTYPE_p_esl_priority_t swig_types[3]
+#define SWIGTYPE_p_esl_status_t swig_types[4]
+static swig_type_info *swig_types[6];
+static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_name "ESL"
+#define SWIG_init luaopen_ESL
+#define SWIG_init_user luaopen_ESL_user
+
+#define SWIG_LUACODE luaopen_ESL_luacode
+
+
+namespace swig {
+typedef struct{} LANGUAGE_OBJ;
+}
+
+
+#include "esl.h"
+#include "esl_oop.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+static int _wrap_eslEvent_event_set(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ esl_event_t *arg2 = (esl_event_t *) 0 ;
+
+ SWIG_check_num_args("event",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"eslEvent *");
+ if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("event",2,"esl_event_t *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_event_set",1,SWIGTYPE_p_eslEvent);
+ }
+
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_esl_event_t,SWIG_POINTER_DISOWN))){
+ SWIG_fail_ptr("eslEvent_event_set",2,SWIGTYPE_p_esl_event_t);
+ }
+
+ if (arg1) (arg1)->event = arg2;
+
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_event_get(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ esl_event_t *result = 0 ;
+
+ SWIG_check_num_args("event",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_event_get",1,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (esl_event_t *) ((arg1)->event);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_esl_event_t,0); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_serialized_string_set(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ SWIG_check_num_args("serialized_string",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"eslEvent *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("serialized_string",2,"char *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_serialized_string_set",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ {
+ if (arg1->serialized_string) delete [] arg1->serialized_string;
+ if (arg2) {
+ arg1->serialized_string = (char *) (new char[strlen((const char *)arg2)+1]);
+ strcpy((char *)arg1->serialized_string, (const char *)arg2);
+ } else {
+ arg1->serialized_string = 0;
+ }
+ }
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_serialized_string_get(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("serialized_string",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_serialized_string_get",1,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (char *) ((arg1)->serialized_string);
+ SWIG_arg=0;
+ lua_pushstring(L,(const char*)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_mine_set(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ int arg2 ;
+
+ SWIG_check_num_args("mine",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"eslEvent *");
+ if(!lua_isnumber(L,2)) SWIG_fail_arg("mine",2,"int");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_mine_set",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (int)lua_tonumber(L, 2);
+ if (arg1) (arg1)->mine = arg2;
+
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_mine_get(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ int result;
+
+ SWIG_check_num_args("mine",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_mine_get",1,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (int) ((arg1)->mine);
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_new_eslEvent__SWIG_0(lua_State* L) {
+ int SWIG_arg = -1;
+ char *arg1 = (char *) 0 ;
+ char *arg2 = (char *) NULL ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("eslEvent",1,2)
+ if(!lua_isstring(L,1)) SWIG_fail_arg("eslEvent",1,"char const *");
+ if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("eslEvent",2,"char const *");
+ arg1 = (char *)lua_tostring(L, 1);
+ if(lua_gettop(L)>=2){
+ arg2 = (char *)lua_tostring(L, 2);
+ }
+ result = (eslEvent *)new eslEvent((char const *)arg1,(char const *)arg2);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,1); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_new_eslEvent__SWIG_1(lua_State* L) {
+ int SWIG_arg = -1;
+ esl_event_t *arg1 = (esl_event_t *) 0 ;
+ int arg2 = (int) 0 ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("eslEvent",1,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("eslEvent",1,"esl_event_t *");
+ if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("eslEvent",2,"int");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_esl_event_t,0))){
+ SWIG_fail_ptr("new_eslEvent",1,SWIGTYPE_p_esl_event_t);
+ }
+
+ if(lua_gettop(L)>=2){
+ arg2 = (int)lua_tonumber(L, 2);
+ }
+ result = (eslEvent *)new eslEvent(arg1,arg2);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,1); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_new_eslEvent(lua_State* L) {
+ int argc;
+ int argv[3]={
+ 1,2,3
+ };
+
+ argc = lua_gettop(L);
+ if ((argc >= 1) && (argc <= 2)) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_esl_event_t, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ if (argc <= 1) {
+ return _wrap_new_eslEvent__SWIG_1(L);
+ }
+ {
+ _v = lua_isnumber(L,argv[1]);
+ }
+ if (_v) {
+ return _wrap_new_eslEvent__SWIG_1(L);
+ }
+ }
+ }
+ if ((argc >= 1) && (argc <= 2)) {
+ int _v;
+ {
+ _v = lua_isstring(L,argv[0]);
+ }
+ if (_v) {
+ if (argc <= 1) {
+ return _wrap_new_eslEvent__SWIG_0(L);
+ }
+ {
+ _v = lua_isstring(L,argv[1]);
+ }
+ if (_v) {
+ return _wrap_new_eslEvent__SWIG_0(L);
+ }
+ }
+ }
+
+ lua_pushstring(L,"No matching function for overloaded 'new_eslEvent'");
+ lua_error(L);return 0;
+}
+
+
+static int _wrap_delete_eslEvent(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+
+ SWIG_check_num_args("eslEvent",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("eslEvent",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,SWIG_POINTER_DISOWN))){
+ SWIG_fail_ptr("delete_eslEvent",1,SWIGTYPE_p_eslEvent);
+ }
+
+ delete arg1;
+
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_serialize(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) NULL ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("serialize",1,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialize",1,"eslEvent *");
+ if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("serialize",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_serialize",1,SWIGTYPE_p_eslEvent);
+ }
+
+ if(lua_gettop(L)>=2){
+ arg2 = (char *)lua_tostring(L, 2);
+ }
+ result = (char *)(arg1)->serialize((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushstring(L,(const char*)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_setPriority(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
+ bool result;
+ esl_priority_t *argp2 ;
+
+ SWIG_check_num_args("setPriority",1,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPriority",1,"eslEvent *");
+ if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("setPriority",2,"esl_priority_t");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_setPriority",1,SWIGTYPE_p_eslEvent);
+ }
+
+ if(lua_gettop(L)>=2){
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_esl_priority_t,0))){
+ SWIG_fail_ptr("eslEvent_setPriority",2,SWIGTYPE_p_esl_priority_t);
+ }
+ arg2 = *argp2;
+ }
+ result = (bool)(arg1)->setPriority(arg2);
+ SWIG_arg=0;
+ lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_getHeader(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("getHeader",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getHeader",1,"eslEvent *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("getHeader",2,"char *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_getHeader",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (char *)(arg1)->getHeader(arg2);
+ SWIG_arg=0;
+ lua_pushstring(L,(const char*)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_getBody(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("getBody",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getBody",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_getBody",1,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (char *)(arg1)->getBody();
+ SWIG_arg=0;
+ lua_pushstring(L,(const char*)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_getType(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("getType",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getType",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_getType",1,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (char *)(arg1)->getType();
+ SWIG_arg=0;
+ lua_pushstring(L,(const char*)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_addBody(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ bool result;
+
+ SWIG_check_num_args("addBody",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addBody",1,"eslEvent *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("addBody",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_addBody",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (bool)(arg1)->addBody((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_addHeader(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ bool result;
+
+ SWIG_check_num_args("addHeader",3,3)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addHeader",1,"eslEvent *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("addHeader",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("addHeader",3,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_addHeader",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
+ SWIG_arg=0;
+ lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_delHeader(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ bool result;
+
+ SWIG_check_num_args("delHeader",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("delHeader",1,"eslEvent *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("delHeader",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_delHeader",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (bool)(arg1)->delHeader((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static void swig_delete_eslEvent(void *obj) {
+eslEvent *arg1 = (eslEvent *) obj;
+delete arg1;
+}
+static swig_lua_method swig_eslEvent_methods[] = {
+ {"serialize", _wrap_eslEvent_serialize},
+ {"setPriority", _wrap_eslEvent_setPriority},
+ {"getHeader", _wrap_eslEvent_getHeader},
+ {"getBody", _wrap_eslEvent_getBody},
+ {"getType", _wrap_eslEvent_getType},
+ {"addBody", _wrap_eslEvent_addBody},
+ {"addHeader", _wrap_eslEvent_addHeader},
+ {"delHeader", _wrap_eslEvent_delHeader},
+ {0,0}
+};
+static swig_lua_attribute swig_eslEvent_attributes[] = {
+ { "event", _wrap_eslEvent_event_get, _wrap_eslEvent_event_set},
+ { "serialized_string", _wrap_eslEvent_serialized_string_get, _wrap_eslEvent_serialized_string_set},
+ { "mine", _wrap_eslEvent_mine_get, _wrap_eslEvent_mine_set},
+ {0,0,0}
+};
+static swig_lua_class *swig_eslEvent_bases[] = {0};
+static const char *swig_eslEvent_base_names[] = {0};
+static swig_lua_class _wrap_class_eslEvent = { "eslEvent", &SWIGTYPE_p_eslEvent,_wrap_new_eslEvent, swig_delete_eslEvent, swig_eslEvent_methods, swig_eslEvent_attributes, swig_eslEvent_bases, swig_eslEvent_base_names };
+
+static int _wrap_new_eslConnection__SWIG_0(lua_State* L) {
+ int SWIG_arg = -1;
+ char *arg1 = (char *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ eslConnection *result = 0 ;
+
+ SWIG_check_num_args("eslConnection",3,3)
+ if(!lua_isstring(L,1)) SWIG_fail_arg("eslConnection",1,"char const *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("eslConnection",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("eslConnection",3,"char const *");
+ arg1 = (char *)lua_tostring(L, 1);
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ result = (eslConnection *)new eslConnection((char const *)arg1,(char const *)arg2,(char const *)arg3);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslConnection,1); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_new_eslConnection__SWIG_1(lua_State* L) {
+ int SWIG_arg = -1;
+ int arg1 ;
+ eslConnection *result = 0 ;
+
+ SWIG_check_num_args("eslConnection",1,1)
+ if(!lua_isnumber(L,1)) SWIG_fail_arg("eslConnection",1,"int");
+ arg1 = (int)lua_tonumber(L, 1);
+ result = (eslConnection *)new eslConnection(arg1);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslConnection,1); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_new_eslConnection(lua_State* L) {
+ int argc;
+ int argv[4]={
+ 1,2,3,4
+ };
+
+ argc = lua_gettop(L);
+ if (argc == 1) {
+ int _v;
+ {
+ _v = lua_isnumber(L,argv[0]);
+ }
+ if (_v) {
+ return _wrap_new_eslConnection__SWIG_1(L);
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ {
+ _v = lua_isstring(L,argv[0]);
+ }
+ if (_v) {
+ {
+ _v = lua_isstring(L,argv[1]);
+ }
+ if (_v) {
+ {
+ _v = lua_isstring(L,argv[2]);
+ }
+ if (_v) {
+ return _wrap_new_eslConnection__SWIG_0(L);
+ }
+ }
+ }
+ }
+
+ lua_pushstring(L,"No matching function for overloaded 'new_eslConnection'");
+ lua_error(L);return 0;
+}
+
+
+static int _wrap_delete_eslConnection(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+
+ SWIG_check_num_args("eslConnection",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("eslConnection",1,"eslConnection *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,SWIG_POINTER_DISOWN))){
+ SWIG_fail_ptr("delete_eslConnection",1,SWIGTYPE_p_eslConnection);
+ }
+
+ delete arg1;
+
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_connected(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ int result;
+
+ SWIG_check_num_args("connected",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("connected",1,"eslConnection *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_connected",1,SWIGTYPE_p_eslConnection);
+ }
+
+ result = (int)(arg1)->connected();
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_getInfo(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("getInfo",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getInfo",1,"eslConnection *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_getInfo",1,SWIGTYPE_p_eslConnection);
+ }
+
+ result = (eslEvent *)(arg1)->getInfo();
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,0); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_send(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ esl_status_t result;
+
+ SWIG_check_num_args("send",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("send",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("send",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_send",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (arg1)->send((char const *)arg2);
+ SWIG_arg=0;
+ {
+ esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_sendRecv(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("sendRecv",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sendRecv",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("sendRecv",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_sendRecv",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (eslEvent *)(arg1)->sendRecv((char const *)arg2);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,0); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_sendEvent(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ eslEvent *arg2 = (eslEvent *) 0 ;
+ esl_status_t result;
+
+ SWIG_check_num_args("sendEvent",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sendEvent",1,"eslConnection *");
+ if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("sendEvent",2,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_sendEvent",1,SWIGTYPE_p_eslConnection);
+ }
+
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslConnection_sendEvent",2,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (arg1)->sendEvent(arg2);
+ SWIG_arg=0;
+ {
+ esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_recvEvent(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("recvEvent",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("recvEvent",1,"eslConnection *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_recvEvent",1,SWIGTYPE_p_eslConnection);
+ }
+
+ result = (eslEvent *)(arg1)->recvEvent();
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,0); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_recvEventTimed(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ int arg2 ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("recvEventTimed",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("recvEventTimed",1,"eslConnection *");
+ if(!lua_isnumber(L,2)) SWIG_fail_arg("recvEventTimed",2,"int");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_recvEventTimed",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (int)lua_tonumber(L, 2);
+ result = (eslEvent *)(arg1)->recvEventTimed(arg2);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,0); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_filter(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ esl_status_t result;
+
+ SWIG_check_num_args("filter",3,3)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("filter",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("filter",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("filter",3,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_filter",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ result = (arg1)->filter((char const *)arg2,(char const *)arg3);
+ SWIG_arg=0;
+ {
+ esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_events(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ esl_status_t result;
+
+ SWIG_check_num_args("events",3,3)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("events",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("events",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("events",3,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_events",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ result = (arg1)->events((char const *)arg2,(char const *)arg3);
+ SWIG_arg=0;
+ {
+ esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_execute(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) NULL ;
+ char *arg4 = (char *) NULL ;
+ esl_status_t result;
+
+ SWIG_check_num_args("execute",2,4)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *");
+ if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
+ if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("execute",4,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_execute",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ if(lua_gettop(L)>=3){
+ arg3 = (char *)lua_tostring(L, 3);
+ }
+ if(lua_gettop(L)>=4){
+ arg4 = (char *)lua_tostring(L, 4);
+ }
+ result = (arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
+ SWIG_arg=0;
+ {
+ esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_setBlockingExecute(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int result;
+
+ SWIG_check_num_args("setBlockingExecute",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setBlockingExecute",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("setBlockingExecute",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_setBlockingExecute",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (int)(arg1)->setBlockingExecute((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_setEventLock(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int result;
+
+ SWIG_check_num_args("setEventLock",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setEventLock",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("setEventLock",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_setEventLock",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (int)(arg1)->setEventLock((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static void swig_delete_eslConnection(void *obj) {
+eslConnection *arg1 = (eslConnection *) obj;
+delete arg1;
+}
+static swig_lua_method swig_eslConnection_methods[] = {
+ {"connected", _wrap_eslConnection_connected},
+ {"getInfo", _wrap_eslConnection_getInfo},
+ {"send", _wrap_eslConnection_send},
+ {"sendRecv", _wrap_eslConnection_sendRecv},
+ {"sendEvent", _wrap_eslConnection_sendEvent},
+ {"recvEvent", _wrap_eslConnection_recvEvent},
+ {"recvEventTimed", _wrap_eslConnection_recvEventTimed},
+ {"filter", _wrap_eslConnection_filter},
+ {"events", _wrap_eslConnection_events},
+ {"execute", _wrap_eslConnection_execute},
+ {"setBlockingExecute", _wrap_eslConnection_setBlockingExecute},
+ {"setEventLock", _wrap_eslConnection_setEventLock},
+ {0,0}
+};
+static swig_lua_attribute swig_eslConnection_attributes[] = {
+ {0,0,0}
+};
+static swig_lua_class *swig_eslConnection_bases[] = {0};
+static const char *swig_eslConnection_base_names[] = {0};
+static swig_lua_class _wrap_class_eslConnection = { "eslConnection", &SWIGTYPE_p_eslConnection,_wrap_new_eslConnection, swig_delete_eslConnection, swig_eslConnection_methods, swig_eslConnection_attributes, swig_eslConnection_bases, swig_eslConnection_base_names };
+
+#ifdef __cplusplus
+}
+#endif
+
+static const struct luaL_reg swig_commands[] = {
+ {0,0}
+};
+
+static swig_lua_var_info swig_variables[] = {
+ {0,0,0}
+};
+
+static swig_lua_const_info swig_constants[] = {
+ {0,0,0,0,0,0}
+};
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_eslConnection = {"_p_eslConnection", "eslConnection *", 0, 0, (void*)&_wrap_class_eslConnection, 0};
+static swig_type_info _swigt__p_eslEvent = {"_p_eslEvent", "eslEvent *", 0, 0, (void*)&_wrap_class_eslEvent, 0};
+static swig_type_info _swigt__p_esl_event_t = {"_p_esl_event_t", "esl_event_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_esl_priority_t = {"_p_esl_priority_t", "esl_priority_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_esl_status_t = {"_p_esl_status_t", "esl_status_t *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+ &_swigt__p_eslConnection,
+ &_swigt__p_eslEvent,
+ &_swigt__p_esl_event_t,
+ &_swigt__p_esl_priority_t,
+ &_swigt__p_esl_status_t,
+};
+
+static swig_cast_info _swigc__p_eslConnection[] = { {&_swigt__p_eslConnection, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_eslEvent[] = { {&_swigt__p_eslEvent, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_esl_event_t[] = { {&_swigt__p_esl_event_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_esl_priority_t[] = { {&_swigt__p_esl_priority_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_esl_status_t[] = { {&_swigt__p_esl_status_t, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+ _swigc__p_eslConnection,
+ _swigc__p_eslEvent,
+ _swigc__p_esl_event_t,
+ _swigc__p_esl_priority_t,
+ _swigc__p_esl_status_t,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded.
+ * There are three cases to handle:
+ * 1) If the cast->type has already been loaded AND the type we are adding
+ * casting info to has not been loaded (it is in this module), THEN we
+ * replace the cast->type pointer with the type pointer that has already
+ * been loaded.
+ * 2) If BOTH types (the one we are adding casting info to, and the
+ * cast->type) are loaded, THEN the cast info has already been loaded by
+ * the previous module so we just ignore it.
+ * 3) Finally, if cast->type has not already been loaded, then we add that
+ * swig_cast_info to the linked list (because the cast->type) pointer will
+ * be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+ size_t i;
+ swig_module_info *module_head, *iter;
+ int found, init;
+
+ clientdata = clientdata;
+
+ /* check to see if the circular list has been setup, if not, set it up */
+ if (swig_module.next==0) {
+ /* Initialize the swig_module */
+ swig_module.type_initial = swig_type_initial;
+ swig_module.cast_initial = swig_cast_initial;
+ swig_module.next = &swig_module;
+ init = 1;
+ } else {
+ init = 0;
+ }
+
+ /* Try and load any already created modules */
+ module_head = SWIG_GetModule(clientdata);
+ if (!module_head) {
+ /* This is the first module loaded for this interpreter */
+ /* so set the swig module into the interpreter */
+ SWIG_SetModule(clientdata, &swig_module);
+ module_head = &swig_module;
+ } else {
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+ found=0;
+ iter=module_head;
+ do {
+ if (iter==&swig_module) {
+ found=1;
+ break;
+ }
+ iter=iter->next;
+ } while (iter!= module_head);
+
+ /* if the is found in the list, then all is done and we may leave */
+ if (found) return;
+ /* otherwise we must add out module into the list */
+ swig_module.next = module_head->next;
+ module_head->next = &swig_module;
+ }
+
+ /* When multiple interpeters are used, a module could have already been initialized in
+ a different interpreter, but not yet have a pointer in this interpreter.
+ In this case, we do not want to continue adding types... everything should be
+ set up already */
+ if (init == 0) return;
+
+ /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+ for (i = 0; i < swig_module.size; ++i) {
+ swig_type_info *type = 0;
+ swig_type_info *ret;
+ swig_cast_info *cast;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+
+ /* if there is another module already loaded */
+ if (swig_module.next != &swig_module) {
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+ }
+ if (type) {
+ /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+ if (swig_module.type_initial[i]->clientdata) {
+ type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+ }
+ } else {
+ type = swig_module.type_initial[i];
+ }
+
+ /* Insert casting types */
+ cast = swig_module.cast_initial[i];
+ while (cast->type) {
+
+ /* Don't need to add information already in the list */
+ ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+ if (swig_module.next != &swig_module) {
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+ }
+ if (ret) {
+ if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+ cast->type = ret;
+ ret = 0;
+ } else {
+ /* Check for casting already in the list */
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+ if (!ocast) ret = 0;
+ }
+ }
+
+ if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+ if (type->cast) {
+ type->cast->prev = cast;
+ cast->next = type->cast;
+ }
+ type->cast = cast;
+ }
+ cast++;
+ }
+ /* Set entry in modules->types array equal to the type */
+ swig_module.types[i] = type;
+ }
+ swig_module.types[i] = 0;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+ for (i = 0; i < swig_module.size; ++i) {
+ int j = 0;
+ swig_cast_info *cast = swig_module.cast_initial[i];
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+ while (cast->type) {
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+ cast++;
+ ++j;
+ }
+ printf("---- Total casts: %d\n",j);
+ }
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types. It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+ size_t i;
+ swig_cast_info *equiv;
+ static int init_run = 0;
+
+ if (init_run) return;
+ init_run = 1;
+
+ for (i = 0; i < swig_module.size; i++) {
+ if (swig_module.types[i]->clientdata) {
+ equiv = swig_module.types[i]->cast;
+ while (equiv) {
+ if (!equiv->converter) {
+ if (equiv->type && !equiv->type->clientdata)
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+ }
+ equiv = equiv->next;
+ }
+ }
+ }
+}
+
+#ifdef __cplusplus
+#if 0
+{ /* c-mode */
+#endif
+}
+#endif
+
+
+
+/* Forward declaration of where the user's %init{} gets inserted */
+void SWIG_init_user(lua_State* L );
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* this is the initialization function
+ added at the very end of the code
+ the function is always called SWIG_init, but an eariler #define will rename it
+*/
+SWIGEXPORT int SWIG_init(lua_State* L)
+{
+ int i;
+ /* start with global table */
+ lua_pushvalue(L,LUA_GLOBALSINDEX);
+ /* SWIG's internal initalisation */
+ SWIG_InitializeModule((void*)L);
+ SWIG_PropagateClientData();
+ /* add a global fn */
+ SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
+ SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
+ /* begin the module (its a table with the same name as the module) */
+ SWIG_Lua_module_begin(L,SWIG_name);
+ /* add commands/functions */
+ for (i = 0; swig_commands[i].name; i++){
+ SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
+ }
+ /* add variables */
+ for (i = 0; swig_variables[i].name; i++){
+ SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
+ }
+ /* set up base class pointers (the hierachy) */
+ for (i = 0; swig_types[i]; i++){
+ if (swig_types[i]->clientdata){
+ SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
+ }
+ }
+ /* additional registration structs & classes in lua */
+ for (i = 0; swig_types[i]; i++){
+ if (swig_types[i]->clientdata){
+ SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
+ }
+ }
+ /* constants */
+ SWIG_Lua_InstallConstants(L,swig_constants);
+ /* invoke user-specific initialization */
+ SWIG_init_user(L);
+ /* end module */
+ lua_pop(L,1); /* tidy stack (remove module table)*/
+ lua_pop(L,1); /* tidy stack (remove global table)*/
+ return 1;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+
+const char* SWIG_LUACODE=
+ "";
+
+void SWIG_init_user(lua_State* L)
+{
+ /* exec Lua code if applicable */
+ SWIG_Lua_dostring(L,SWIG_LUACODE);
+}
+
1
0
Author: anthm
Date: Tue Feb 17 10:12:03 2009
New Revision: 12093
Log:
sync
Modified:
freeswitch/trunk/libs/esl/Makefile
Modified: freeswitch/trunk/libs/esl/Makefile
==============================================================================
--- freeswitch/trunk/libs/esl/Makefile (original)
+++ freeswitch/trunk/libs/esl/Makefile Tue Feb 17 10:12:03 2009
@@ -43,18 +43,21 @@
make -C php clean
make -C lua clean
make -C python clean
+ make -C ruby clean
reswig: swigclean
make -C perl reswig
make -C php reswig
make -C lua reswig
make -C python reswig
+ make -C ruby reswig
swigclean: clean
make -C perl swigclean
make -C php swigclean
make -C lua swigclean
make -C python swigclean
+ make -C ruby swigclean
perlmod: $(MYLIB)
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl
@@ -68,5 +71,8 @@
pymod: $(MYLIB)
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C python
+rubymod: $(MYLIB)
+ make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C ruby
+
1
0
Author: anthm
Date: Tue Feb 17 10:06:02 2009
New Revision: 12092
Log:
add python to esl
Modified:
freeswitch/trunk/libs/esl/Makefile
Modified: freeswitch/trunk/libs/esl/Makefile
==============================================================================
--- freeswitch/trunk/libs/esl/Makefile (original)
+++ freeswitch/trunk/libs/esl/Makefile Tue Feb 17 10:06:02 2009
@@ -42,14 +42,19 @@
make -C perl clean
make -C php clean
make -C lua clean
+ make -C python clean
reswig: swigclean
make -C perl reswig
make -C php reswig
+ make -C lua reswig
+ make -C python reswig
+
swigclean: clean
make -C perl swigclean
make -C php swigclean
make -C lua swigclean
+ make -C python swigclean
perlmod: $(MYLIB)
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl
@@ -60,4 +65,8 @@
luamod: $(MYLIB)
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C lua
+pymod: $(MYLIB)
+ make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C python
+
+
1
0
Author: anthm
Date: Tue Feb 17 10:02:26 2009
New Revision: 12091
Log:
add lua to esl
Added:
freeswitch/trunk/libs/esl/lua/
freeswitch/trunk/libs/esl/lua/Makefile
freeswitch/trunk/libs/esl/lua/esl_wrap.cpp
Modified:
freeswitch/trunk/libs/esl/Makefile
Modified: freeswitch/trunk/libs/esl/Makefile
==============================================================================
--- freeswitch/trunk/libs/esl/Makefile (original)
+++ freeswitch/trunk/libs/esl/Makefile Tue Feb 17 10:02:26 2009
@@ -41,6 +41,7 @@
rm -f *.o src/*.o testclient testserver fs_cli libesl.a *~ src/*~ src/include/*~
make -C perl clean
make -C php clean
+ make -C lua clean
reswig: swigclean
make -C perl reswig
@@ -48,6 +49,7 @@
swigclean: clean
make -C perl swigclean
make -C php swigclean
+ make -C lua swigclean
perlmod: $(MYLIB)
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl
@@ -55,4 +57,7 @@
phpmod: $(MYLIB)
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C php
+luamod: $(MYLIB)
+ make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C lua
+
Added: freeswitch/trunk/libs/esl/lua/Makefile
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/lua/Makefile Tue Feb 17 10:02:26 2009
@@ -0,0 +1,22 @@
+LOCAL_CFLAGS=
+LOCAL_LDFLAGS=-llua
+
+all: ESL.so
+
+esl_wrap.cpp:
+ swig -module ESL -lua -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
+
+esl_wrap.o: esl_wrap.cpp
+ $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o
+
+ESL.so: esl_wrap.o
+ $(CXX) $(SOLINK) esl_wrap.o $(MYLIB) $(LOCAL_LDFLAGS) -o ESL.so -L. $(LIBS)
+
+clean:
+ rm -f *.o *.so *~
+
+swigclean:
+ rm -f esl_wrap.* ESL.so
+
+reswig: swigclean esl_wrap.cpp
+
Added: freeswitch/trunk/libs/esl/lua/esl_wrap.cpp
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/lua/esl_wrap.cpp Tue Feb 17 10:02:26 2009
@@ -0,0 +1,2930 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org)
+ * Version 1.3.35
+ *
+ * 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.
+ * ----------------------------------------------------------------------------- */
+
+
+#ifdef __cplusplus
+template<typename T> class SwigValueWrapper {
+ T *tt;
+public:
+ SwigValueWrapper() : tt(0) { }
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
+ SwigValueWrapper(const T& t) : tt(new T(t)) { }
+ ~SwigValueWrapper() { delete tt; }
+ SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
+ operator T&() const { return *tt; }
+ T *operator&() { return tt; }
+private:
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+};
+
+template <typename T> T SwigValueInit() {
+ return T();
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * 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 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
+
+
+/* -----------------------------------------------------------------------------
+ * 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>) {
+ if (<need new object>) {
+ *ptr = <ptr to new allocated object>;
+ return SWIG_NEWOBJ;
+ } else {
+ *ptr = <ptr to old object>;
+ return SWIG_OLDOBJ;
+ }
+ } else {
+ return SWIG_BADOBJ;
+ }
+ }
+
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+ swig errors code.
+
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+ allows to return the 'cast rank', for example, if you have this
+
+ int food(double)
+ int fooi(int);
+
+ and you call
+
+ food(1) // cast rank '1' (1 -> 1.0)
+ fooi(1) // cast rank '0'
+
+ just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK (0)
+#define SWIG_ERROR (-1)
+#define SWIG_IsOK(r) (r >= 0)
+#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ (SWIG_ERROR)
+#define SWIG_OLDOBJ (SWIG_OK)
+#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+# ifndef SWIG_TypeRank
+# define SWIG_TypeRank unsigned long
+# endif
+# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
+# define SWIG_MAXCASTRANK (2)
+# endif
+# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
+# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) {
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) {
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
+}
+#else /* no cast-rank mode */
+# define SWIG_AddCast
+# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *, int *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store information on one type */
+typedef struct swig_type_info {
+ const char *name; /* mangled name of this type */
+ const char *str; /* human readable name of this type */
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
+ void *clientdata; /* language specific type data */
+ int owndata; /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
+ swig_converter_func converter; /* function to cast the void pointers */
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
+ struct swig_cast_info *prev; /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
+ size_t size; /* Number of types in this module */
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
+ swig_type_info **type_initial; /* Array of initially generated type structures */
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
+ void *clientdata; /* Language specific module data */
+} swig_module_info;
+
+/*
+ Compare two type names skipping the space characters, therefore
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+ Return 0 when the two name types are equivalent, as in
+ strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+ const char *f2, const char *l2) {
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+ }
+ return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+ Check type equivalence in a name list like <name1>|<name2>|...
+ Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') break;
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) ++ne;
+ }
+ return equiv;
+}
+
+/*
+ Check type equivalence in a name list like <name1>|<name2>|...
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') break;
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) ++ne;
+ }
+ return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty) \
+ if (ty) { \
+ swig_cast_info *iter = ty->cast; \
+ while (iter) { \
+ if (comparison) { \
+ if (iter == ty->cast) return iter; \
+ /* Move iter to the top of the linked list */ \
+ iter->prev->next = iter->next; \
+ if (iter->next) \
+ iter->next->prev = iter->prev; \
+ iter->next = ty->cast; \
+ iter->prev = 0; \
+ if (ty->cast) ty->cast->prev = iter; \
+ ty->cast = iter; \
+ return iter; \
+ } \
+ iter = iter->next; \
+ } \
+ } \
+ return 0
+
+/*
+ Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+ SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+ SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+ Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+}
+
+/*
+ Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+ swig_type_info *lastty = ty;
+ if (!ty || !ty->dcast) return ty;
+ while (ty && (ty->dcast)) {
+ ty = (*ty->dcast)(ptr);
+ if (ty) lastty = ty;
+ }
+ return lastty;
+}
+
+/*
+ Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+ return ty->name;
+}
+
+/*
+ Return the pretty name associated with this type,
+ that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+ /* The "str" field contains the equivalent pretty names of the
+ type, separated by vertical-bar characters. We choose
+ to print the last name, as it is often (?) the most
+ specific. */
+ if (!type) return NULL;
+ if (type->str != NULL) {
+ const char *last_name = type->str;
+ const char *s;
+ for (s = type->str; *s; s++)
+ if (*s == '|') last_name = s+1;
+ return last_name;
+ }
+ else
+ return type->name;
+}
+
+/*
+ Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+ swig_cast_info *cast = ti->cast;
+ /* if (ti->clientdata == clientdata) return; */
+ ti->clientdata = clientdata;
+
+ while (cast) {
+ if (!cast->converter) {
+ swig_type_info *tc = cast->type;
+ if (!tc->clientdata) {
+ SWIG_TypeClientData(tc, clientdata);
+ }
+ }
+ cast = cast->next;
+ }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+ SWIG_TypeClientData(ti, clientdata);
+ ti->owndata = 1;
+}
+
+/*
+ Search for a swig_type_info structure only by mangled name
+ Search is a O(log #types)
+
+ We start searching at module start, and finish searching when start == end.
+ Note: if start == end at the beginning of the function, we go all the way around
+ the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name) {
+ swig_module_info *iter = start;
+ do {
+ if (iter->size) {
+ register size_t l = 0;
+ register size_t r = iter->size - 1;
+ do {
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+ register size_t i = (l + r) >> 1;
+ const char *iname = iter->types[i]->name;
+ if (iname) {
+ register int compare = strcmp(name, iname);
+ if (compare == 0) {
+ return iter->types[i];
+ } else if (compare < 0) {
+ if (i) {
+ r = i - 1;
+ } else {
+ break;
+ }
+ } else if (compare > 0) {
+ l = i + 1;
+ }
+ } else {
+ break; /* should never happen */
+ }
+ } while (l <= r);
+ }
+ iter = iter->next;
+ } while (iter != end);
+ return 0;
+}
+
+/*
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
+ It first searches the mangled names of the types, which is a O(log #types)
+ If a type is not found it then searches the human readable names, which is O(#types).
+
+ We start searching at module start, and finish searching when start == end.
+ Note: if start == end at the beginning of the function, we go all the way around
+ the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name) {
+ /* STEP 1: Search the name field using binary search */
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+ if (ret) {
+ return ret;
+ } else {
+ /* STEP 2: If the type hasn't been found, do a complete search
+ of the str field (the human readable name) */
+ swig_module_info *iter = start;
+ do {
+ register size_t i = 0;
+ for (; i < iter->size; ++i) {
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+ return iter->types[i];
+ }
+ iter = iter->next;
+ } while (iter != end);
+ }
+
+ /* neither found a match */
+ return 0;
+}
+
+/*
+ Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+ static const char hex[17] = "0123456789abcdef";
+ register const unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register unsigned char uu = *u;
+ *(c++) = hex[(uu & 0xf0) >> 4];
+ *(c++) = hex[uu & 0xf];
+ }
+ return c;
+}
+
+/*
+ Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+ register unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register char d = *(c++);
+ register unsigned char uu;
+ if ((d >= '0') && (d <= '9'))
+ uu = ((d - '0') << 4);
+ else if ((d >= 'a') && (d <= 'f'))
+ uu = ((d - ('a'-10)) << 4);
+ else
+ return (char *) 0;
+ d = *(c++);
+ if ((d >= '0') && (d <= '9'))
+ uu |= (d - '0');
+ else if ((d >= 'a') && (d <= 'f'))
+ uu |= (d - ('a'-10));
+ else
+ return (char *) 0;
+ *u = uu;
+ }
+ return c;
+}
+
+/*
+ Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+ char *r = buff;
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
+ *(r++) = '_';
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+ strcpy(r,name);
+ return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ *ptr = (void *) 0;
+ return name;
+ } else {
+ return 0;
+ }
+ }
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+ char *r = buff;
+ size_t lname = (name ? strlen(name) : 0);
+ if ((2*sz + 2 + lname) > bsz) return 0;
+ *(r++) = '_';
+ r = SWIG_PackData(r,ptr,sz);
+ if (lname) {
+ strncpy(r,name,lname+1);
+ } else {
+ *r = 0;
+ }
+ return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ memset(ptr,0,sz);
+ return name;
+ } else {
+ return 0;
+ }
+ }
+ return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * luarun.swg
+ *
+ * This file contains the runtime support for Lua modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "lua.h"
+#include "lauxlib.h"
+#include <stdlib.h> /* for malloc */
+#include <assert.h> /* for a few sanity tests */
+
+/* -----------------------------------------------------------------------------
+ * global swig types
+ * ----------------------------------------------------------------------------- */
+/* Constant table */
+#define SWIG_LUA_INT 1
+#define SWIG_LUA_FLOAT 2
+#define SWIG_LUA_STRING 3
+#define SWIG_LUA_POINTER 4
+#define SWIG_LUA_BINARY 5
+#define SWIG_LUA_CHAR 6
+
+/* Structure for variable linking table */
+typedef struct {
+ const char *name;
+ lua_CFunction get;
+ lua_CFunction set;
+} swig_lua_var_info;
+
+/* Constant information structure */
+typedef struct {
+ int type;
+ char *name;
+ long lvalue;
+ double dvalue;
+ void *pvalue;
+ swig_type_info **ptype;
+} swig_lua_const_info;
+
+typedef struct {
+ const char *name;
+ lua_CFunction method;
+} swig_lua_method;
+
+typedef struct {
+ const char *name;
+ lua_CFunction getmethod;
+ lua_CFunction setmethod;
+} swig_lua_attribute;
+
+typedef struct swig_lua_class {
+ const char *name;
+ swig_type_info **type;
+ lua_CFunction constructor;
+ void (*destructor)(void *);
+ swig_lua_method *methods;
+ swig_lua_attribute *attributes;
+ struct swig_lua_class **bases;
+ const char **base_names;
+} swig_lua_class;
+
+/* this is the struct for wrappering all pointers in SwigLua
+*/
+typedef struct {
+ swig_type_info *type;
+ int own; /* 1 if owned & must be destroyed */
+ void *ptr;
+} swig_lua_userdata;
+
+/* this is the struct for wrapping arbitary packed binary data
+(currently it is only used for member function pointers)
+the data ordering is similar to swig_lua_userdata, but it is currently not possible
+to tell the two structures apart within Swig, other than by looking at the type
+*/
+typedef struct {
+ swig_type_info *type;
+ int own; /* 1 if owned & must be destroyed */
+ char data[1]; /* arbitary amount of data */
+} swig_lua_rawdata;
+
+/* Common SWIG API */
+#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
+#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
+#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
+#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
+
+/* Runtime API */
+#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
+#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
+#define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
+
+/* Contract support */
+#define SWIG_contract_assert(expr, msg) \
+ if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else
+
+/* helper #defines */
+#define SWIG_fail {goto fail;}
+#define SWIG_fail_arg(func_name,argnum,type) \
+ {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
+ func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
+ goto fail;}
+#define SWIG_fail_ptr(func_name,argnum,type) \
+ SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
+#define SWIG_check_num_args(func_name,a,b) \
+ if (lua_gettop(L)<a || lua_gettop(L)>b) \
+ {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
+ goto fail;}
+
+
+#define SWIG_Lua_get_table(L,n) \
+ (lua_pushstring(L, n), lua_rawget(L,-2))
+
+#define SWIG_Lua_add_function(L,n,f) \
+ (lua_pushstring(L, n), \
+ lua_pushcfunction(L, f), \
+ lua_rawset(L,-3))
+
+/* special helper for allowing 'nil' for usertypes */
+#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
+
+#ifdef __cplusplus
+/* Special helper for member function pointers
+it gets the address, casts it, then dereferences it */
+//#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a)))
+#endif
+
+/* storing/access of swig_module_info */
+SWIGRUNTIME swig_module_info *
+SWIG_Lua_GetModule(lua_State* L) {
+ swig_module_info *ret = 0;
+ lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
+ lua_rawget(L,LUA_REGISTRYINDEX);
+ if (lua_islightuserdata(L,-1))
+ ret=(swig_module_info*)lua_touserdata(L,-1);
+ lua_pop(L,1); /* tidy */
+ return ret;
+}
+
+SWIGRUNTIME void
+SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
+ /* add this all into the Lua registry: */
+ lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
+ lua_pushlightuserdata(L,(void*)module);
+ lua_rawset(L,LUA_REGISTRYINDEX);
+}
+
+/* -----------------------------------------------------------------------------
+ * global variable support code: modules
+ * ----------------------------------------------------------------------------- */
+
+/* this function is called when trying to set an immutable.
+default value is to print an error.
+This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
+SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
+{
+/* there should be 1 param passed in: the new value */
+#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
+ lua_pop(L,1); /* remove it */
+ lua_pushstring(L,"This variable is immutable");
+ lua_error(L);
+#endif
+ return 0; /* should not return anything */
+}
+
+/* the module.get method used for getting linked data */
+SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
+{
+/* there should be 2 params passed in
+ (1) table (not the meta table)
+ (2) string name of the attribute
+ printf("SWIG_Lua_module_get %p(%s) '%s'\n",
+ lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
+ lua_tostring(L,2));
+*/
+ /* get the metatable */
+ assert(lua_istable(L,1)); /* just in case */
+ lua_getmetatable(L,1); /* get the metatable */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_get_table(L,".get"); /* get the .get table */
+ lua_remove(L,3); /* remove metatable */
+ if (lua_istable(L,-1))
+ {
+ /* look for the key in the .get table */
+ lua_pushvalue(L,2); /* key */
+ lua_rawget(L,-2);
+ lua_remove(L,3); /* remove .get */
+ if (lua_iscfunction(L,-1))
+ { /* found it so call the fn & return its value */
+ lua_call(L,0,1);
+ return 1;
+ }
+ lua_pop(L,1); /* remove the top */
+ }
+ lua_pop(L,1); /* remove the .get */
+ lua_pushnil(L); /* return a nil */
+ return 1;
+}
+
+/* the module.set method used for setting linked data */
+SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
+{
+/* there should be 3 params passed in
+ (1) table (not the meta table)
+ (2) string name of the attribute
+ (3) any for the new value
+*/
+ /* get the metatable */
+ assert(lua_istable(L,1)); /* just in case */
+ lua_getmetatable(L,1); /* get the metatable */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_get_table(L,".set"); /* get the .set table */
+ lua_remove(L,4); /* remove metatable */
+ if (lua_istable(L,-1))
+ {
+ /* look for the key in the .set table */
+ lua_pushvalue(L,2); /* key */
+ lua_rawget(L,-2);
+ lua_remove(L,4); /* remove .set */
+ if (lua_iscfunction(L,-1))
+ { /* found it so call the fn & return its value */
+ lua_pushvalue(L,3); /* value */
+ lua_call(L,1,0);
+ return 0;
+ }
+ }
+ lua_settop(L,3); /* reset back to start */
+ /* we now have the table, key & new value, so just set directly */
+ lua_rawset(L,1); /* add direct */
+ return 0;
+}
+
+/* registering a module in lua */
+SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name)
+{
+ assert(lua_istable(L,-1)); /* just in case */
+ lua_pushstring(L,name);
+ lua_newtable(L); /* the table */
+ /* add meta table */
+ lua_newtable(L); /* the meta table */
+ SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
+ SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
+ lua_pushstring(L,".get");
+ lua_newtable(L); /* the .get table */
+ lua_rawset(L,-3); /* add .get into metatable */
+ lua_pushstring(L,".set");
+ lua_newtable(L); /* the .set table */
+ lua_rawset(L,-3); /* add .set into metatable */
+ lua_setmetatable(L,-2); /* sets meta table in module */
+ lua_rawset(L,-3); /* add module into parent */
+ SWIG_Lua_get_table(L,name); /* get the table back out */
+}
+
+/* ending the register */
+SWIGINTERN void SWIG_Lua_module_end(lua_State* L)
+{
+ lua_pop(L,1); /* tidy stack (remove module) */
+}
+
+/* adding a linked variable to the module */
+SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
+{
+ assert(lua_istable(L,-1)); /* just in case */
+ lua_getmetatable(L,-1); /* get the metatable */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_get_table(L,".get"); /* find the .get table */
+ assert(lua_istable(L,-1)); /* should be a table: */
+ SWIG_Lua_add_function(L,name,getFn);
+ lua_pop(L,1); /* tidy stack (remove table) */
+ if (setFn) /* if there is a set fn */
+ {
+ SWIG_Lua_get_table(L,".set"); /* find the .set table */
+ assert(lua_istable(L,-1)); /* should be a table: */
+ SWIG_Lua_add_function(L,name,setFn);
+ lua_pop(L,1); /* tidy stack (remove table) */
+ }
+ lua_pop(L,1); /* tidy stack (remove meta) */
+}
+
+/* adding a function module */
+SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
+{
+ SWIG_Lua_add_function(L,name,fn);
+}
+
+/* -----------------------------------------------------------------------------
+ * global variable support code: classes
+ * ----------------------------------------------------------------------------- */
+
+/* the class.get method, performs the lookup of class attributes */
+SWIGINTERN int SWIG_Lua_class_get(lua_State* L)
+{
+/* there should be 2 params passed in
+ (1) userdata (not the meta table)
+ (2) string name of the attribute
+*/
+ assert(lua_isuserdata(L,-2)); /* just in case */
+ lua_getmetatable(L,-2); /* get the meta table */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_get_table(L,".get"); /* find the .get table */
+ assert(lua_istable(L,-1)); /* just in case */
+ /* look for the key in the .get table */
+ lua_pushvalue(L,2); /* key */
+ lua_rawget(L,-2);
+ lua_remove(L,-2); /* stack tidy, remove .get table */
+ if (lua_iscfunction(L,-1))
+ { /* found it so call the fn & return its value */
+ lua_pushvalue(L,1); /* the userdata */
+ lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */
+ lua_remove(L,-2); /* stack tidy, remove metatable */
+ return 1;
+ }
+ lua_pop(L,1); /* remove whatever was there */
+ /* ok, so try the .fn table */
+ SWIG_Lua_get_table(L,".fn"); /* find the .get table */
+ assert(lua_istable(L,-1)); /* just in case */
+ lua_pushvalue(L,2); /* key */
+ lua_rawget(L,-2); /* look for the fn */
+ lua_remove(L,-2); /* stack tidy, remove .fn table */
+ if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
+ { /* found it so return the fn & let lua call it */
+ lua_remove(L,-2); /* stack tidy, remove metatable */
+ return 1;
+ }
+ lua_pop(L,1); /* remove whatever was there */
+ /* NEW: looks for the __getitem() fn
+ this is a user provided get fn */
+ SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
+ if (lua_iscfunction(L,-1)) /* if its there */
+ { /* found it so call the fn & return its value */
+ lua_pushvalue(L,1); /* the userdata */
+ lua_pushvalue(L,2); /* the parameter */
+ lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */
+ lua_remove(L,-2); /* stack tidy, remove metatable */
+ return 1;
+ }
+ return 0; /* sorry not known */
+}
+
+/* the class.set method, performs the lookup of class attributes */
+SWIGINTERN int SWIG_Lua_class_set(lua_State* L)
+{
+/* there should be 3 params passed in
+ (1) table (not the meta table)
+ (2) string name of the attribute
+ (3) any for the new value
+printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n",
+ lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
+ lua_tostring(L,2),
+ lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/
+
+ assert(lua_isuserdata(L,1)); /* just in case */
+ lua_getmetatable(L,1); /* get the meta table */
+ assert(lua_istable(L,-1)); /* just in case */
+
+ SWIG_Lua_get_table(L,".set"); /* find the .set table */
+ if (lua_istable(L,-1))
+ {
+ /* look for the key in the .set table */
+ lua_pushvalue(L,2); /* key */
+ lua_rawget(L,-2);
+ if (lua_iscfunction(L,-1))
+ { /* found it so call the fn & return its value */
+ lua_pushvalue(L,1); /* userdata */
+ lua_pushvalue(L,3); /* value */
+ lua_call(L,2,0);
+ return 0;
+ }
+ lua_pop(L,1); /* remove the value */
+ }
+ lua_pop(L,1); /* remove the value .set table */
+ /* NEW: looks for the __setitem() fn
+ this is a user provided set fn */
+ SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
+ if (lua_iscfunction(L,-1)) /* if its there */
+ { /* found it so call the fn & return its value */
+ lua_pushvalue(L,1); /* the userdata */
+ lua_pushvalue(L,2); /* the parameter */
+ lua_pushvalue(L,3); /* the value */
+ lua_call(L,3,0); /* 3 values in ,0 out */
+ lua_remove(L,-2); /* stack tidy, remove metatable */
+ return 1;
+ }
+ return 0;
+}
+
+/* the class.destruct method called by the interpreter */
+SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L)
+{
+/* there should be 1 params passed in
+ (1) userdata (not the meta table) */
+ swig_lua_userdata* usr;
+ swig_lua_class* clss;
+ assert(lua_isuserdata(L,-1)); /* just in case */
+ usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
+ /* if must be destroyed & has a destructor */
+ if (usr->own) /* if must be destroyed */
+ {
+ clss=(swig_lua_class*)usr->type->clientdata; /* get the class */
+ if (clss && clss->destructor) /* there is a destroy fn */
+ {
+ clss->destructor(usr->ptr); /* bye bye */
+ }
+ }
+ return 0;
+}
+
+/* gets the swig class registry (or creates it) */
+SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L)
+{
+ /* add this all into the swig registry: */
+ lua_pushstring(L,"SWIG");
+ lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */
+ if (!lua_istable(L,-1)) /* not there */
+ { /* must be first time, so add it */
+ lua_pop(L,1); /* remove the result */
+ lua_pushstring(L,"SWIG");
+ lua_newtable(L);
+ lua_rawset(L,LUA_REGISTRYINDEX);
+ /* then get it */
+ lua_pushstring(L,"SWIG");
+ lua_rawget(L,LUA_REGISTRYINDEX);
+ }
+}
+
+/* helper fn to get the classes metatable from the register */
+SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname)
+{
+ SWIG_Lua_get_class_registry(L); /* get the registry */
+ lua_pushstring(L,cname); /* get the name */
+ lua_rawget(L,-2); /* get it */
+ lua_remove(L,-2); /* tidy up (remove registry) */
+}
+
+/* helper add a variable to a registered class */
+SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
+{
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_get_table(L,".get"); /* find the .get table */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_add_function(L,name,getFn);
+ lua_pop(L,1); /* tidy stack (remove table) */
+ if (setFn)
+ {
+ SWIG_Lua_get_table(L,".set"); /* find the .set table */
+ assert(lua_istable(L,-1)); /* just in case */
+ SWIG_Lua_add_function(L,name,setFn);
+ lua_pop(L,1); /* tidy stack (remove table) */
+ }
+}
+
+/* helper to recursively add class details (attributes & operations) */
+SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
+{
+ int i;
+ /* call all the base classes first: we can then override these later: */
+ for(i=0;clss->bases[i];i++)
+ {
+ SWIG_Lua_add_class_details(L,clss->bases[i]);
+ }
+ /* add fns */
+ for(i=0;clss->attributes[i].name;i++){
+ SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
+ }
+ /* add methods to the metatable */
+ SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
+ assert(lua_istable(L,-1)); /* just in case */
+ for(i=0;clss->methods[i].name;i++){
+ SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
+ }
+ lua_pop(L,1); /* tidy stack (remove table) */
+ /* add operator overloads
+ these look ANY method which start with "__" and assume they
+ are operator overloads & add them to the metatable
+ (this might mess up is someone defines a method __gc (the destructor)*/
+ for(i=0;clss->methods[i].name;i++){
+ if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
+ SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
+ }
+ }
+}
+
+/* set up the base classes pointers.
+Each class structure has a list of pointers to the base class structures.
+This function fills them.
+It cannot be done at compile time, as this will not work with hireachies
+spread over more than one swig file.
+Therefore it must be done at runtime, querying the SWIG type system.
+*/
+SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
+{
+ int i=0;
+ swig_module_info* module=SWIG_GetModule(L);
+ for(i=0;clss->base_names[i];i++)
+ {
+ if (clss->bases[i]==0) /* not found yet */
+ {
+ /* lookup and cache the base class */
+ swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
+ if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
+ }
+ }
+}
+
+/* performs the entire class registration process */
+SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
+{
+ /* add its constructor to module with the name of the class
+ so you can do MyClass(...) as well as new_MyClass(...)
+ BUT only if a constructor is defined
+ (this overcomes the problem of pure virtual classes without constructors)*/
+ if (clss->constructor)
+ SWIG_Lua_add_function(L,clss->name,clss->constructor);
+
+ SWIG_Lua_get_class_registry(L); /* get the registry */
+ lua_pushstring(L,clss->name); /* get the name */
+ lua_newtable(L); /* create the metatable */
+ /* add string of class name called ".type" */
+ lua_pushstring(L,".type");
+ lua_pushstring(L,clss->name);
+ lua_rawset(L,-3);
+ /* add a table called ".get" */
+ lua_pushstring(L,".get");
+ lua_newtable(L);
+ lua_rawset(L,-3);
+ /* add a table called ".set" */
+ lua_pushstring(L,".set");
+ lua_newtable(L);
+ lua_rawset(L,-3);
+ /* add a table called ".fn" */
+ lua_pushstring(L,".fn");
+ lua_newtable(L);
+ lua_rawset(L,-3);
+ /* add accessor fns for using the .get,.set&.fn */
+ SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
+ SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
+ SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
+ /* add it */
+ lua_rawset(L,-3); /* metatable into registry */
+ lua_pop(L,1); /* tidy stack (remove registry) */
+
+ SWIG_Lua_get_class_metatable(L,clss->name);
+ SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */
+ lua_pop(L,1); /* tidy stack (remove class metatable) */
+}
+
+/* -----------------------------------------------------------------------------
+ * Class/structure conversion fns
+ * ----------------------------------------------------------------------------- */
+
+/* helper to add metatable to new lua object */
+SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type)
+{
+ if (type->clientdata) /* there is clientdata: so add the metatable */
+ {
+ SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
+ if (lua_istable(L,-1))
+ {
+ lua_setmetatable(L,-2);
+ }
+ else
+ {
+ lua_pop(L,1);
+ }
+ }
+}
+
+/* pushes a new object into the lua stack */
+SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own)
+{
+ swig_lua_userdata* usr;
+ if (!ptr){
+ lua_pushnil(L);
+ return;
+ }
+ usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */
+ usr->ptr=ptr; /* set the ptr */
+ usr->type=type;
+ usr->own=own;
+ _SWIG_Lua_AddMetatable(L,type); /* add metatable */
+}
+
+/* takes a object from the lua stack & converts it into an object of the correct type
+ (if possible) */
+SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags)
+{
+ swig_lua_userdata* usr;
+ swig_cast_info *cast;
+ if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */
+ usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */
+ if (usr)
+ {
+ if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
+ {
+ usr->own=0;
+ }
+ if (!type) /* special cast void*, no casting fn */
+ {
+ *ptr=usr->ptr;
+ return SWIG_OK; /* ok */
+ }
+ cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
+ if (cast)
+ {
+ int newmemory = 0;
+ *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
+ assert(!newmemory); /* newmemory handling not yet implemented */
+ return SWIG_OK; /* ok */
+ }
+ }
+ return SWIG_ERROR; /* error */
+}
+
+SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags,
+ int argnum,const char* func_name){
+ void* result;
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
+ lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n",
+ func_name,(type && type->str)?type->str:"void*",argnum);
+ lua_error(L);
+ }
+ return result;
+}
+
+/* pushes a packed userdata. user for member fn pointers only */
+SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
+{
+ swig_lua_rawdata* raw;
+ assert(ptr); /* not acceptable to pass in a NULL value */
+ raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */
+ raw->type=type;
+ raw->own=0;
+ memcpy(raw->data,ptr,size); /* copy the data */
+ _SWIG_Lua_AddMetatable(L,type); /* add metatable */
+}
+
+/* converts a packed userdata. user for member fn pointers only */
+SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
+{
+ swig_lua_rawdata* raw;
+ raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */
+ if (!raw) return SWIG_ERROR; /* error */
+ if (type==0 || type==raw->type) /* void* or identical type */
+ {
+ memcpy(ptr,raw->data,size); /* copy it */
+ return SWIG_OK; /* ok */
+ }
+ return SWIG_ERROR; /* error */
+}
+
+/* a function to get the typestring of a piece of data */
+SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
+{
+ swig_lua_userdata* usr;
+ if (lua_isuserdata(L,tp))
+ {
+ usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
+ if (usr && usr->type && usr->type->str)
+ return usr->type->str;
+ return "userdata (unknown type)";
+ }
+ return lua_typename(L,lua_type(L,tp));
+}
+
+/* lua callable function to get the userdata's type */
+SWIGRUNTIME int SWIG_Lua_type(lua_State* L)
+{
+ lua_pushstring(L,SWIG_Lua_typename(L,1));
+ return 1;
+}
+
+/* lua callable function to compare userdata's value
+the issue is that two userdata may point to the same thing
+but to lua, they are different objects */
+SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
+{
+ int result;
+ swig_lua_userdata *usr1,*usr2;
+ if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */
+ return 0; /* nil reply */
+ usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
+ usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */
+ /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
+ result=(usr1->ptr==usr2->ptr);
+ lua_pushboolean(L,result);
+ return 1;
+}
+
+/* -----------------------------------------------------------------------------
+ * global variable support code: class/struct typemap functions
+ * ----------------------------------------------------------------------------- */
+
+/* Install Constants */
+SWIGINTERN void
+SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
+ int i;
+ for (i = 0; constants[i].type; i++) {
+ switch(constants[i].type) {
+ case SWIG_LUA_INT:
+ lua_pushstring(L,constants[i].name);
+ lua_pushnumber(L,(lua_Number)constants[i].lvalue);
+ lua_rawset(L,-3);
+ break;
+ case SWIG_LUA_FLOAT:
+ lua_pushstring(L,constants[i].name);
+ lua_pushnumber(L,(lua_Number)constants[i].dvalue);
+ lua_rawset(L,-3);
+ break;
+ case SWIG_LUA_CHAR:
+ lua_pushstring(L,constants[i].name);
+ lua_pushfstring(L,"%c",(char)constants[i].lvalue);
+ lua_rawset(L,-3);
+ break;
+ case SWIG_LUA_STRING:
+ lua_pushstring(L,constants[i].name);
+ lua_pushstring(L,(char *) constants[i].pvalue);
+ lua_rawset(L,-3);
+ break;
+ case SWIG_LUA_POINTER:
+ lua_pushstring(L,constants[i].name);
+ SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
+ lua_rawset(L,-3);
+ break;
+ case SWIG_LUA_BINARY:
+ lua_pushstring(L,constants[i].name);
+ SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
+ lua_rawset(L,-3);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+/* -----------------------------------------------------------------------------
+ * executing lua code from within the wrapper
+ * ----------------------------------------------------------------------------- */
+
+#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
+#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
+#endif
+/* Executes a C string in Lua a really simple way of calling lua from C
+Unfortunately lua keeps changing its API's, so we need a conditional compile
+In lua 5.0.X its lua_dostring()
+In lua 5.1.X its luaL_dostring()
+*/
+SWIGINTERN int
+SWIG_Lua_dostring(lua_State *L, const char* str) {
+ int ok,top;
+ if (str==0 || str[0]==0) return 0; /* nothing to do */
+ top=lua_gettop(L); /* save stack */
+#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
+ ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */
+#else
+ ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */
+#endif
+ if (ok!=0) {
+ SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
+ }
+ lua_settop(L,top); /* restore the stack */
+ return ok;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* ------------------------------ end luarun.swg ------------------------------ */
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_eslConnection swig_types[0]
+#define SWIGTYPE_p_eslEvent swig_types[1]
+#define SWIGTYPE_p_esl_event_t swig_types[2]
+#define SWIGTYPE_p_esl_priority_t swig_types[3]
+#define SWIGTYPE_p_esl_status_t swig_types[4]
+static swig_type_info *swig_types[6];
+static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_name "ESL"
+#define SWIG_init luaopen_ESL
+#define SWIG_init_user luaopen_ESL_user
+
+#define SWIG_LUACODE luaopen_ESL_luacode
+
+
+namespace swig {
+typedef struct{} LANGUAGE_OBJ;
+}
+
+
+#include "esl.h"
+#include "esl_oop.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+static int _wrap_eslEvent_event_set(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ esl_event_t *arg2 = (esl_event_t *) 0 ;
+
+ SWIG_check_num_args("event",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"eslEvent *");
+ if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("event",2,"esl_event_t *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_event_set",1,SWIGTYPE_p_eslEvent);
+ }
+
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_esl_event_t,SWIG_POINTER_DISOWN))){
+ SWIG_fail_ptr("eslEvent_event_set",2,SWIGTYPE_p_esl_event_t);
+ }
+
+ if (arg1) (arg1)->event = arg2;
+
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_event_get(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ esl_event_t *result = 0 ;
+
+ SWIG_check_num_args("event",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_event_get",1,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (esl_event_t *) ((arg1)->event);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_esl_event_t,0); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_serialized_string_set(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ SWIG_check_num_args("serialized_string",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"eslEvent *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("serialized_string",2,"char *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_serialized_string_set",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ {
+ if (arg1->serialized_string) delete [] arg1->serialized_string;
+ if (arg2) {
+ arg1->serialized_string = (char *) (new char[strlen((const char *)arg2)+1]);
+ strcpy((char *)arg1->serialized_string, (const char *)arg2);
+ } else {
+ arg1->serialized_string = 0;
+ }
+ }
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_serialized_string_get(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("serialized_string",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_serialized_string_get",1,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (char *) ((arg1)->serialized_string);
+ SWIG_arg=0;
+ lua_pushstring(L,(const char*)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_mine_set(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ int arg2 ;
+
+ SWIG_check_num_args("mine",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"eslEvent *");
+ if(!lua_isnumber(L,2)) SWIG_fail_arg("mine",2,"int");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_mine_set",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (int)lua_tonumber(L, 2);
+ if (arg1) (arg1)->mine = arg2;
+
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_mine_get(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ int result;
+
+ SWIG_check_num_args("mine",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_mine_get",1,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (int) ((arg1)->mine);
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_new_eslEvent__SWIG_0(lua_State* L) {
+ int SWIG_arg = -1;
+ char *arg1 = (char *) 0 ;
+ char *arg2 = (char *) NULL ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("eslEvent",1,2)
+ if(!lua_isstring(L,1)) SWIG_fail_arg("eslEvent",1,"char const *");
+ if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("eslEvent",2,"char const *");
+ arg1 = (char *)lua_tostring(L, 1);
+ if(lua_gettop(L)>=2){
+ arg2 = (char *)lua_tostring(L, 2);
+ }
+ result = (eslEvent *)new eslEvent((char const *)arg1,(char const *)arg2);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,1); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_new_eslEvent__SWIG_1(lua_State* L) {
+ int SWIG_arg = -1;
+ esl_event_t *arg1 = (esl_event_t *) 0 ;
+ int arg2 = (int) 0 ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("eslEvent",1,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("eslEvent",1,"esl_event_t *");
+ if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("eslEvent",2,"int");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_esl_event_t,0))){
+ SWIG_fail_ptr("new_eslEvent",1,SWIGTYPE_p_esl_event_t);
+ }
+
+ if(lua_gettop(L)>=2){
+ arg2 = (int)lua_tonumber(L, 2);
+ }
+ result = (eslEvent *)new eslEvent(arg1,arg2);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,1); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_new_eslEvent(lua_State* L) {
+ int argc;
+ int argv[3]={
+ 1,2,3
+ };
+
+ argc = lua_gettop(L);
+ if ((argc >= 1) && (argc <= 2)) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_esl_event_t, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ if (argc <= 1) {
+ return _wrap_new_eslEvent__SWIG_1(L);
+ }
+ {
+ _v = lua_isnumber(L,argv[1]);
+ }
+ if (_v) {
+ return _wrap_new_eslEvent__SWIG_1(L);
+ }
+ }
+ }
+ if ((argc >= 1) && (argc <= 2)) {
+ int _v;
+ {
+ _v = lua_isstring(L,argv[0]);
+ }
+ if (_v) {
+ if (argc <= 1) {
+ return _wrap_new_eslEvent__SWIG_0(L);
+ }
+ {
+ _v = lua_isstring(L,argv[1]);
+ }
+ if (_v) {
+ return _wrap_new_eslEvent__SWIG_0(L);
+ }
+ }
+ }
+
+ lua_pushstring(L,"No matching function for overloaded 'new_eslEvent'");
+ lua_error(L);return 0;
+}
+
+
+static int _wrap_delete_eslEvent(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+
+ SWIG_check_num_args("eslEvent",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("eslEvent",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,SWIG_POINTER_DISOWN))){
+ SWIG_fail_ptr("delete_eslEvent",1,SWIGTYPE_p_eslEvent);
+ }
+
+ delete arg1;
+
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_serialize(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) NULL ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("serialize",1,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialize",1,"eslEvent *");
+ if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("serialize",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_serialize",1,SWIGTYPE_p_eslEvent);
+ }
+
+ if(lua_gettop(L)>=2){
+ arg2 = (char *)lua_tostring(L, 2);
+ }
+ result = (char *)(arg1)->serialize((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushstring(L,(const char*)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_setPriority(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
+ bool result;
+ esl_priority_t *argp2 ;
+
+ SWIG_check_num_args("setPriority",1,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPriority",1,"eslEvent *");
+ if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("setPriority",2,"esl_priority_t");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_setPriority",1,SWIGTYPE_p_eslEvent);
+ }
+
+ if(lua_gettop(L)>=2){
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_esl_priority_t,0))){
+ SWIG_fail_ptr("eslEvent_setPriority",2,SWIGTYPE_p_esl_priority_t);
+ }
+ arg2 = *argp2;
+ }
+ result = (bool)(arg1)->setPriority(arg2);
+ SWIG_arg=0;
+ lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_getHeader(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("getHeader",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getHeader",1,"eslEvent *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("getHeader",2,"char *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_getHeader",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (char *)(arg1)->getHeader(arg2);
+ SWIG_arg=0;
+ lua_pushstring(L,(const char*)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_getBody(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("getBody",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getBody",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_getBody",1,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (char *)(arg1)->getBody();
+ SWIG_arg=0;
+ lua_pushstring(L,(const char*)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_getType(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("getType",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getType",1,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_getType",1,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (char *)(arg1)->getType();
+ SWIG_arg=0;
+ lua_pushstring(L,(const char*)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_addBody(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ bool result;
+
+ SWIG_check_num_args("addBody",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addBody",1,"eslEvent *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("addBody",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_addBody",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (bool)(arg1)->addBody((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_addHeader(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ bool result;
+
+ SWIG_check_num_args("addHeader",3,3)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addHeader",1,"eslEvent *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("addHeader",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("addHeader",3,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_addHeader",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
+ SWIG_arg=0;
+ lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslEvent_delHeader(lua_State* L) {
+ int SWIG_arg = -1;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ bool result;
+
+ SWIG_check_num_args("delHeader",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("delHeader",1,"eslEvent *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("delHeader",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslEvent_delHeader",1,SWIGTYPE_p_eslEvent);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (bool)(arg1)->delHeader((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static void swig_delete_eslEvent(void *obj) {
+eslEvent *arg1 = (eslEvent *) obj;
+delete arg1;
+}
+static swig_lua_method swig_eslEvent_methods[] = {
+ {"serialize", _wrap_eslEvent_serialize},
+ {"setPriority", _wrap_eslEvent_setPriority},
+ {"getHeader", _wrap_eslEvent_getHeader},
+ {"getBody", _wrap_eslEvent_getBody},
+ {"getType", _wrap_eslEvent_getType},
+ {"addBody", _wrap_eslEvent_addBody},
+ {"addHeader", _wrap_eslEvent_addHeader},
+ {"delHeader", _wrap_eslEvent_delHeader},
+ {0,0}
+};
+static swig_lua_attribute swig_eslEvent_attributes[] = {
+ { "event", _wrap_eslEvent_event_get, _wrap_eslEvent_event_set},
+ { "serialized_string", _wrap_eslEvent_serialized_string_get, _wrap_eslEvent_serialized_string_set},
+ { "mine", _wrap_eslEvent_mine_get, _wrap_eslEvent_mine_set},
+ {0,0,0}
+};
+static swig_lua_class *swig_eslEvent_bases[] = {0};
+static const char *swig_eslEvent_base_names[] = {0};
+static swig_lua_class _wrap_class_eslEvent = { "eslEvent", &SWIGTYPE_p_eslEvent,_wrap_new_eslEvent, swig_delete_eslEvent, swig_eslEvent_methods, swig_eslEvent_attributes, swig_eslEvent_bases, swig_eslEvent_base_names };
+
+static int _wrap_new_eslConnection__SWIG_0(lua_State* L) {
+ int SWIG_arg = -1;
+ char *arg1 = (char *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ eslConnection *result = 0 ;
+
+ SWIG_check_num_args("eslConnection",3,3)
+ if(!lua_isstring(L,1)) SWIG_fail_arg("eslConnection",1,"char const *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("eslConnection",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("eslConnection",3,"char const *");
+ arg1 = (char *)lua_tostring(L, 1);
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ result = (eslConnection *)new eslConnection((char const *)arg1,(char const *)arg2,(char const *)arg3);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslConnection,1); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_new_eslConnection__SWIG_1(lua_State* L) {
+ int SWIG_arg = -1;
+ int arg1 ;
+ eslConnection *result = 0 ;
+
+ SWIG_check_num_args("eslConnection",1,1)
+ if(!lua_isnumber(L,1)) SWIG_fail_arg("eslConnection",1,"int");
+ arg1 = (int)lua_tonumber(L, 1);
+ result = (eslConnection *)new eslConnection(arg1);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslConnection,1); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_new_eslConnection(lua_State* L) {
+ int argc;
+ int argv[4]={
+ 1,2,3,4
+ };
+
+ argc = lua_gettop(L);
+ if (argc == 1) {
+ int _v;
+ {
+ _v = lua_isnumber(L,argv[0]);
+ }
+ if (_v) {
+ return _wrap_new_eslConnection__SWIG_1(L);
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ {
+ _v = lua_isstring(L,argv[0]);
+ }
+ if (_v) {
+ {
+ _v = lua_isstring(L,argv[1]);
+ }
+ if (_v) {
+ {
+ _v = lua_isstring(L,argv[2]);
+ }
+ if (_v) {
+ return _wrap_new_eslConnection__SWIG_0(L);
+ }
+ }
+ }
+ }
+
+ lua_pushstring(L,"No matching function for overloaded 'new_eslConnection'");
+ lua_error(L);return 0;
+}
+
+
+static int _wrap_delete_eslConnection(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+
+ SWIG_check_num_args("eslConnection",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("eslConnection",1,"eslConnection *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,SWIG_POINTER_DISOWN))){
+ SWIG_fail_ptr("delete_eslConnection",1,SWIGTYPE_p_eslConnection);
+ }
+
+ delete arg1;
+
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_connected(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ int result;
+
+ SWIG_check_num_args("connected",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("connected",1,"eslConnection *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_connected",1,SWIGTYPE_p_eslConnection);
+ }
+
+ result = (int)(arg1)->connected();
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_getInfo(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("getInfo",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getInfo",1,"eslConnection *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_getInfo",1,SWIGTYPE_p_eslConnection);
+ }
+
+ result = (eslEvent *)(arg1)->getInfo();
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,0); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_send(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ esl_status_t result;
+
+ SWIG_check_num_args("send",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("send",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("send",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_send",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (arg1)->send((char const *)arg2);
+ SWIG_arg=0;
+ {
+ esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_sendRecv(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("sendRecv",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sendRecv",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("sendRecv",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_sendRecv",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (eslEvent *)(arg1)->sendRecv((char const *)arg2);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,0); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_sendEvent(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ eslEvent *arg2 = (eslEvent *) 0 ;
+ esl_status_t result;
+
+ SWIG_check_num_args("sendEvent",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sendEvent",1,"eslConnection *");
+ if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("sendEvent",2,"eslEvent *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_sendEvent",1,SWIGTYPE_p_eslConnection);
+ }
+
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_eslEvent,0))){
+ SWIG_fail_ptr("eslConnection_sendEvent",2,SWIGTYPE_p_eslEvent);
+ }
+
+ result = (arg1)->sendEvent(arg2);
+ SWIG_arg=0;
+ {
+ esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_recvEvent(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("recvEvent",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("recvEvent",1,"eslConnection *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_recvEvent",1,SWIGTYPE_p_eslConnection);
+ }
+
+ result = (eslEvent *)(arg1)->recvEvent();
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,0); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_recvEventTimed(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ int arg2 ;
+ eslEvent *result = 0 ;
+
+ SWIG_check_num_args("recvEventTimed",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("recvEventTimed",1,"eslConnection *");
+ if(!lua_isnumber(L,2)) SWIG_fail_arg("recvEventTimed",2,"int");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_recvEventTimed",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (int)lua_tonumber(L, 2);
+ result = (eslEvent *)(arg1)->recvEventTimed(arg2);
+ SWIG_arg=0;
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_eslEvent,0); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_filter(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ esl_status_t result;
+
+ SWIG_check_num_args("filter",3,3)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("filter",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("filter",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("filter",3,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_filter",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ result = (arg1)->filter((char const *)arg2,(char const *)arg3);
+ SWIG_arg=0;
+ {
+ esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_events(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ esl_status_t result;
+
+ SWIG_check_num_args("events",3,3)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("events",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("events",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("events",3,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_events",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ result = (arg1)->events((char const *)arg2,(char const *)arg3);
+ SWIG_arg=0;
+ {
+ esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_execute(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) NULL ;
+ char *arg4 = (char *) NULL ;
+ esl_status_t result;
+
+ SWIG_check_num_args("execute",2,4)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *");
+ if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *");
+ if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("execute",4,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_execute",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ if(lua_gettop(L)>=3){
+ arg3 = (char *)lua_tostring(L, 3);
+ }
+ if(lua_gettop(L)>=4){
+ arg4 = (char *)lua_tostring(L, 4);
+ }
+ result = (arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
+ SWIG_arg=0;
+ {
+ esl_status_t * resultptr = new esl_status_t((esl_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_esl_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_setBlockingExecute(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int result;
+
+ SWIG_check_num_args("setBlockingExecute",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setBlockingExecute",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("setBlockingExecute",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_setBlockingExecute",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (int)(arg1)->setBlockingExecute((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_eslConnection_setEventLock(lua_State* L) {
+ int SWIG_arg = -1;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int result;
+
+ SWIG_check_num_args("setEventLock",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setEventLock",1,"eslConnection *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("setEventLock",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_eslConnection,0))){
+ SWIG_fail_ptr("eslConnection_setEventLock",1,SWIGTYPE_p_eslConnection);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (int)(arg1)->setEventLock((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static void swig_delete_eslConnection(void *obj) {
+eslConnection *arg1 = (eslConnection *) obj;
+delete arg1;
+}
+static swig_lua_method swig_eslConnection_methods[] = {
+ {"connected", _wrap_eslConnection_connected},
+ {"getInfo", _wrap_eslConnection_getInfo},
+ {"send", _wrap_eslConnection_send},
+ {"sendRecv", _wrap_eslConnection_sendRecv},
+ {"sendEvent", _wrap_eslConnection_sendEvent},
+ {"recvEvent", _wrap_eslConnection_recvEvent},
+ {"recvEventTimed", _wrap_eslConnection_recvEventTimed},
+ {"filter", _wrap_eslConnection_filter},
+ {"events", _wrap_eslConnection_events},
+ {"execute", _wrap_eslConnection_execute},
+ {"setBlockingExecute", _wrap_eslConnection_setBlockingExecute},
+ {"setEventLock", _wrap_eslConnection_setEventLock},
+ {0,0}
+};
+static swig_lua_attribute swig_eslConnection_attributes[] = {
+ {0,0,0}
+};
+static swig_lua_class *swig_eslConnection_bases[] = {0};
+static const char *swig_eslConnection_base_names[] = {0};
+static swig_lua_class _wrap_class_eslConnection = { "eslConnection", &SWIGTYPE_p_eslConnection,_wrap_new_eslConnection, swig_delete_eslConnection, swig_eslConnection_methods, swig_eslConnection_attributes, swig_eslConnection_bases, swig_eslConnection_base_names };
+
+#ifdef __cplusplus
+}
+#endif
+
+static const struct luaL_reg swig_commands[] = {
+ {0,0}
+};
+
+static swig_lua_var_info swig_variables[] = {
+ {0,0,0}
+};
+
+static swig_lua_const_info swig_constants[] = {
+ {0,0,0,0,0,0}
+};
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_eslConnection = {"_p_eslConnection", "eslConnection *", 0, 0, (void*)&_wrap_class_eslConnection, 0};
+static swig_type_info _swigt__p_eslEvent = {"_p_eslEvent", "eslEvent *", 0, 0, (void*)&_wrap_class_eslEvent, 0};
+static swig_type_info _swigt__p_esl_event_t = {"_p_esl_event_t", "esl_event_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_esl_priority_t = {"_p_esl_priority_t", "esl_priority_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_esl_status_t = {"_p_esl_status_t", "esl_status_t *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+ &_swigt__p_eslConnection,
+ &_swigt__p_eslEvent,
+ &_swigt__p_esl_event_t,
+ &_swigt__p_esl_priority_t,
+ &_swigt__p_esl_status_t,
+};
+
+static swig_cast_info _swigc__p_eslConnection[] = { {&_swigt__p_eslConnection, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_eslEvent[] = { {&_swigt__p_eslEvent, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_esl_event_t[] = { {&_swigt__p_esl_event_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_esl_priority_t[] = { {&_swigt__p_esl_priority_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_esl_status_t[] = { {&_swigt__p_esl_status_t, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+ _swigc__p_eslConnection,
+ _swigc__p_eslEvent,
+ _swigc__p_esl_event_t,
+ _swigc__p_esl_priority_t,
+ _swigc__p_esl_status_t,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded.
+ * There are three cases to handle:
+ * 1) If the cast->type has already been loaded AND the type we are adding
+ * casting info to has not been loaded (it is in this module), THEN we
+ * replace the cast->type pointer with the type pointer that has already
+ * been loaded.
+ * 2) If BOTH types (the one we are adding casting info to, and the
+ * cast->type) are loaded, THEN the cast info has already been loaded by
+ * the previous module so we just ignore it.
+ * 3) Finally, if cast->type has not already been loaded, then we add that
+ * swig_cast_info to the linked list (because the cast->type) pointer will
+ * be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+ size_t i;
+ swig_module_info *module_head, *iter;
+ int found, init;
+
+ clientdata = clientdata;
+
+ /* check to see if the circular list has been setup, if not, set it up */
+ if (swig_module.next==0) {
+ /* Initialize the swig_module */
+ swig_module.type_initial = swig_type_initial;
+ swig_module.cast_initial = swig_cast_initial;
+ swig_module.next = &swig_module;
+ init = 1;
+ } else {
+ init = 0;
+ }
+
+ /* Try and load any already created modules */
+ module_head = SWIG_GetModule(clientdata);
+ if (!module_head) {
+ /* This is the first module loaded for this interpreter */
+ /* so set the swig module into the interpreter */
+ SWIG_SetModule(clientdata, &swig_module);
+ module_head = &swig_module;
+ } else {
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+ found=0;
+ iter=module_head;
+ do {
+ if (iter==&swig_module) {
+ found=1;
+ break;
+ }
+ iter=iter->next;
+ } while (iter!= module_head);
+
+ /* if the is found in the list, then all is done and we may leave */
+ if (found) return;
+ /* otherwise we must add out module into the list */
+ swig_module.next = module_head->next;
+ module_head->next = &swig_module;
+ }
+
+ /* When multiple interpeters are used, a module could have already been initialized in
+ a different interpreter, but not yet have a pointer in this interpreter.
+ In this case, we do not want to continue adding types... everything should be
+ set up already */
+ if (init == 0) return;
+
+ /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+ for (i = 0; i < swig_module.size; ++i) {
+ swig_type_info *type = 0;
+ swig_type_info *ret;
+ swig_cast_info *cast;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+
+ /* if there is another module already loaded */
+ if (swig_module.next != &swig_module) {
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+ }
+ if (type) {
+ /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+ if (swig_module.type_initial[i]->clientdata) {
+ type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+ }
+ } else {
+ type = swig_module.type_initial[i];
+ }
+
+ /* Insert casting types */
+ cast = swig_module.cast_initial[i];
+ while (cast->type) {
+
+ /* Don't need to add information already in the list */
+ ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+ if (swig_module.next != &swig_module) {
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+ }
+ if (ret) {
+ if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+ cast->type = ret;
+ ret = 0;
+ } else {
+ /* Check for casting already in the list */
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+ if (!ocast) ret = 0;
+ }
+ }
+
+ if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+ if (type->cast) {
+ type->cast->prev = cast;
+ cast->next = type->cast;
+ }
+ type->cast = cast;
+ }
+ cast++;
+ }
+ /* Set entry in modules->types array equal to the type */
+ swig_module.types[i] = type;
+ }
+ swig_module.types[i] = 0;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+ for (i = 0; i < swig_module.size; ++i) {
+ int j = 0;
+ swig_cast_info *cast = swig_module.cast_initial[i];
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+ while (cast->type) {
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+ cast++;
+ ++j;
+ }
+ printf("---- Total casts: %d\n",j);
+ }
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types. It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+ size_t i;
+ swig_cast_info *equiv;
+ static int init_run = 0;
+
+ if (init_run) return;
+ init_run = 1;
+
+ for (i = 0; i < swig_module.size; i++) {
+ if (swig_module.types[i]->clientdata) {
+ equiv = swig_module.types[i]->cast;
+ while (equiv) {
+ if (!equiv->converter) {
+ if (equiv->type && !equiv->type->clientdata)
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+ }
+ equiv = equiv->next;
+ }
+ }
+ }
+}
+
+#ifdef __cplusplus
+#if 0
+{ /* c-mode */
+#endif
+}
+#endif
+
+
+
+/* Forward declaration of where the user's %init{} gets inserted */
+void SWIG_init_user(lua_State* L );
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* this is the initialization function
+ added at the very end of the code
+ the function is always called SWIG_init, but an eariler #define will rename it
+*/
+SWIGEXPORT int SWIG_init(lua_State* L)
+{
+ int i;
+ /* start with global table */
+ lua_pushvalue(L,LUA_GLOBALSINDEX);
+ /* SWIG's internal initalisation */
+ SWIG_InitializeModule((void*)L);
+ SWIG_PropagateClientData();
+ /* add a global fn */
+ SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
+ SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
+ /* begin the module (its a table with the same name as the module) */
+ SWIG_Lua_module_begin(L,SWIG_name);
+ /* add commands/functions */
+ for (i = 0; swig_commands[i].name; i++){
+ SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
+ }
+ /* add variables */
+ for (i = 0; swig_variables[i].name; i++){
+ SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
+ }
+ /* set up base class pointers (the hierachy) */
+ for (i = 0; swig_types[i]; i++){
+ if (swig_types[i]->clientdata){
+ SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
+ }
+ }
+ /* additional registration structs & classes in lua */
+ for (i = 0; swig_types[i]; i++){
+ if (swig_types[i]->clientdata){
+ SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
+ }
+ }
+ /* constants */
+ SWIG_Lua_InstallConstants(L,swig_constants);
+ /* invoke user-specific initialization */
+ SWIG_init_user(L);
+ /* end module */
+ lua_pop(L,1); /* tidy stack (remove module table)*/
+ lua_pop(L,1); /* tidy stack (remove global table)*/
+ return 1;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+
+const char* SWIG_LUACODE=
+ "";
+
+void SWIG_init_user(lua_State* L)
+{
+ /* exec Lua code if applicable */
+ SWIG_Lua_dostring(L,SWIG_LUACODE);
+}
+
1
0
Author: anthm
Date: Tue Feb 17 09:54:36 2009
New Revision: 12090
Log:
add php swig for esl
Added:
freeswitch/trunk/libs/esl/php/
freeswitch/trunk/libs/esl/php/ESL.php
freeswitch/trunk/libs/esl/php/Makefile
freeswitch/trunk/libs/esl/php/esl_wrap.cpp
freeswitch/trunk/libs/esl/php/php_ESL.h
Modified:
freeswitch/trunk/libs/esl/Makefile
Modified: freeswitch/trunk/libs/esl/Makefile
==============================================================================
--- freeswitch/trunk/libs/esl/Makefile (original)
+++ freeswitch/trunk/libs/esl/Makefile Tue Feb 17 09:54:36 2009
@@ -40,14 +40,19 @@
clean:
rm -f *.o src/*.o testclient testserver fs_cli libesl.a *~ src/*~ src/include/*~
make -C perl clean
+ make -C php clean
reswig: swigclean
make -C perl reswig
-
+ make -C php reswig
swigclean: clean
make -C perl swigclean
+ make -C php swigclean
perlmod: $(MYLIB)
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl
+phpmod: $(MYLIB)
+ make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C php
+
Added: freeswitch/trunk/libs/esl/php/ESL.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/php/ESL.php Tue Feb 17 09:54:36 2009
@@ -0,0 +1,169 @@
+<?php
+
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org)
+ * Version 1.3.35
+ *
+ * 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.
+ * ----------------------------------------------------------------------------- */
+
+// Try to load our extension if it's not already loaded.
+if (!extension_loaded("ESL")) {
+ if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
+ if (!dl('php_ESL.dll')) return;
+ } else {
+ // PHP_SHLIB_SUFFIX is available as of PHP 4.3.0, for older PHP assume 'so'.
+ // It gives 'dylib' on MacOS X which is for libraries, modules are 'so'.
+ if (PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') {
+ if (!dl('ESL.so')) return;
+ } else {
+ if (!dl('ESL.'.PHP_SHLIB_SUFFIX)) return;
+ }
+ }
+}
+
+
+
+/* PHP Proxy Classes */
+class eslEvent {
+ public $_cPtr=null;
+
+ function __set($var,$value) {
+ $func = 'eslEvent_'.$var.'_set';
+ if (function_exists($func)) call_user_func($func,$this->_cPtr,$value);
+ }
+
+ function __isset($var) {
+ return function_exists('eslEvent_'.$var.'_set');
+ }
+
+ function __get($var) {
+ $func = 'eslEvent_'.$var.'_get';
+ if (function_exists($func)) return call_user_func($func,$this->_cPtr);
+ return null;
+ }
+
+ function __construct($type_or_wrap_me,$subclass_name_or_free_me=null) {
+ switch (func_num_args()) {
+ case 1: $r=new_eslEvent($type_or_wrap_me); break;
+ default: $r=new_eslEvent($type_or_wrap_me,$subclass_name_or_free_me);
+ }
+ $this->_cPtr=$r;
+ }
+
+ function serialize($format=null) {
+ switch (func_num_args()) {
+ case 0: $r=eslEvent_serialize($this->_cPtr); break;
+ default: $r=eslEvent_serialize($this->_cPtr,$format);
+ }
+ return $r;
+ }
+
+ function setPriority($priority=null) {
+ switch (func_num_args()) {
+ case 0: $r=eslEvent_setPriority($this->_cPtr); break;
+ default: $r=eslEvent_setPriority($this->_cPtr,$priority);
+ }
+ return $r;
+ }
+
+ function getHeader($header_name) {
+ return eslEvent_getHeader($this->_cPtr,$header_name);
+ }
+
+ function getBody() {
+ return eslEvent_getBody($this->_cPtr);
+ }
+
+ function getType() {
+ return eslEvent_getType($this->_cPtr);
+ }
+
+ function addBody($value) {
+ return eslEvent_addBody($this->_cPtr,$value);
+ }
+
+ function addHeader($header_name,$value) {
+ return eslEvent_addHeader($this->_cPtr,$header_name,$value);
+ }
+
+ function delHeader($header_name) {
+ return eslEvent_delHeader($this->_cPtr,$header_name);
+ }
+}
+
+class eslConnection {
+ public $_cPtr=null;
+
+ function __construct($host_or_socket,$port=null,$password=null) {
+ switch (func_num_args()) {
+ case 1: $r=new_eslConnection($host_or_socket); break;
+ case 2: $r=new_eslConnection($host_or_socket,$port); break;
+ default: $r=new_eslConnection($host_or_socket,$port,$password);
+ }
+ $this->_cPtr=$r;
+ }
+
+ function connected() {
+ return eslConnection_connected($this->_cPtr);
+ }
+
+ function getInfo() {
+ $r=eslConnection_getInfo($this->_cPtr);
+ return is_resource($r) ? new eslEvent($r) : $r;
+ }
+
+ function send($cmd) {
+ return eslConnection_send($this->_cPtr,$cmd);
+ }
+
+ function sendRecv($cmd) {
+ $r=eslConnection_sendRecv($this->_cPtr,$cmd);
+ return is_resource($r) ? new eslEvent($r) : $r;
+ }
+
+ function sendEvent($send_me) {
+ return eslConnection_sendEvent($this->_cPtr,$send_me);
+ }
+
+ function recvEvent() {
+ $r=eslConnection_recvEvent($this->_cPtr);
+ return is_resource($r) ? new eslEvent($r) : $r;
+ }
+
+ function recvEventTimed($ms) {
+ $r=eslConnection_recvEventTimed($this->_cPtr,$ms);
+ return is_resource($r) ? new eslEvent($r) : $r;
+ }
+
+ function filter($header,$value) {
+ return eslConnection_filter($this->_cPtr,$header,$value);
+ }
+
+ function events($etype,$value) {
+ return eslConnection_events($this->_cPtr,$etype,$value);
+ }
+
+ function execute($app,$arg=null,$uuid=null) {
+ switch (func_num_args()) {
+ case 1: $r=eslConnection_execute($this->_cPtr,$app); break;
+ case 2: $r=eslConnection_execute($this->_cPtr,$app,$arg); break;
+ default: $r=eslConnection_execute($this->_cPtr,$app,$arg,$uuid);
+ }
+ return $r;
+ }
+
+ function setBlockingExecute($val) {
+ return eslConnection_setBlockingExecute($this->_cPtr,$val);
+ }
+
+ function setEventLock($val) {
+ return eslConnection_setEventLock($this->_cPtr,$val);
+ }
+}
+
+
+?>
Added: freeswitch/trunk/libs/esl/php/Makefile
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/php/Makefile Tue Feb 17 09:54:36 2009
@@ -0,0 +1,22 @@
+LOCAL_CFLAGS=$(shell php-config --includes)
+LOCAL_LDFLAGS=$(shell php-config --ldflags --libs)
+
+all: ESL.so
+
+esl_wrap.cpp:
+ swig -module ESL -php5 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
+
+esl_wrap.o: esl_wrap.cpp
+ $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o
+
+ESL.so: esl_wrap.o
+ $(CXX) $(SOLINK) esl_wrap.o $(MYLIB) $(LOCAL_LDFLAGS) -o ESL.so -L. $(LIBS)
+
+clean:
+ rm -f *.o *.so *~
+
+swigclean:
+ rm -f esl_wrap.* ESL.so php_ESL.*
+
+reswig: swigclean esl_wrap.cpp
+
Added: freeswitch/trunk/libs/esl/php/esl_wrap.cpp
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/php/esl_wrap.cpp Tue Feb 17 09:54:36 2009
@@ -0,0 +1,2525 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org)
+ * Version 1.3.35
+ *
+ * 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.
+ * ----------------------------------------------------------------------------- */
+
+
+#ifdef __cplusplus
+template<typename T> class SwigValueWrapper {
+ T *tt;
+public:
+ SwigValueWrapper() : tt(0) { }
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
+ SwigValueWrapper(const T& t) : tt(new T(t)) { }
+ ~SwigValueWrapper() { delete tt; }
+ SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
+ operator T&() const { return *tt; }
+ T *operator&() { return tt; }
+private:
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+};
+
+template <typename T> T SwigValueInit() {
+ return T();
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * 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 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
+
+
+/* -----------------------------------------------------------------------------
+ * 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>) {
+ if (<need new object>) {
+ *ptr = <ptr to new allocated object>;
+ return SWIG_NEWOBJ;
+ } else {
+ *ptr = <ptr to old object>;
+ return SWIG_OLDOBJ;
+ }
+ } else {
+ return SWIG_BADOBJ;
+ }
+ }
+
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+ swig errors code.
+
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+ allows to return the 'cast rank', for example, if you have this
+
+ int food(double)
+ int fooi(int);
+
+ and you call
+
+ food(1) // cast rank '1' (1 -> 1.0)
+ fooi(1) // cast rank '0'
+
+ just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK (0)
+#define SWIG_ERROR (-1)
+#define SWIG_IsOK(r) (r >= 0)
+#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ (SWIG_ERROR)
+#define SWIG_OLDOBJ (SWIG_OK)
+#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+# ifndef SWIG_TypeRank
+# define SWIG_TypeRank unsigned long
+# endif
+# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
+# define SWIG_MAXCASTRANK (2)
+# endif
+# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
+# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) {
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) {
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
+}
+#else /* no cast-rank mode */
+# define SWIG_AddCast
+# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *, int *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store information on one type */
+typedef struct swig_type_info {
+ const char *name; /* mangled name of this type */
+ const char *str; /* human readable name of this type */
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
+ void *clientdata; /* language specific type data */
+ int owndata; /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
+ swig_converter_func converter; /* function to cast the void pointers */
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
+ struct swig_cast_info *prev; /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
+ size_t size; /* Number of types in this module */
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
+ swig_type_info **type_initial; /* Array of initially generated type structures */
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
+ void *clientdata; /* Language specific module data */
+} swig_module_info;
+
+/*
+ Compare two type names skipping the space characters, therefore
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+ Return 0 when the two name types are equivalent, as in
+ strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+ const char *f2, const char *l2) {
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+ }
+ return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+ Check type equivalence in a name list like <name1>|<name2>|...
+ Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') break;
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) ++ne;
+ }
+ return equiv;
+}
+
+/*
+ Check type equivalence in a name list like <name1>|<name2>|...
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') break;
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) ++ne;
+ }
+ return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty) \
+ if (ty) { \
+ swig_cast_info *iter = ty->cast; \
+ while (iter) { \
+ if (comparison) { \
+ if (iter == ty->cast) return iter; \
+ /* Move iter to the top of the linked list */ \
+ iter->prev->next = iter->next; \
+ if (iter->next) \
+ iter->next->prev = iter->prev; \
+ iter->next = ty->cast; \
+ iter->prev = 0; \
+ if (ty->cast) ty->cast->prev = iter; \
+ ty->cast = iter; \
+ return iter; \
+ } \
+ iter = iter->next; \
+ } \
+ } \
+ return 0
+
+/*
+ Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+ SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+ SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+ Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+}
+
+/*
+ Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+ swig_type_info *lastty = ty;
+ if (!ty || !ty->dcast) return ty;
+ while (ty && (ty->dcast)) {
+ ty = (*ty->dcast)(ptr);
+ if (ty) lastty = ty;
+ }
+ return lastty;
+}
+
+/*
+ Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+ return ty->name;
+}
+
+/*
+ Return the pretty name associated with this type,
+ that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+ /* The "str" field contains the equivalent pretty names of the
+ type, separated by vertical-bar characters. We choose
+ to print the last name, as it is often (?) the most
+ specific. */
+ if (!type) return NULL;
+ if (type->str != NULL) {
+ const char *last_name = type->str;
+ const char *s;
+ for (s = type->str; *s; s++)
+ if (*s == '|') last_name = s+1;
+ return last_name;
+ }
+ else
+ return type->name;
+}
+
+/*
+ Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+ swig_cast_info *cast = ti->cast;
+ /* if (ti->clientdata == clientdata) return; */
+ ti->clientdata = clientdata;
+
+ while (cast) {
+ if (!cast->converter) {
+ swig_type_info *tc = cast->type;
+ if (!tc->clientdata) {
+ SWIG_TypeClientData(tc, clientdata);
+ }
+ }
+ cast = cast->next;
+ }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+ SWIG_TypeClientData(ti, clientdata);
+ ti->owndata = 1;
+}
+
+/*
+ Search for a swig_type_info structure only by mangled name
+ Search is a O(log #types)
+
+ We start searching at module start, and finish searching when start == end.
+ Note: if start == end at the beginning of the function, we go all the way around
+ the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name) {
+ swig_module_info *iter = start;
+ do {
+ if (iter->size) {
+ register size_t l = 0;
+ register size_t r = iter->size - 1;
+ do {
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+ register size_t i = (l + r) >> 1;
+ const char *iname = iter->types[i]->name;
+ if (iname) {
+ register int compare = strcmp(name, iname);
+ if (compare == 0) {
+ return iter->types[i];
+ } else if (compare < 0) {
+ if (i) {
+ r = i - 1;
+ } else {
+ break;
+ }
+ } else if (compare > 0) {
+ l = i + 1;
+ }
+ } else {
+ break; /* should never happen */
+ }
+ } while (l <= r);
+ }
+ iter = iter->next;
+ } while (iter != end);
+ return 0;
+}
+
+/*
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
+ It first searches the mangled names of the types, which is a O(log #types)
+ If a type is not found it then searches the human readable names, which is O(#types).
+
+ We start searching at module start, and finish searching when start == end.
+ Note: if start == end at the beginning of the function, we go all the way around
+ the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name) {
+ /* STEP 1: Search the name field using binary search */
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+ if (ret) {
+ return ret;
+ } else {
+ /* STEP 2: If the type hasn't been found, do a complete search
+ of the str field (the human readable name) */
+ swig_module_info *iter = start;
+ do {
+ register size_t i = 0;
+ for (; i < iter->size; ++i) {
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+ return iter->types[i];
+ }
+ iter = iter->next;
+ } while (iter != end);
+ }
+
+ /* neither found a match */
+ return 0;
+}
+
+/*
+ Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+ static const char hex[17] = "0123456789abcdef";
+ register const unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register unsigned char uu = *u;
+ *(c++) = hex[(uu & 0xf0) >> 4];
+ *(c++) = hex[uu & 0xf];
+ }
+ return c;
+}
+
+/*
+ Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+ register unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register char d = *(c++);
+ register unsigned char uu;
+ if ((d >= '0') && (d <= '9'))
+ uu = ((d - '0') << 4);
+ else if ((d >= 'a') && (d <= 'f'))
+ uu = ((d - ('a'-10)) << 4);
+ else
+ return (char *) 0;
+ d = *(c++);
+ if ((d >= '0') && (d <= '9'))
+ uu |= (d - '0');
+ else if ((d >= 'a') && (d <= 'f'))
+ uu |= (d - ('a'-10));
+ else
+ return (char *) 0;
+ *u = uu;
+ }
+ return c;
+}
+
+/*
+ Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+ char *r = buff;
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
+ *(r++) = '_';
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+ strcpy(r,name);
+ return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ *ptr = (void *) 0;
+ return name;
+ } else {
+ return 0;
+ }
+ }
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+ char *r = buff;
+ size_t lname = (name ? strlen(name) : 0);
+ if ((2*sz + 2 + lname) > bsz) return 0;
+ *(r++) = '_';
+ r = SWIG_PackData(r,ptr,sz);
+ if (lname) {
+ strncpy(r,name,lname+1);
+ } else {
+ *r = 0;
+ }
+ return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ memset(ptr,0,sz);
+ return name;
+ } else {
+ return 0;
+ }
+ }
+ return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * php4run.swg
+ *
+ * PHP4 runtime library
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include "zend.h"
+#include "zend_API.h"
+#include "php.h"
+
+#ifdef ZEND_RAW_FENTRY
+/* ZEND_RAW_FENTRY was added somewhere between 5.2.0 and 5.2.3 */
+# define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_RAW_FENTRY((char*)#ZN, N, A, 0)
+#else
+/* This causes warnings from GCC >= 4.2 (assigning a string literal to char*).
+ * But this seems to be unavoidable without directly assuming knowledge of
+ * the structure, which changed between PHP4 and PHP5. */
+# define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_NAMED_FE(ZN, N, A)
+#endif
+
+#define SWIG_LONG_CONSTANT(N, V) zend_register_long_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
+#define SWIG_DOUBLE_CONSTANT(N, V) zend_register_double_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
+#define SWIG_STRING_CONSTANT(N, V) zend_register_stringl_constant((char*)#N, sizeof(#N), V, strlen(V), CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
+#define SWIG_CHAR_CONSTANT(N, V) do {\
+ static char swig_char = (V);\
+ zend_register_stringl_constant((char*)#N, sizeof(#N), &swig_char, 1, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);\
+} while (0)
+
+/* These TSRMLS_ stuff should already be defined now, but with older php under
+ redhat are not... */
+#ifndef TSRMLS_D
+#define TSRMLS_D
+#endif
+#ifndef TSRMLS_DC
+#define TSRMLS_DC
+#endif
+#ifndef TSRMLS_C
+#define TSRMLS_C
+#endif
+#ifndef TSRMLS_CC
+#define TSRMLS_CC
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/* But in fact SWIG_ConvertPtr is the native interface for getting typed
+ pointer values out of zvals. We need the TSRMLS_ macros for when we
+ make PHP type calls later as we handle php resources */
+#define SWIG_ConvertPtr(obj,pp,type,flags) SWIG_ZTS_ConvertPtr(obj,pp,type,flags TSRMLS_CC)
+
+
+#define SWIG_fail goto fail
+
+static const char *default_error_msg = "Unknown error occurred";
+static int default_error_code = E_ERROR;
+
+#define SWIG_PHP_Arg_Error_Msg(argnum,extramsg) "Error in argument " #argnum " "#extramsg
+
+#define SWIG_PHP_Error(code,msg) do { SWIG_ErrorCode() = code; SWIG_ErrorMsg() = msg; SWIG_fail; } while (0)
+
+#define SWIG_contract_assert(expr,msg) \
+ if (!(expr) ) { zend_printf("Contract Assert Failed %s\n",msg ); } else
+
+/* Standard SWIG API */
+#define SWIG_GetModule(clientdata) SWIG_Php4_GetModule()
+#define SWIG_SetModule(clientdata, pointer) SWIG_Php4_SetModule(pointer)
+
+/* used to wrap returned objects in so we know whether they are newobject
+ and need freeing, or not */
+typedef struct _swig_object_wrapper {
+ void * ptr;
+ int newobject;
+} swig_object_wrapper;
+
+/* empty zend destructor for types without one */
+static ZEND_RSRC_DTOR_FUNC(SWIG_landfill) { (void)rsrc; }
+
+#define SWIG_SetPointerZval(a,b,c,d) SWIG_ZTS_SetPointerZval(a,b,c,d TSRMLS_CC)
+
+static void
+SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject TSRMLS_DC) {
+ swig_object_wrapper *value=NULL;
+ /*
+ * First test for Null pointers. Return those as PHP native NULL
+ */
+ if (!ptr ) {
+ ZVAL_NULL(z);
+ return;
+ }
+ if (type->clientdata) {
+ if (! (*(int *)(type->clientdata)))
+ zend_error(E_ERROR, "Type: %s failed to register with zend",type->name);
+ value=(swig_object_wrapper *)emalloc(sizeof(swig_object_wrapper));
+ value->ptr=ptr;
+ value->newobject=newobject;
+ ZEND_REGISTER_RESOURCE(z, value, *(int *)(type->clientdata));
+ return;
+ }
+ zend_error(E_ERROR, "Type: %s not registered with zend",type->name);
+}
+
+/* This pointer conversion routine takes the native pointer p (along with
+ its type name) and converts it by calling appropriate casting functions
+ according to ty. The resultant pointer is returned, or NULL is returned
+ if the pointer can't be cast.
+
+ Sadly PHP has no API to find a type name from a type id, only from an
+ instance of a resource of the type id, so we have to pass type_name as well.
+
+ The two functions which might call this are:
+ SWIG_ZTS_ConvertResourcePtr which gets the type name from the resource
+ and the registered zend destructors for which we have one per type each
+ with the type name hard wired in. */
+static void *
+SWIG_ZTS_ConvertResourceData(void * p, const char *type_name, swig_type_info *ty TSRMLS_DC) {
+ swig_cast_info *tc;
+ void *result = 0;
+
+ if (!ty) {
+ /* They don't care about the target type, so just pass on the pointer! */
+ return p;
+ }
+
+ if (! type_name) {
+ /* can't convert p to ptr type ty if we don't know what type p is */
+ return NULL;
+ }
+
+ /* convert and cast p from type_name to ptr as ty. */
+ tc = SWIG_TypeCheck(type_name, ty);
+ if (tc) {
+ int newmemory = 0;
+ result = SWIG_TypeCast(tc, p, &newmemory);
+ assert(!newmemory); /* newmemory handling not yet implemented */
+ }
+ return result;
+}
+
+/* This function returns a pointer of type ty by extracting the pointer
+ and type info from the resource in z. z must be a resource.
+ If it fails, NULL is returned.
+ It uses SWIG_ZTS_ConvertResourceData to do the real work. */
+static void *
+SWIG_ZTS_ConvertResourcePtr(zval *z, swig_type_info *ty, int flags TSRMLS_DC) {
+ swig_object_wrapper *value;
+ void *p;
+ int type;
+ char *type_name;
+
+ value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type);
+ if ( flags && SWIG_POINTER_DISOWN ) {
+ value->newobject = 0;
+ }
+ p = value->ptr;
+ if (type==-1) return NULL;
+
+ type_name=zend_rsrc_list_get_rsrc_type(z->value.lval TSRMLS_CC);
+
+ return SWIG_ZTS_ConvertResourceData(p, type_name, ty TSRMLS_CC);
+}
+
+/* We allow passing of a RESOURCE pointing to the object or an OBJECT whose
+ _cPtr is a resource pointing to the object */
+static int
+SWIG_ZTS_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags TSRMLS_DC) {
+ if (z == NULL) {
+ *ptr = 0;
+ return 0;
+ }
+
+ switch (z->type) {
+ case IS_OBJECT: {
+ zval ** _cPtr;
+ if (zend_hash_find(HASH_OF(z),(char*)"_cPtr",sizeof("_cPtr"),(void**)&_cPtr)==SUCCESS) {
+ if ((*_cPtr)->type==IS_RESOURCE) {
+ *ptr = SWIG_ZTS_ConvertResourcePtr(*_cPtr, ty, flags TSRMLS_CC);
+ return (*ptr == NULL ? -1 : 0);
+ }
+ }
+ break;
+ }
+ case IS_RESOURCE:
+ *ptr = SWIG_ZTS_ConvertResourcePtr(z, ty, flags TSRMLS_CC);
+ return (*ptr == NULL ? -1 : 0);
+ case IS_NULL:
+ *ptr = 0;
+ return 0;
+ }
+
+ return -1;
+}
+
+static char const_name[] = "swig_runtime_data_type_pointer";
+static swig_module_info *SWIG_Php4_GetModule() {
+ zval *pointer;
+ swig_module_info *ret = 0;
+
+ MAKE_STD_ZVAL(pointer);
+
+ TSRMLS_FETCH();
+
+ if (zend_get_constant(const_name, sizeof(const_name), pointer TSRMLS_CC)) {
+ if (pointer->type == IS_LONG) {
+ ret = (swig_module_info *) pointer->value.lval;
+ }
+ }
+ FREE_ZVAL(pointer);
+ return ret;
+}
+
+static void SWIG_Php4_SetModule(swig_module_info *pointer) {
+ TSRMLS_FETCH();
+ REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, 0);
+}
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_eslConnection swig_types[0]
+#define SWIGTYPE_p_eslEvent swig_types[1]
+#define SWIGTYPE_p_esl_event_t swig_types[2]
+#define SWIGTYPE_p_esl_priority_t swig_types[3]
+#define SWIGTYPE_p_esl_status_t swig_types[4]
+static swig_type_info *swig_types[6];
+static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+/* header section */
+ZEND_BEGIN_MODULE_GLOBALS(ESL)
+const char *error_msg;
+int error_code;
+ZEND_END_MODULE_GLOBALS(ESL)
+ZEND_DECLARE_MODULE_GLOBALS(ESL)
+#ifdef ZTS
+#define SWIG_ErrorMsg() TSRMG(ESL_globals_id, zend_ESL_globals *, error_msg )
+#define SWIG_ErrorCode() TSRMG(ESL_globals_id, zend_ESL_globals *, error_code )
+#else
+#define SWIG_ErrorMsg() (ESL_globals.error_msg)
+#define SWIG_ErrorCode() (ESL_globals.error_code)
+#endif
+
+static void ESL_init_globals(zend_ESL_globals *globals ) {
+ globals->error_msg = default_error_msg;
+ globals->error_code = default_error_code;
+}
+static void ESL_destroy_globals(zend_ESL_globals * globals) { (void)globals; }
+
+static void SWIG_ResetError() {
+ TSRMLS_FETCH();
+ SWIG_ErrorMsg() = default_error_msg;
+ SWIG_ErrorCode() = default_error_code;
+}
+#define SWIG_name "ESL"
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_ESL.h"
+#ifdef __cplusplus
+}
+#endif
+
+
+#include "esl.h"
+#include "esl_oop.h"
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_eslConnection = {"_p_eslConnection", "eslConnection *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_eslEvent = {"_p_eslEvent", "eslEvent *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_esl_event_t = {"_p_esl_event_t", "esl_event_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_esl_priority_t = {"_p_esl_priority_t", "esl_priority_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_esl_status_t = {"_p_esl_status_t", "esl_status_t *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+ &_swigt__p_eslConnection,
+ &_swigt__p_eslEvent,
+ &_swigt__p_esl_event_t,
+ &_swigt__p_esl_priority_t,
+ &_swigt__p_esl_status_t,
+};
+
+static swig_cast_info _swigc__p_eslConnection[] = { {&_swigt__p_eslConnection, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_eslEvent[] = { {&_swigt__p_eslEvent, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_esl_event_t[] = { {&_swigt__p_esl_event_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_esl_priority_t[] = { {&_swigt__p_esl_priority_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_esl_status_t[] = { {&_swigt__p_esl_status_t, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+ _swigc__p_eslConnection,
+ _swigc__p_eslEvent,
+ _swigc__p_esl_event_t,
+ _swigc__p_esl_priority_t,
+ _swigc__p_esl_status_t,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+/* end header section */
+/* vdecl subsection */
+static int le_swig__p_eslEvent=0; /* handle for eslEvent */
+static int le_swig__p_esl_priority_t=0; /* handle for _p_esl_priority_t */
+static int le_swig__p_esl_status_t=0; /* handle for _p_esl_status_t */
+static int le_swig__p_esl_event_t=0; /* handle for _p_esl_event_t */
+static int le_swig__p_eslConnection=0; /* handle for eslConnection */
+/* end vdecl subsection */
+/* wrapper section */
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_event_set) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ esl_event_t *arg2 = (esl_event_t *) 0 ;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_event_set. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ {
+ if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_esl_event_t, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of eslEvent_event_set. Expected SWIGTYPE_p_esl_event_t");
+ }
+ }
+ if (arg1) (arg1)->event = arg2;
+
+
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_event_get) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ esl_event_t *result = 0 ;
+ zval **args[1];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_event_get. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ result = (esl_event_t *) ((arg1)->event);
+ {
+ SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_esl_event_t, 0);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_serialized_string_set) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_serialized_string_set. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ {
+ if (arg1->serialized_string) delete [] arg1->serialized_string;
+ if (arg2) {
+ arg1->serialized_string = (char *) (new char[strlen((const char *)arg2)+1]);
+ strcpy((char *)arg1->serialized_string, (const char *)arg2);
+ } else {
+ arg1->serialized_string = 0;
+ }
+ }
+
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_serialized_string_get) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *result = 0 ;
+ zval **args[1];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_serialized_string_get. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ result = (char *) ((arg1)->serialized_string);
+ {
+ if(!result) {
+ ZVAL_NULL(return_value);
+ } else {
+ ZVAL_STRING(return_value,result, 1);
+ }
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_mine_set) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ int arg2 ;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_mine_set. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
+ convert_to_long_ex(args[1]);
+ arg2 = (int) Z_LVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ if (arg1) (arg1)->mine = arg2;
+
+
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_mine_get) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ int result;
+ zval **args[1];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_mine_get. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ result = (int) ((arg1)->mine);
+ {
+ ZVAL_LONG(return_value,result);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_new_eslEvent__SWIG_0) {
+ char *arg1 = (char *) 0 ;
+ char *arg2 = (char *) NULL ;
+ eslEvent *result = 0 ;
+ zval **args[2];
+ int arg_count;
+
+ SWIG_ResetError();
+ arg_count = ZEND_NUM_ARGS();
+ if(arg_count<1 || arg_count>2 ||
+ zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
+ WRONG_PARAM_COUNT;
+
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[0]);
+ arg1 = (char *) Z_STRVAL_PP(args[0]);
+ /*@SWIG@*/;
+
+ if(arg_count > 1) {
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ }
+ result = (eslEvent *)new eslEvent((char const *)arg1,(char const *)arg2);
+ {
+ SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_eslEvent, 1);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_new_eslEvent__SWIG_1) {
+ esl_event_t *arg1 = (esl_event_t *) 0 ;
+ int arg2 = (int) 0 ;
+ eslEvent *result = 0 ;
+ zval **args[2];
+ int arg_count;
+
+ SWIG_ResetError();
+ arg_count = ZEND_NUM_ARGS();
+ if(arg_count<1 || arg_count>2 ||
+ zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
+ WRONG_PARAM_COUNT;
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_esl_event_t, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of new_eslEvent. Expected SWIGTYPE_p_esl_event_t");
+ }
+ }
+ if(arg_count > 1) {
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
+ convert_to_long_ex(args[1]);
+ arg2 = (int) Z_LVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ }
+ result = (eslEvent *)new eslEvent(arg1,arg2);
+ {
+ SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_eslEvent, 1);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_new_eslEvent) {
+ int argc;
+ zval **argv[2];
+
+ argc = ZEND_NUM_ARGS();
+ zend_get_parameters_array_ex(argc,argv);
+ if ((argc >= 1) && (argc <= 2)) {
+ int _v;
+ {
+ void *tmp;
+ _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_esl_event_t, 0) >= 0);
+ }
+ if (_v) {
+ if (argc <= 1) {
+ return _wrap_new_eslEvent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+ }
+ _v = (Z_TYPE_PP(argv[1]) == IS_LONG);
+ if (_v) {
+ return _wrap_new_eslEvent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+ }
+ }
+ }
+ if ((argc >= 1) && (argc <= 2)) {
+ int _v;
+ _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
+ if (_v) {
+ if (argc <= 1) {
+ return _wrap_new_eslEvent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+ }
+ _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
+ if (_v) {
+ return _wrap_new_eslEvent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+ }
+ }
+ }
+
+ SWIG_ErrorCode() = E_ERROR;
+ SWIG_ErrorMsg() = "No matching function for overloaded 'new_eslEvent'";
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+/* This function is designed to be called by the zend list destructors */
+/* to typecast and do the actual destruction */
+static void __wrap_delete_eslEvent(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
+ swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
+ void *ptr=value->ptr ;
+ int newobject=value->newobject ;
+ eslEvent *arg1 = (eslEvent *) 0 ;
+
+ efree(value);
+ if (! newobject) return; /* can't delete it! */
+ arg1 = (eslEvent *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_eslEvent TSRMLS_CC);
+ if (! arg1) zend_error(E_ERROR, "eslEvent resource already free'd");
+ delete arg1;
+
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_serialize) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) NULL ;
+ char *result = 0 ;
+ zval **args[2];
+ int arg_count;
+
+ SWIG_ResetError();
+ arg_count = ZEND_NUM_ARGS();
+ if(arg_count<1 || arg_count>2 ||
+ zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
+ WRONG_PARAM_COUNT;
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_serialize. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ if(arg_count > 1) {
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ }
+ result = (char *)(arg1)->serialize((char const *)arg2);
+ {
+ if(!result) {
+ ZVAL_NULL(return_value);
+ } else {
+ ZVAL_STRING(return_value,result, 1);
+ }
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_setPriority) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
+ bool result;
+ esl_priority_t *tmp2 ;
+ zval **args[2];
+ int arg_count;
+
+ SWIG_ResetError();
+ arg_count = ZEND_NUM_ARGS();
+ if(arg_count<1 || arg_count>2 ||
+ zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
+ WRONG_PARAM_COUNT;
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_setPriority. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ if(arg_count > 1) {
+ {
+ if(SWIG_ConvertPtr(*args[1], (void **) &tmp2, SWIGTYPE_p_esl_priority_t, 0) < 0 || tmp2 == NULL) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of eslEvent_setPriority. Expected SWIGTYPE_p_esl_priority_t");
+ }
+ arg2 = *tmp2;
+ }
+ }
+ result = (bool)(arg1)->setPriority(arg2);
+ {
+ ZVAL_BOOL(return_value,(result)?1:0);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_getHeader) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *result = 0 ;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_getHeader. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ result = (char *)(arg1)->getHeader(arg2);
+ {
+ if(!result) {
+ ZVAL_NULL(return_value);
+ } else {
+ ZVAL_STRING(return_value,result, 1);
+ }
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_getBody) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *result = 0 ;
+ zval **args[1];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_getBody. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ result = (char *)(arg1)->getBody();
+ {
+ if(!result) {
+ ZVAL_NULL(return_value);
+ } else {
+ ZVAL_STRING(return_value,result, 1);
+ }
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_getType) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *result = 0 ;
+ zval **args[1];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_getType. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ result = (char *)(arg1)->getType();
+ {
+ if(!result) {
+ ZVAL_NULL(return_value);
+ } else {
+ ZVAL_STRING(return_value,result, 1);
+ }
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_addBody) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ bool result;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_addBody. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ result = (bool)(arg1)->addBody((char const *)arg2);
+ {
+ ZVAL_BOOL(return_value,(result)?1:0);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_addHeader) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ bool result;
+ zval **args[3];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_addHeader. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[2]);
+ arg3 = (char *) Z_STRVAL_PP(args[2]);
+ /*@SWIG@*/;
+
+ result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
+ {
+ ZVAL_BOOL(return_value,(result)?1:0);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_delHeader) {
+ eslEvent *arg1 = (eslEvent *) 0 ;
+ char *arg2 = (char *) 0 ;
+ bool result;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslEvent_delHeader. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ result = (bool)(arg1)->delHeader((char const *)arg2);
+ {
+ ZVAL_BOOL(return_value,(result)?1:0);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_new_eslConnection__SWIG_0) {
+ char *arg1 = (char *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ eslConnection *result = 0 ;
+ zval **args[3];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[0]);
+ arg1 = (char *) Z_STRVAL_PP(args[0]);
+ /*@SWIG@*/;
+
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[2]);
+ arg3 = (char *) Z_STRVAL_PP(args[2]);
+ /*@SWIG@*/;
+
+ result = (eslConnection *)new eslConnection((char const *)arg1,(char const *)arg2,(char const *)arg3);
+ {
+ SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_eslConnection, 1);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_new_eslConnection__SWIG_1) {
+ int arg1 ;
+ eslConnection *result = 0 ;
+ zval **args[1];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
+ convert_to_long_ex(args[0]);
+ arg1 = (int) Z_LVAL_PP(args[0]);
+ /*@SWIG@*/;
+
+ result = (eslConnection *)new eslConnection(arg1);
+ {
+ SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_eslConnection, 1);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_new_eslConnection) {
+ int argc;
+ zval **argv[3];
+
+ argc = ZEND_NUM_ARGS();
+ zend_get_parameters_array_ex(argc,argv);
+ if (argc == 1) {
+ int _v;
+ _v = (Z_TYPE_PP(argv[0]) == IS_LONG);
+ if (_v) {
+ return _wrap_new_eslConnection__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ _v = (Z_TYPE_PP(argv[0]) == IS_STRING);
+ if (_v) {
+ _v = (Z_TYPE_PP(argv[1]) == IS_STRING);
+ if (_v) {
+ _v = (Z_TYPE_PP(argv[2]) == IS_STRING);
+ if (_v) {
+ return _wrap_new_eslConnection__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+ }
+ }
+ }
+ }
+
+ SWIG_ErrorCode() = E_ERROR;
+ SWIG_ErrorMsg() = "No matching function for overloaded 'new_eslConnection'";
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+/* This function is designed to be called by the zend list destructors */
+/* to typecast and do the actual destruction */
+static void __wrap_delete_eslConnection(zend_rsrc_list_entry *rsrc, const char *type_name TSRMLS_DC) {
+ swig_object_wrapper *value=(swig_object_wrapper *) rsrc->ptr ;
+ void *ptr=value->ptr ;
+ int newobject=value->newobject ;
+ eslConnection *arg1 = (eslConnection *) 0 ;
+
+ efree(value);
+ if (! newobject) return; /* can't delete it! */
+ arg1 = (eslConnection *)SWIG_ZTS_ConvertResourceData(ptr,type_name,SWIGTYPE_p_eslConnection TSRMLS_CC);
+ if (! arg1) zend_error(E_ERROR, "eslConnection resource already free'd");
+ delete arg1;
+
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_connected) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ int result;
+ zval **args[1];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_connected. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ result = (int)(arg1)->connected();
+ {
+ ZVAL_LONG(return_value,result);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_getInfo) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ eslEvent *result = 0 ;
+ zval **args[1];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_getInfo. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ result = (eslEvent *)(arg1)->getInfo();
+ {
+ SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_eslEvent, 0);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_send) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ esl_status_t result;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_send. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ result = (arg1)->send((char const *)arg2);
+ {
+ esl_status_t * resultobj = new esl_status_t((esl_status_t &) result);
+ SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_esl_status_t, 1);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_sendRecv) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ eslEvent *result = 0 ;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_sendRecv. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ result = (eslEvent *)(arg1)->sendRecv((char const *)arg2);
+ {
+ SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_eslEvent, 0);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_sendEvent) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ eslEvent *arg2 = (eslEvent *) 0 ;
+ esl_status_t result;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_sendEvent. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ {
+ if(SWIG_ConvertPtr(*args[1], (void **) &arg2, SWIGTYPE_p_eslEvent, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 2 of eslConnection_sendEvent. Expected SWIGTYPE_p_eslEvent");
+ }
+ }
+ result = (arg1)->sendEvent(arg2);
+ {
+ esl_status_t * resultobj = new esl_status_t((esl_status_t &) result);
+ SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_esl_status_t, 1);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_recvEvent) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ eslEvent *result = 0 ;
+ zval **args[1];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_recvEvent. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ result = (eslEvent *)(arg1)->recvEvent();
+ {
+ SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_eslEvent, 0);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_recvEventTimed) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ int arg2 ;
+ eslEvent *result = 0 ;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_recvEventTimed. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
+ convert_to_long_ex(args[1]);
+ arg2 = (int) Z_LVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ result = (eslEvent *)(arg1)->recvEventTimed(arg2);
+ {
+ SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_eslEvent, 0);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_filter) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ esl_status_t result;
+ zval **args[3];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_filter. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[2]);
+ arg3 = (char *) Z_STRVAL_PP(args[2]);
+ /*@SWIG@*/;
+
+ result = (arg1)->filter((char const *)arg2,(char const *)arg3);
+ {
+ esl_status_t * resultobj = new esl_status_t((esl_status_t &) result);
+ SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_esl_status_t, 1);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_events) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ esl_status_t result;
+ zval **args[3];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_events. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[2]);
+ arg3 = (char *) Z_STRVAL_PP(args[2]);
+ /*@SWIG@*/;
+
+ result = (arg1)->events((char const *)arg2,(char const *)arg3);
+ {
+ esl_status_t * resultobj = new esl_status_t((esl_status_t &) result);
+ SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_esl_status_t, 1);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_execute) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) NULL ;
+ char *arg4 = (char *) NULL ;
+ esl_status_t result;
+ zval **args[4];
+ int arg_count;
+
+ SWIG_ResetError();
+ arg_count = ZEND_NUM_ARGS();
+ if(arg_count<2 || arg_count>4 ||
+ zend_get_parameters_array_ex(arg_count,args)!=SUCCESS)
+ WRONG_PARAM_COUNT;
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_execute. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ if(arg_count > 2) {
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[2]);
+ arg3 = (char *) Z_STRVAL_PP(args[2]);
+ /*@SWIG@*/;
+
+ }
+ if(arg_count > 3) {
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[3]);
+ arg4 = (char *) Z_STRVAL_PP(args[3]);
+ /*@SWIG@*/;
+
+ }
+ result = (arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
+ {
+ esl_status_t * resultobj = new esl_status_t((esl_status_t &) result);
+ SWIG_SetPointerZval(return_value, (void *)resultobj, SWIGTYPE_p_esl_status_t, 1);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_setBlockingExecute) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int result;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_setBlockingExecute. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ result = (int)(arg1)->setBlockingExecute((char const *)arg2);
+ {
+ ZVAL_LONG(return_value,result);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_setEventLock) {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int result;
+ zval **args[2];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_eslConnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of eslConnection_setEventLock. Expected SWIGTYPE_p_eslConnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+
+ /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
+ convert_to_string_ex(args[1]);
+ arg2 = (char *) Z_STRVAL_PP(args[1]);
+ /*@SWIG@*/;
+
+ result = (int)(arg1)->setEventLock((char const *)arg2);
+ {
+ ZVAL_LONG(return_value,result);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
+/* NEW Destructor style */
+static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_eslEvent) {
+ __wrap_delete_eslEvent(rsrc, SWIGTYPE_p_eslEvent->name TSRMLS_CC);
+}
+/* NEW Destructor style */
+static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_esl_priority_t) {
+ /* No destructor for simple type _p_esl_priority_t */
+}
+/* NEW Destructor style */
+static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_esl_status_t) {
+ /* No destructor for simple type _p_esl_status_t */
+}
+/* NEW Destructor style */
+static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_esl_event_t) {
+ /* No destructor for simple type _p_esl_event_t */
+}
+/* NEW Destructor style */
+static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_eslConnection) {
+ __wrap_delete_eslConnection(rsrc, SWIGTYPE_p_eslConnection->name TSRMLS_CC);
+}
+/* end wrapper section */
+/* class entry subsection */
+
+
+/* entry subsection */
+/* Every non-class user visible function must have an entry here */
+static zend_function_entry ESL_functions[] = {
+ SWIG_ZEND_NAMED_FE(eslevent_event_set,_wrap_eslEvent_event_set,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_event_get,_wrap_eslEvent_event_get,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_serialized_string_set,_wrap_eslEvent_serialized_string_set,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_serialized_string_get,_wrap_eslEvent_serialized_string_get,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_mine_set,_wrap_eslEvent_mine_set,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_mine_get,_wrap_eslEvent_mine_get,NULL)
+ SWIG_ZEND_NAMED_FE(new_eslevent,_wrap_new_eslEvent,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_serialize,_wrap_eslEvent_serialize,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_setpriority,_wrap_eslEvent_setPriority,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_getheader,_wrap_eslEvent_getHeader,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_getbody,_wrap_eslEvent_getBody,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_gettype,_wrap_eslEvent_getType,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_addbody,_wrap_eslEvent_addBody,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_addheader,_wrap_eslEvent_addHeader,NULL)
+ SWIG_ZEND_NAMED_FE(eslevent_delheader,_wrap_eslEvent_delHeader,NULL)
+ SWIG_ZEND_NAMED_FE(new_eslconnection,_wrap_new_eslConnection,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_connected,_wrap_eslConnection_connected,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_getinfo,_wrap_eslConnection_getInfo,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_send,_wrap_eslConnection_send,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_sendrecv,_wrap_eslConnection_sendRecv,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_sendevent,_wrap_eslConnection_sendEvent,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_recvevent,_wrap_eslConnection_recvEvent,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_recveventtimed,_wrap_eslConnection_recvEventTimed,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_filter,_wrap_eslConnection_filter,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_events,_wrap_eslConnection_events,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_execute,_wrap_eslConnection_execute,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_setblockingexecute,_wrap_eslConnection_setBlockingExecute,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_seteventlock,_wrap_eslConnection_setEventLock,NULL)
+{NULL, NULL, NULL}
+};
+
+/* init section */
+zend_module_entry ESL_module_entry = {
+#if ZEND_MODULE_API_NO > 20010900
+ STANDARD_MODULE_HEADER,
+#endif
+ (char*)"ESL",
+ ESL_functions,
+ PHP_MINIT(ESL),
+ PHP_MSHUTDOWN(ESL),
+ PHP_RINIT(ESL),
+ PHP_RSHUTDOWN(ESL),
+ PHP_MINFO(ESL),
+#if ZEND_MODULE_API_NO > 20010900
+ NO_VERSION_YET,
+#endif
+ STANDARD_MODULE_PROPERTIES
+};
+zend_module_entry* SWIG_module_entry = &ESL_module_entry;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+SWIGEXPORT zend_module_entry *get_module(void) { return &ESL_module_entry; }
+#ifdef __cplusplus
+}
+#endif
+
+#define SWIG_php_minit PHP_MINIT_FUNCTION(ESL)
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded.
+ * There are three cases to handle:
+ * 1) If the cast->type has already been loaded AND the type we are adding
+ * casting info to has not been loaded (it is in this module), THEN we
+ * replace the cast->type pointer with the type pointer that has already
+ * been loaded.
+ * 2) If BOTH types (the one we are adding casting info to, and the
+ * cast->type) are loaded, THEN the cast info has already been loaded by
+ * the previous module so we just ignore it.
+ * 3) Finally, if cast->type has not already been loaded, then we add that
+ * swig_cast_info to the linked list (because the cast->type) pointer will
+ * be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+ size_t i;
+ swig_module_info *module_head, *iter;
+ int found, init;
+
+ clientdata = clientdata;
+
+ /* check to see if the circular list has been setup, if not, set it up */
+ if (swig_module.next==0) {
+ /* Initialize the swig_module */
+ swig_module.type_initial = swig_type_initial;
+ swig_module.cast_initial = swig_cast_initial;
+ swig_module.next = &swig_module;
+ init = 1;
+ } else {
+ init = 0;
+ }
+
+ /* Try and load any already created modules */
+ module_head = SWIG_GetModule(clientdata);
+ if (!module_head) {
+ /* This is the first module loaded for this interpreter */
+ /* so set the swig module into the interpreter */
+ SWIG_SetModule(clientdata, &swig_module);
+ module_head = &swig_module;
+ } else {
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+ found=0;
+ iter=module_head;
+ do {
+ if (iter==&swig_module) {
+ found=1;
+ break;
+ }
+ iter=iter->next;
+ } while (iter!= module_head);
+
+ /* if the is found in the list, then all is done and we may leave */
+ if (found) return;
+ /* otherwise we must add out module into the list */
+ swig_module.next = module_head->next;
+ module_head->next = &swig_module;
+ }
+
+ /* When multiple interpeters are used, a module could have already been initialized in
+ a different interpreter, but not yet have a pointer in this interpreter.
+ In this case, we do not want to continue adding types... everything should be
+ set up already */
+ if (init == 0) return;
+
+ /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+ for (i = 0; i < swig_module.size; ++i) {
+ swig_type_info *type = 0;
+ swig_type_info *ret;
+ swig_cast_info *cast;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+
+ /* if there is another module already loaded */
+ if (swig_module.next != &swig_module) {
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+ }
+ if (type) {
+ /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+ if (swig_module.type_initial[i]->clientdata) {
+ type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+ }
+ } else {
+ type = swig_module.type_initial[i];
+ }
+
+ /* Insert casting types */
+ cast = swig_module.cast_initial[i];
+ while (cast->type) {
+
+ /* Don't need to add information already in the list */
+ ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+ if (swig_module.next != &swig_module) {
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+ }
+ if (ret) {
+ if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+ cast->type = ret;
+ ret = 0;
+ } else {
+ /* Check for casting already in the list */
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+ if (!ocast) ret = 0;
+ }
+ }
+
+ if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+ if (type->cast) {
+ type->cast->prev = cast;
+ cast->next = type->cast;
+ }
+ type->cast = cast;
+ }
+ cast++;
+ }
+ /* Set entry in modules->types array equal to the type */
+ swig_module.types[i] = type;
+ }
+ swig_module.types[i] = 0;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+ for (i = 0; i < swig_module.size; ++i) {
+ int j = 0;
+ swig_cast_info *cast = swig_module.cast_initial[i];
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+ while (cast->type) {
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+ cast++;
+ ++j;
+ }
+ printf("---- Total casts: %d\n",j);
+ }
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types. It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+ size_t i;
+ swig_cast_info *equiv;
+ static int init_run = 0;
+
+ if (init_run) return;
+ init_run = 1;
+
+ for (i = 0; i < swig_module.size; i++) {
+ if (swig_module.types[i]->clientdata) {
+ equiv = swig_module.types[i]->cast;
+ while (equiv) {
+ if (!equiv->converter) {
+ if (equiv->type && !equiv->type->clientdata)
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+ }
+ equiv = equiv->next;
+ }
+ }
+ }
+}
+
+#ifdef __cplusplus
+#if 0
+{ /* c-mode */
+#endif
+}
+#endif
+
+
+ SWIG_php_minit {
+ SWIG_InitializeModule(0);
+
+/* oinit subsection */
+ZEND_INIT_MODULE_GLOBALS(ESL, ESL_init_globals, ESL_destroy_globals);
+
+/* Register resource destructors for pointer types */
+le_swig__p_eslEvent=zend_register_list_destructors_ex(_wrap_destroy_p_eslEvent,NULL,(char *)(SWIGTYPE_p_eslEvent->name),module_number);
+SWIG_TypeClientData(SWIGTYPE_p_eslEvent,&le_swig__p_eslEvent);
+le_swig__p_esl_priority_t=zend_register_list_destructors_ex(_wrap_destroy_p_esl_priority_t,NULL,(char *)(SWIGTYPE_p_esl_priority_t->name),module_number);
+SWIG_TypeClientData(SWIGTYPE_p_esl_priority_t,&le_swig__p_esl_priority_t);
+le_swig__p_esl_status_t=zend_register_list_destructors_ex(_wrap_destroy_p_esl_status_t,NULL,(char *)(SWIGTYPE_p_esl_status_t->name),module_number);
+SWIG_TypeClientData(SWIGTYPE_p_esl_status_t,&le_swig__p_esl_status_t);
+le_swig__p_esl_event_t=zend_register_list_destructors_ex(_wrap_destroy_p_esl_event_t,NULL,(char *)(SWIGTYPE_p_esl_event_t->name),module_number);
+SWIG_TypeClientData(SWIGTYPE_p_esl_event_t,&le_swig__p_esl_event_t);
+le_swig__p_eslConnection=zend_register_list_destructors_ex(_wrap_destroy_p_eslConnection,NULL,(char *)(SWIGTYPE_p_eslConnection->name),module_number);
+SWIG_TypeClientData(SWIGTYPE_p_eslConnection,&le_swig__p_eslConnection);
+CG(active_class_entry) = NULL;
+/* end oinit subsection */
+
+/* cinit subsection */
+/* end cinit subsection */
+
+ return SUCCESS;
+}
+
+PHP_RINIT_FUNCTION(ESL)
+{
+/* rinit section */
+
+/* vinit subsection */
+/* end vinit subsection */
+
+ return SUCCESS;
+}
+
+PHP_MSHUTDOWN_FUNCTION(ESL)
+{
+/* shutdown section */
+#ifdef ZTS
+ ts_free_id(ESL_globals_id);
+#endif
+ return SUCCESS;
+}
+
+PHP_RSHUTDOWN_FUNCTION(ESL)
+{
+/* rshutdown section */
+
+ return SUCCESS;
+}
+
+PHP_MINFO_FUNCTION(ESL)
+{
+}
+/* end init section */
Added: freeswitch/trunk/libs/esl/php/php_ESL.h
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/php/php_ESL.h Tue Feb 17 09:54:36 2009
@@ -0,0 +1,63 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org)
+ * Version 1.3.35
+ *
+ * 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.
+ * ----------------------------------------------------------------------------- */
+
+
+
+#ifndef PHP_ESL_H
+#define PHP_ESL_H
+
+extern zend_module_entry ESL_module_entry;
+#define phpext_ESL_ptr &ESL_module_entry
+
+#ifdef PHP_WIN32
+# define PHP_ESL_API __declspec(dllexport)
+#else
+# define PHP_ESL_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+PHP_MINIT_FUNCTION(ESL);
+PHP_MSHUTDOWN_FUNCTION(ESL);
+PHP_RINIT_FUNCTION(ESL);
+PHP_RSHUTDOWN_FUNCTION(ESL);
+PHP_MINFO_FUNCTION(ESL);
+
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_event_set);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_event_get);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_serialized_string_set);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_serialized_string_get);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_mine_set);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_mine_get);
+ZEND_NAMED_FUNCTION(_wrap_new_eslEvent);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_serialize);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_setPriority);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_getHeader);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_getBody);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_getType);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_addBody);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_addHeader);
+ZEND_NAMED_FUNCTION(_wrap_eslEvent_delHeader);
+ZEND_NAMED_FUNCTION(_wrap_new_eslConnection);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_connected);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_getInfo);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_send);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_sendRecv);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_sendEvent);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_recvEvent);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_recvEventTimed);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_filter);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_events);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_execute);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_setBlockingExecute);
+ZEND_NAMED_FUNCTION(_wrap_eslConnection_setEventLock);
+#endif /* PHP_ESL_H */
1
0
Author: anthm
Date: Tue Feb 17 09:46:18 2009
New Revision: 12089
Log:
tweak build
Modified:
freeswitch/trunk/libs/esl/Makefile
freeswitch/trunk/libs/esl/perl/Makefile
Modified: freeswitch/trunk/libs/esl/Makefile
==============================================================================
--- freeswitch/trunk/libs/esl/Makefile (original)
+++ freeswitch/trunk/libs/esl/Makefile Tue Feb 17 09:46:18 2009
@@ -47,7 +47,7 @@
swigclean: clean
make -C perl swigclean
-perlmod:
- make SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl
+perlmod: $(MYLIB)
+ make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl
Modified: freeswitch/trunk/libs/esl/perl/Makefile
==============================================================================
--- freeswitch/trunk/libs/esl/perl/Makefile (original)
+++ freeswitch/trunk/libs/esl/perl/Makefile Tue Feb 17 09:46:18 2009
@@ -18,8 +18,8 @@
esl_wrap.o: esl_wrap.cpp
$(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o
-ESL.so: $(MYLIB) esl_wrap.o perlxsi.o
- $(CXX) $(SOLINK) esl_wrap.o perlxsi.o $(LOCAL_LDFLAGS) -o ESL.so -L. $(LIBS)
+ESL.so: esl_wrap.o perlxsi.o
+ $(CXX) $(SOLINK) esl_wrap.o perlxsi.o $(MYLIB) $(LOCAL_LDFLAGS) -o ESL.so -L. $(LIBS)
clean:
rm -f *.o *.so *~
1
0
Author: anthm
Date: Tue Feb 17 09:41:34 2009
New Revision: 12088
Log:
re-arrange
Added:
freeswitch/trunk/libs/esl/perl/Makefile
Modified:
freeswitch/trunk/libs/esl/Makefile
Modified: freeswitch/trunk/libs/esl/Makefile
==============================================================================
--- freeswitch/trunk/libs/esl/Makefile (original)
+++ freeswitch/trunk/libs/esl/Makefile Tue Feb 17 09:41:34 2009
@@ -1,4 +1,5 @@
-INCS=-Isrc/include
+PWD=$(shell pwd)
+INCS=-I$(PWD)/src/include
LIBEDIT_DIR=../../libs/libedit
DEBUG=-g -ggdb
BASE_FLAGS=$(INCS) -DHAVE_EDITLINE $(DEBUG) -I$(LIBEDIT_DIR)/src/ -fPIC
@@ -12,11 +13,6 @@
SRC=src/esl.c src/esl_event.c src/esl_threadmutex.c src/esl_config.c src/esl_oop.cpp
HEADERS=src/include/esl_config.h src/include/esl_event.h src/include/esl.h src/include/esl_threadmutex.h src/include/esl_oop.h
SOLINK=-shared -Xlinker -x
-PERL = $(shell which perl)
-PERL_LIBDIR =-L$(shell perl -MConfig -e 'print $$Config{archlib}')/CORE
-PERL_LIBS =$(shell perl -MConfig -e 'print $$Config{libs}')
-LOCAL_CFLAGS= -w -DMULTIPLICITY $(shell $(PERL) -MExtUtils::Embed -e ccopts) -DEMBED_PERL
-LOCAL_LDFLAGS=$(shell $(PERL) -MExtUtils::Embed -e ldopts) $(shell $(PERL) -MConfig -e 'print $$Config{libs}')
# comment the next line to disable c++ (no swig mods for you then)
OBJS += src/esl_oop.o
@@ -42,29 +38,16 @@
$(CXX) $(CXX_CFLAGS) $(CXXFLAGS) -c $< -o $@
clean:
- rm -f *.o src/*.o testclient testserver fs_cli libesl.a *~ src/*~ src/include/*~ perl/*.o perl/*.so
+ rm -f *.o src/*.o testclient testserver fs_cli libesl.a *~ src/*~ src/include/*~
+ make -C perl clean
-reswig: swigclean perl/esl_wrap.cpp perl/perlxsi.c
+reswig: swigclean
+ make -C perl reswig
swigclean: clean
- rm -f perl/esl_wrap.* perl/ESL.so perl/ESL.pm perl/perlxsi.*
-
-perl/esl_wrap.cpp:
- swig -module ESL -shadow -perl5 -c++ -DMULTIPLICITY -Isrc/include -o perl/esl_wrap.cpp ESL.i
-
-perl/perlxsi.c:
- $(PERL) -MExtUtils::Embed -e xsinit -- -o perl/perlxsi.c
-
-perl/perlxsi.o: perl/perlxsi.c
- $(CC) $(CC_CFLAGS) $(CFLAGS) $(LOCAL_CFLAGS) -c perl/perlxsi.c -o perl/perlxsi.o
-
-perl/esl_wrap.o: perl/esl_wrap.cpp
- $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c perl/esl_wrap.cpp -o perl/esl_wrap.o
-
-perl/ESL.so: $(MYLIB) perl/esl_wrap.o perl/perlxsi.o
- $(CXX) $(SOLINK) perl/esl_wrap.o perl/perlxsi.o $(LOCAL_LDFLAGS) -o perl/ESL.so -L. $(LIBS)
-
-perlmod: perl/ESL.so
+ make -C perl swigclean
+perlmod:
+ make SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl
Added: freeswitch/trunk/libs/esl/perl/Makefile
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/perl/Makefile Tue Feb 17 09:41:34 2009
@@ -0,0 +1,31 @@
+PERL = $(shell which perl)
+PERL_LIBDIR =-L$(shell perl -MConfig -e 'print $$Config{archlib}')/CORE
+PERL_LIBS =$(shell perl -MConfig -e 'print $$Config{libs}')
+LOCAL_CFLAGS= -w -DMULTIPLICITY $(shell $(PERL) -MExtUtils::Embed -e ccopts) -DEMBED_PERL
+LOCAL_LDFLAGS=$(shell $(PERL) -MExtUtils::Embed -e ldopts) $(shell $(PERL) -MConfig -e 'print $$Config{libs}')
+
+all: ESL.so
+
+esl_wrap.cpp:
+ swig -module ESL -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
+
+perlxsi.c:
+ $(PERL) -MExtUtils::Embed -e xsinit -- -o perlxsi.c
+
+perlxsi.o: perlxsi.c
+ $(CC) $(CC_CFLAGS) $(CFLAGS) $(LOCAL_CFLAGS) -c perlxsi.c -o perlxsi.o
+
+esl_wrap.o: esl_wrap.cpp
+ $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o
+
+ESL.so: $(MYLIB) esl_wrap.o perlxsi.o
+ $(CXX) $(SOLINK) esl_wrap.o perlxsi.o $(LOCAL_LDFLAGS) -o ESL.so -L. $(LIBS)
+
+clean:
+ rm -f *.o *.so *~
+
+swigclean:
+ rm -f esl_wrap.* ESL.so ESL.pm perlxsi.*
+
+reswig: swigclean esl_wrap.cpp perlxsi.c
+
1
0
[commit] r12087 - freeswitch/trunk/scripts/contrib/dschreiber/mod_nibblebill
by FreeSWITCH SVN 17 Feb '09
by FreeSWITCH SVN 17 Feb '09
17 Feb '09
Author: dschreiber
Date: Tue Feb 17 09:39:48 2009
New Revision: 12087
Log:
Change message type to debug, not info. Rather annoying otherwise on busy systems
Modified:
freeswitch/trunk/scripts/contrib/dschreiber/mod_nibblebill/mod_nibblebill.c
Modified: freeswitch/trunk/scripts/contrib/dschreiber/mod_nibblebill/mod_nibblebill.c
==============================================================================
--- freeswitch/trunk/scripts/contrib/dschreiber/mod_nibblebill/mod_nibblebill.c (original)
+++ freeswitch/trunk/scripts/contrib/dschreiber/mod_nibblebill/mod_nibblebill.c Tue Feb 17 09:39:48 2009
@@ -396,7 +396,7 @@
/* Convert billrate into microseconds and multiply by # of microseconds that have passed since last *successful* bill */
billamount = (atof(billrate) / 1000000 / 60) * ((ts - nibble_data->lastts)) - nibble_data->bill_adjustments;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Billing $%f to %s (Call: %s / %f so far)\n", billamount, billaccount, uuid, nibble_data->total);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Billing $%f to %s (Call: %s / %f so far)\n", billamount, billaccount, uuid, nibble_data->total);
/* DO ODBC BILLING HERE and reset counters if it's successful! */
if (bill_event(billamount, billaccount) == SWITCH_STATUS_SUCCESS) {
1
0
[commit] r12086 - in freeswitch/trunk: libs/esl/perl libs/esl/src libs/esl/src/include libs/speex src/mod/event_handlers/mod_event_socket
by FreeSWITCH SVN 17 Feb '09
by FreeSWITCH SVN 17 Feb '09
17 Feb '09
Author: anthm
Date: Tue Feb 17 08:13:32 2009
New Revision: 12086
Log:
add some stuff to esl
Modified:
freeswitch/trunk/libs/esl/perl/ESL.pm
freeswitch/trunk/libs/esl/perl/esl_wrap.cpp
freeswitch/trunk/libs/esl/src/esl.c
freeswitch/trunk/libs/esl/src/esl_oop.cpp
freeswitch/trunk/libs/esl/src/include/esl.h
freeswitch/trunk/libs/esl/src/include/esl_oop.h
freeswitch/trunk/libs/speex/config.h.in
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
Modified: freeswitch/trunk/libs/esl/perl/ESL.pm
==============================================================================
--- freeswitch/trunk/libs/esl/perl/ESL.pm (original)
+++ freeswitch/trunk/libs/esl/perl/ESL.pm Tue Feb 17 08:13:32 2009
@@ -135,6 +135,8 @@
*filter = *ESLc::eslConnection_filter;
*events = *ESLc::eslConnection_events;
*execute = *ESLc::eslConnection_execute;
+*setBlockingExecute = *ESLc::eslConnection_setBlockingExecute;
+*setEventLock = *ESLc::eslConnection_setEventLock;
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
Modified: freeswitch/trunk/libs/esl/perl/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/perl/esl_wrap.cpp (original)
+++ freeswitch/trunk/libs/esl/perl/esl_wrap.cpp Tue Feb 17 08:13:32 2009
@@ -2981,8 +2981,8 @@
{
eslConnection *arg1 = (eslConnection *) 0 ;
char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- char *arg4 = (char *) 0 ;
+ char *arg3 = (char *) NULL ;
+ char *arg4 = (char *) NULL ;
esl_status_t result;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -2998,7 +2998,7 @@
int argvi = 0;
dXSARGS;
- if ((items < 4) || (items > 4)) {
+ if ((items < 2) || (items > 4)) {
SWIG_croak("Usage: eslConnection_execute(self,app,arg,uuid);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_eslConnection, 0 | 0 );
@@ -3011,16 +3011,20 @@
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "eslConnection_execute" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "eslConnection_execute" "', argument " "3"" of type '" "char const *""'");
- }
- arg3 = reinterpret_cast< char * >(buf3);
- res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
- if (!SWIG_IsOK(res4)) {
- SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "eslConnection_execute" "', argument " "4"" of type '" "char const *""'");
+ if (items > 2) {
+ res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "eslConnection_execute" "', argument " "3"" of type '" "char const *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ }
+ if (items > 3) {
+ res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "eslConnection_execute" "', argument " "4"" of type '" "char const *""'");
+ }
+ arg4 = reinterpret_cast< char * >(buf4);
}
- arg4 = reinterpret_cast< char * >(buf4);
result = (arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
ST(argvi) = SWIG_NewPointerObj((new esl_status_t(static_cast< const esl_status_t& >(result))), SWIGTYPE_p_esl_status_t, SWIG_POINTER_OWN | 0); argvi++ ;
@@ -3038,6 +3042,84 @@
}
+XS(_wrap_eslConnection_setBlockingExecute) {
+ {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: eslConnection_setBlockingExecute(self,val);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_eslConnection, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "eslConnection_setBlockingExecute" "', argument " "1"" of type '" "eslConnection *""'");
+ }
+ arg1 = reinterpret_cast< eslConnection * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "eslConnection_setBlockingExecute" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (int)(arg1)->setBlockingExecute((char const *)arg2);
+ ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ XSRETURN(argvi);
+ fail:
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_eslConnection_setEventLock) {
+ {
+ eslConnection *arg1 = (eslConnection *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: eslConnection_setEventLock(self,val);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_eslConnection, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "eslConnection_setEventLock" "', argument " "1"" of type '" "eslConnection *""'");
+ }
+ arg1 = reinterpret_cast< eslConnection * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "eslConnection_setEventLock" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (int)(arg1)->setEventLock((char const *)arg2);
+ ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ XSRETURN(argvi);
+ fail:
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ SWIG_croak_null();
+ }
+}
+
+
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
@@ -3114,6 +3196,8 @@
{"ESLc::eslConnection_filter", _wrap_eslConnection_filter},
{"ESLc::eslConnection_events", _wrap_eslConnection_events},
{"ESLc::eslConnection_execute", _wrap_eslConnection_execute},
+{"ESLc::eslConnection_setBlockingExecute", _wrap_eslConnection_setBlockingExecute},
+{"ESLc::eslConnection_setEventLock", _wrap_eslConnection_setEventLock},
{0,0}
};
/* -----------------------------------------------------------------------------
Modified: freeswitch/trunk/libs/esl/src/esl.c
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl.c (original)
+++ freeswitch/trunk/libs/esl/src/esl.c Tue Feb 17 08:13:32 2009
@@ -450,6 +450,8 @@
char cmd_buf[128] = "sendmsg";
char app_buf[512] = "";
char arg_buf[512] = "";
+ const char *el_buf = "event-lock: true\n";
+ const char *bl_buf = "blocking: true\n";
char send_buf[1292] = "";
if (!handle->connected) {
@@ -468,7 +470,8 @@
snprintf(arg_buf, sizeof(arg_buf), "execute-app-arg: %s\n", arg);
}
- snprintf(send_buf, sizeof(send_buf), "%s\ncall-command: execute\n%s%s\n", cmd_buf, app_buf, arg_buf);
+ snprintf(send_buf, sizeof(send_buf), "%s\ncall-command: execute\n%s%s%s%s\n",
+ cmd_buf, app_buf, arg_buf, handle->event_lock ? el_buf : NULL, handle->blocking_execute ? bl_buf : NULL);
return esl_send_recv(handle, send_buf);
}
Modified: freeswitch/trunk/libs/esl/src/esl_oop.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl_oop.cpp (original)
+++ freeswitch/trunk/libs/esl/src/esl_oop.cpp Tue Feb 17 08:13:32 2009
@@ -60,6 +60,22 @@
return NULL;
}
+int eslConnection::setBlockingExecute(const char *val)
+{
+ if (val) {
+ handle.blocking_execute = esl_true(val);
+ }
+ return handle.blocking_execute;
+}
+
+int eslConnection::setEventLock(const char *val)
+{
+ if (val) {
+ handle.event_lock = esl_true(val);
+ }
+ return handle.event_lock;
+}
+
esl_status_t eslConnection::execute(const char *app, const char *arg, const char *uuid)
{
return esl_execute(&handle, app, arg, uuid);
Modified: freeswitch/trunk/libs/esl/src/include/esl.h
==============================================================================
--- freeswitch/trunk/libs/esl/src/include/esl.h (original)
+++ freeswitch/trunk/libs/esl/src/include/esl.h Tue Feb 17 08:13:32 2009
@@ -270,6 +270,8 @@
int connected;
struct sockaddr_in addr;
esl_mutex_t *mutex;
+ int blocking_execute;
+ int event_lock;
} esl_handle_t;
typedef enum {
Modified: freeswitch/trunk/libs/esl/src/include/esl_oop.h
==============================================================================
--- freeswitch/trunk/libs/esl/src/include/esl_oop.h (original)
+++ freeswitch/trunk/libs/esl/src/include/esl_oop.h Tue Feb 17 08:13:32 2009
@@ -83,7 +83,9 @@
eslEvent *recvEventTimed(int ms);
esl_status_t filter(const char *header, const char *value);
esl_status_t events(const char *etype, const char *value);
- esl_status_t execute(const char *app, const char *arg, const char *uuid);
+ esl_status_t execute(const char *app, const char *arg = NULL, const char *uuid = NULL);
+ int setBlockingExecute(const char *val);
+ int setEventLock(const char *val);
};
Modified: freeswitch/trunk/libs/speex/config.h.in
==============================================================================
--- freeswitch/trunk/libs/speex/config.h.in (original)
+++ freeswitch/trunk/libs/speex/config.h.in Tue Feb 17 08:13:32 2009
@@ -96,13 +96,13 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* The size of `int', as computed by sizeof. */
+/* The size of a `int', as computed by sizeof. */
#undef SIZEOF_INT
-/* The size of `long', as computed by sizeof. */
+/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
-/* The size of `short', as computed by sizeof. */
+/* The size of a `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* Version extra */
@@ -129,12 +129,6 @@
/* Make use of alloca */
#undef USE_ALLOCA
-/* Use FFTW3 for FFT */
-#undef USE_GPL_FFTW3
-
-/* Use Intel Math Kernel Library for FFT */
-#undef USE_INTEL_MKL
-
/* Use KISS Fast Fourier Transform */
#undef USE_KISS_FFT
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Tue Feb 17 08:13:32 2009
@@ -1470,7 +1470,14 @@
}
if (switch_strlen_zero(uuid) && listener->session) {
- if (switch_test_flag(listener, LFLAG_ASYNC)) {
+ const char *blocking = switch_event_get_header(*event, "blocking");
+ int async = switch_test_flag(listener, LFLAG_ASYNC);
+
+ if (blocking && switch_true(blocking)) {
+ async = 0;
+ }
+
+ if (async) {
if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) {
switch_snprintf(reply, reply_len, "+OK");
} else {
1
0
Author: cypromis
Date: Tue Feb 17 05:29:15 2009
New Revision: 12085
Log:
- added mod_python
- added mod_fax
- added mod_amrwb.so
- added mod_celt.so
- added mod_easyroute.so
- added mod_http.so
- added mod_lcr.so
- added mod_loopback.so
- added mod_siren.so
- added mod/mod_stress.so
- added mod_yaml.so
- added mod_shout.so
- added mod_xml_ldap.so
- added rpms or all sounds
- openzap is now its own rpm
- added french
- added german
- added missing dependencies
- added soundfiles with separate rpms
- added definition of all sourcefiles and added them to the SRPM
- fixes to monit file
- changes to redhat init file
Modified:
freeswitch/trunk/build/freeswitch.monitrc
freeswitch/trunk/freeswitch.spec
Modified: freeswitch/trunk/build/freeswitch.monitrc
==============================================================================
--- freeswitch/trunk/build/freeswitch.monitrc (original)
+++ freeswitch/trunk/build/freeswitch.monitrc Tue Feb 17 05:29:15 2009
@@ -12,9 +12,8 @@
if failed checksum then unmonitor
if failed permission 755 then unmonitor
if failed uid freeswitch then unmonitor
- if failed gid daemon then unmonitor
- check file sendmail_rc with path /etc/init.d/freeswitch
+ check file freeswitch_rc with path /etc/init.d/freeswitch
group voice
if failed checksum then unmonitor
if failed permission 755 then unmonitor
Modified: freeswitch/trunk/freeswitch.spec
==============================================================================
--- freeswitch/trunk/freeswitch.spec (original)
+++ freeswitch/trunk/freeswitch.spec Tue Feb 17 05:29:15 2009
@@ -10,10 +10,27 @@
Version: 1.0.3
Release: 1
URL: http://www.freeswitch.org/
-Packager: Michal Bielicki
-Vendor: http://www.voiceworks.pl/
-Source0: %{name}-%{version}.tar.bz2
-Prefix: %{prefix}
+Packager: Michal Bielicki
+Vendor: http://www.halokwadrat.de/
+Source0: http://files.freeswitch.org/%{name}-%{version}.tar.bz2
+Source1: http://svn.freeswitch.org/downloads/libs/celt-0.5.1.tar.gz
+Source2: http://svn.freeswitch.org/downloads/libs/flite-1.3.99.tar.gz
+Source3: http://svn.freeswitch.org/downloads/libs/lame-3.97.tar.gz
+Source4: http://svn.freeswitch.org/downloads/libs/libshout-2.2.2.tar.gz
+Source5: http://svn.freeswitch.org/downloads/libs/mpg123.tar.gz
+Source6: http://svn.freeswitch.org/downloads/libs/openldap-2.4.11.tar.gz
+Source7: http://svn.freeswitch.org/downloads/libs/pocketsphinx-0.5.99.tar.gz
+Source8: http://svn.freeswitch.org/downloads/libs/soundtouch-1.3.1.tar.gz
+Source9: http://svn.freeswitch.org/downloads/libs/sphinxbase-0.4.99.tar.gz
+Source10: http://files.freeswitch.org/freeswitch-sounds-music-8000-1.0.7.tar.gz
+Source11: http://files.freeswitch.org/freeswitch-sounds-music-16000-1.0.7.tar.gz
+Source12: http://files.freeswitch.org/freeswitch-sounds-music-32000-1.0.7.tar.gz
+Source13: http://files.freeswitch.org/freeswitch-sounds-music-48000-1.0.7.tar.gz
+Source14: http://files.freeswitch.org/freeswitch-sounds-en-us-callie-8000-1.0.7.tar.gz
+Source15: http://files.freeswitch.org/freeswitch-sounds-en-us-callie-16000-1.0.7.tar.…
+Source16: http://files.freeswitch.org/freeswitch-sounds-en-us-callie-32000-1.0.7.tar.…
+Source17: http://files.freeswitch.org/freeswitch-sounds-en-us-callie-48000-1.0.7.tar.…
+Prefix: %{prefix}
#AutoReqProv: no
@@ -38,6 +55,11 @@
BuildRequires: gdbm-devel
BuildRequires: db4-devel
BuildRequires: python-devel
+BuildRequires: libogg-devel
+BuildRequires: libvorbis-devel
+BuildRequires: libtiff-devel
+#BuildRequires: mono-devel
+BuildRequires: alsa-lib-devel
%if %{?suse_version:1}0
%if 0%{?suse_version} > 910
@@ -151,13 +173,28 @@
%package lang-en
-Summary: Provides english language dependand modules and sounds for the FreeSwitch Open Source telephone platform.
+Summary: Provides english language dependand modules and speech config for the FreeSwitch Open Source telephone platform.
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
%description lang-en
English language phrases module and directory structure for say module and voicemail
+%package lang-fr
+Summary: Provides french language dependand modules and speech config for the FreeSwitch Open Source telephone platform.
+Group: System/LibrariesRequires: %{name} = %{version}-%{release}
+
+%description lang-fr
+French language phrases module and directory structure for say module and voicemail
+
+%package lang-de
+Summary: Provides german language dependand modules and speech config for the FreeSwitch Open Source telephone platform.
+Group: System/LibrariesRequires: %{name} = %{version}-%{release}
+
+%description lang-de
+German language phrases module and directory structure for say module and voicemail
+
+
%package openzap
Summary: Provides a unified interface to hardware TDM cards and ss7 stacks for freeswitch
Group: System/Libraries
@@ -239,7 +276,25 @@
%prep
-%setup -q
+%setup -b0 -q
+cp %{SOURCE1} libs/
+cp %{SOURCE2} libs/
+cp %{SOURCE3} libs/
+cp %{SOURCE4} libs/
+cp %{SOURCE5} libs/
+cp %{SOURCE6} libs/
+cp %{SOURCE7} libs/
+cp %{SOURCE8} libs/
+cp %{SOURCE9} libs/
+cp %{SOURCE10} .
+cp %{SOURCE11} .
+cp %{SOURCE12} .
+cp %{SOURCE13} .
+cp %{SOURCE14} .
+cp %{SOURCE15} .
+cp %{SOURCE16} .
+cp %{SOURCE17} .
+
%build
%ifos linux
@@ -253,22 +308,21 @@
PASSTHRU_CODEC_MODULES="codecs/mod_g729 codecs/mod_g723_1 codecs/mod_amr codecs/mod_amrwb"
SPIDERMONKEY_MODULES="languages/mod_spidermonkey languages/mod_spidermonkey_curl languages/mod_spidermonkey_core_db languages/mod_spidermonkey_odbc languages/mod_spidermonkey_socket languages/mod_spidermonkey_teletone"
-APPLICATIONS_MODULES="applications/mod_commands applications/mod_conference applications/mod_dptools applications/mod_enum applications/mod_esf applications/mod_expr applications/mod_fifo applications/mod_limit applications/mod_rss applications/mod_voicemail applications/mod_fsv applications/mod_lcr applications/mod_easyroute applications/mod_stress applications/mod_http applications/mod_vm applications/mod_limitd"
+APPLICATIONS_MODULES="applications/mod_commands applications/mod_conference applications/mod_dptools applications/mod_enum applications/mod_esf applications/mod_expr applications/mod_fifo applications/mod_limit applications/mod_rss applications/mod_voicemail applications/mod_fsv applications/mod_lcr applications/mod_easyroute applications/mod_stress applications/mod_http applications/mod_vmd applications/mod_limit applications/mod_soundtouch applications/mod_fax"
ASR_TTS_MODULES="asr_tts/mod_pocketsphinx asr_tts/mod_flite"
CODECS_MODULES="codecs/mod_ilbc codecs/mod_h26x codecs/mod_voipcodecs codecs/mod_speex codecs/mod_celt codecs/mod_siren"
DIALPLANS_MODULES="dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml"
-DIRECTORIES_MODULES=
-DOTNET_MODULES=
+DIRECTORIES_MODULES=""
ENDPOINTS_MODULES="endpoints/mod_dingaling endpoints/mod_iax endpoints/mod_portaudio endpoints/mod_sofia ../../libs/openzap/mod_openzap endpoints/mod_loopback"
EVENT_HANDLERS_MODULES="event_handlers/mod_event_multicast event_handlers/mod_event_socket event_handlers/mod_cdr_csv"
-FORMATS_MODULES="formats/mod_local_stream formats/mod_native_file formats/mod_sndfile formats/mod_tone_stream"
+FORMATS_MODULES="formats/mod_local_stream formats/mod_native_file formats/mod_sndfile formats/mod_tone_stream formats/mod_shout"
LANGUAGES_MODULES="languages/mod_perl languages/mod_lua languages/mod_python languages/mod_yaml"
LOGGERS_MODULES="loggers/mod_console loggers/mod_logfile loggers/mod_syslog"
-SAY_MODULES="say/mod_say_en"
+SAY_MODULES="say/mod_say_en say/mod_say_de say/mod_say_fr"
TIMERS_MODULES=
-DISABLED_MODULES="applications/mod_soundtouch directories/mod_ldap languages/mod_java languages/mod_python languages/mod_spidermonkey_skel ast_tts/mod_cepstral asr_tts/mod_lumenvox event_handlers/mod_event_test event_handlers/mod_radius_cdr event_handlers/mod_zeroconf formats/mod_shout say/mod_say_it say/mod_say_es say/mod_say_nl"
-XML_INT_MODULES="xml_int/mod_xml_rpc xml_int/mod_xml_curl xml_int/mod_xml_cdr"
-MYMODULES="$PASSTHRU_CODEC_MODULES $SPIDERMONKEY_MODULES $APPLICATIONS_MODULES $ASR_TTS_MODULES $CODECS_MODULES $DIALPLANS_MODULES $DIRECTORIES_MODULES $DOTNET_MODULES $ENDPOINTS_MODULES $EVENT_HANDLERS_MODULES $FORMATS_MODULES $LANGUAGES_MODULES $LOGGERS_MODULES $SAY_MODULES $TIMERS_MODULES $XML_INT_MODULES"
+DISABLED_MODULES="applications/mod_soundtouch languages/mod_spidermonkey_skel ast_tts/mod_cepstral asr_tts/mod_lumenvox directories/mod_ldap event_handlers/mod_event_test event_handlers/mod_radius_cdr event_handlers/mod_zeroconf languages/mod_managed languages/mod_java say/mod_say_it say/mod_say_es say/mod_say_nl"
+XML_INT_MODULES="xml_int/mod_xml_rpc xml_int/mod_xml_curl xml_int/mod_xml_cdr xml_int/mod_xml_ldap"
+MYMODULES="$PASSTHRU_CODEC_MODULES $SPIDERMONKEY_MODULES $APPLICATIONS_MODULES $ASR_TTS_MODULES $CODECS_MODULES $DIALPLANS_MODULES $DIRECTORIES_MODULES $ENDPOINTS_MODULES $EVENT_HANDLERS_MODULES $FORMATS_MODULES $LANGUAGES_MODULES $LOGGERS_MODULES $SAY_MODULES $TIMERS_MODULES $XML_INT_MODULES"
export MODULES=$MYMODULES
test ! -f modules.conf || rm -f modules.conf
@@ -310,15 +364,14 @@
%install
# delete unsupported langugages for now
-rm -rf conf/lang/de
-rm -rf conf/lang/fr
-rm -rf $RPM_BUILD_ROOT%{prefix}/conf/lang/de
-rm -rf $RPM_BUILD_ROOT%{prefix}/conf/lang/fr
+#rm -rf conf/lang/de
+#rm -rf conf/lang/fr
+#rm -rf $RPM_BUILD_ROOT%{prefix}/conf/lang/de
+#rm -rf $RPM_BUILD_ROOT%{prefix}/conf/lang/fr
%{__make} DESTDIR=$RPM_BUILD_ROOT install
# Install Sound Files
-
%{__make} DESTDIR=$RPM_BUILD_ROOT cd-sounds-install
%{__make} DESTDIR=$RPM_BUILD_ROOT cd-moh-install
@@ -335,7 +388,7 @@
%{__install} -D -m 744 build/freeswitch.init.suse $RPM_BUILD_ROOT/etc/init.d/freeswitch
%else
# On RedHat like
-%{__install} -D -m 744 build/freeswitch.init.redhat $RPM_BUILD_ROOT/etc/init.d/freeswitch
+%{__install} -D -o root -g root -m 0755 build/freeswitch.init.redhat $RPM_BUILD_ROOT/etc/init.d/freeswitch
%endif
# On SuSE make /usr/sbin/rcfreeswitch a link to /etc/init.d/freeswitch
%if 0%{?suse_version} > 100
@@ -373,7 +426,7 @@
%files
%defattr(-,freeswitch,daemon)
%ifos linux
-%dir %attr(0750, freeswitch, daemon) /etc/monit.d
+%dir %attr(0750, root, root) /etc/monit.d
%endif
%dir %attr(0750, freeswitch, daemon) %{prefix}/db
%dir %attr(0750, freeswitch, daemon) %{prefix}/log
@@ -465,7 +518,7 @@
/usr/sbin/rcfreeswitch
%endif
%endif
-%{prefix}/bin/*
+%attr{0755, freeswitch, daemon} %{prefix}/bin/*
%{prefix}/lib/libfreeswitch*.so*
%{prefix}/mod/mod_console.so*
%{prefix}/mod/mod_logfile.so*
@@ -513,6 +566,12 @@
%{prefix}/mod/mod_siren.so
%{prefix}/mod/mod_stress.so
%{prefix}/mod/mod_yaml.so
+%{prefix}/mod/mod_shout.so
+%{prefix}/mod/mod_xml_ldap.so
+%{prefix}/mod/mod_fax.so
+%{prefix}/mod/mod_say_zh.so
+%{prefix}/mod/mod_soundtouch.so
+%{prefix}/mod/mod_vmd.so
%files openzap
%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/tones.conf
@@ -581,9 +640,11 @@
%defattr(-, freeswitch, daemon)
%{prefix}/lib/*.a
%{prefix}/lib/*.la
+%{prefix}/lib/pkgconfig/*
%{prefix}/mod/*.a
%{prefix}/mod/*.la
%{prefix}/include/*.h
+%{prefix}/include/spandsp/*
%files lang-en
%dir %attr(0750, freeswitch, daemon) %{prefix}/conf/lang/en
@@ -594,6 +655,24 @@
%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/lang/en/vm/*.xml
%{prefix}/mod/mod_say_en.so*
+%files lang-de
+%dir %attr(0750, freeswitch, daemon) %{prefix}/conf/lang/de
+%dir %attr(0750, freeswitch, daemon) %{prefix}/conf/lang/de/demo
+%dir %attr(0750, freeswitch, daemon) %{prefix}/conf/lang/de/vm
+%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/lang/de/*.xml
+%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/lang/de/demo/*.xml
+%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/lang/de/vm/*.xml
+%{prefix}/mod/mod_say_de.so*
+
+%files lang-fr
+%dir %attr(0750, freeswitch, daemon) %{prefix}/conf/lang/fr
+%dir %attr(0750, freeswitch, daemon) %{prefix}/conf/lang/fr/demo
+%dir %attr(0750, freeswitch, daemon) %{prefix}/conf/lang/fr/vm
+%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/lang/fr/*.xml
+%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/lang/fr/demo/*.xml
+%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/lang/fr/vm/*.xml
+%{prefix}/mod/mod_say_fr.so*
+
%files moh
%dir %attr(0750, freeswitch, daemon) %{prefix}/sounds/music/8000
%{prefix}/sounds/music/8000/*
@@ -608,7 +687,7 @@
%files cd-moh
%dir %attr(0750, freeswitch, daemon) %{prefix}/sounds/music/48000
-%{prefix}/sounds/music/48000
+%{prefix}/sounds/music/48000/*
%files sounds-en-callie
%dir %attr(0750, freeswitch, daemon) %{prefix}/sounds/en/us/callie/ascii/8000
@@ -694,6 +773,29 @@
%changelog
+* Mon Feb 17 2009 - michal.bielicki(a)halokwadrat.de
+- added mod_python
+- added mod_fax
+- added mod_amrwb.so
+- added mod_celt.so
+- added mod_easyroute.so
+- added mod_http.so
+- added mod_lcr.so
+- added mod_loopback.so
+- added mod_siren.so
+- added mod/mod_stress.so
+- added mod_yaml.so
+- added mod_shout.so
+- added mod_xml_ldap.so
+- added rpms or all sounds
+- openzap is now its own rpm
+- added french
+- added german
+- added missing dependencies
+- added soundfiles with separate rpms
+- added definition of all sourcefiles and added them to the SRPM
+- fixes to monit file
+- changes to redhat init file
* Thu May 22 2008 - michal.bielicki(a)voiceworks.pl
- disabled beta class language stuff
- bumped revision up to rc6
1
0