From c2798d7d11add78317c73db395598f698c1b2de2 Mon Sep 17 00:00:00 2001 From: Brian West Date: Sun, 23 Feb 2014 10:08:02 -0600 Subject: [PATCH] moving phpmod in esl to use swig2.0 which fixes the few issues when you reswig --- libs/esl/php/ESL.php | 133 +++- libs/esl/php/Makefile | 2 +- libs/esl/php/esl_wrap.cpp | 1083 ++++++++++++++++++++----------- libs/esl/php/php_ESL.h | 4 +- libs/esl/php/single_command.php | 7 +- libs/esl/php/test.php | 1 + 6 files changed, 804 insertions(+), 426 deletions(-) diff --git a/libs/esl/php/ESL.php b/libs/esl/php/ESL.php index a35e8feb32..b18fd7d1d4 100644 --- a/libs/esl/php/ESL.php +++ b/libs/esl/php/ESL.php @@ -2,7 +2,7 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.35 + * Version 2.0.7 * * 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 @@ -11,13 +11,12 @@ * ----------------------------------------------------------------------------- */ // Try to load our extension if it's not already loaded. -if (!extension_loaded("ESL")) { +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') { + // PHP_SHLIB_SUFFIX gives 'dylib' on MacOS X but modules are 'so'. + if (PHP_SHLIB_SUFFIX === 'dylib') { if (!dl('ESL.so')) return; } else { if (!dl('ESL.'.PHP_SHLIB_SUFFIX)) return; @@ -36,28 +35,37 @@ abstract class ESL { /* PHP Proxy Classes */ class ESLevent { public $_cPtr=null; + protected $_pData=array(); function __set($var,$value) { $func = 'ESLevent_'.$var.'_set'; - if (function_exists($func)) call_user_func($func,$this->_cPtr,$value); + if (function_exists($func)) return call_user_func($func,$this->_cPtr,$value); + if ($var === 'thisown') return swig_ESL_alter_newobject($this->_cPtr,$value); + $this->_pData[$var] = $value; } function __isset($var) { - return function_exists('ESLevent_'.$var.'_set'); + if (function_exists('ESLevent_'.$var.'_set')) return true; + if ($var === 'thisown') return true; + return array_key_exists($var, $this->_pData); } function __get($var) { $func = 'ESLevent_'.$var.'_get'; if (function_exists($func)) return call_user_func($func,$this->_cPtr); - return null; + if ($var === 'thisown') return swig_ESL_get_newobject($this->_cPtr); + return $this->_pData[$var]; } function __construct($type_or_wrap_me_or_me,$subclass_name_or_free_me=null) { - switch (func_num_args()) { - case 1: $r=new_ESLevent($type_or_wrap_me_or_me); break; - default: $r=new_ESLevent($type_or_wrap_me_or_me,$subclass_name_or_free_me); + if (is_resource($type_or_wrap_me_or_me) && get_resource_type($type_or_wrap_me_or_me) === '_p_ESLevent') { + $this->_cPtr=$type_or_wrap_me_or_me; + return; + } + switch (func_num_args()) { + case 1: $this->_cPtr=new_ESLevent($type_or_wrap_me_or_me); break; + default: $this->_cPtr=new_ESLevent($type_or_wrap_me_or_me,$subclass_name_or_free_me); } - $this->_cPtr=$r; } function serialize($format=null) { @@ -119,15 +127,34 @@ class ESLevent { class ESLconnection { public $_cPtr=null; + protected $_pData=array(); + + function __set($var,$value) { + if ($var === 'thisown') return swig_ESL_alter_newobject($this->_cPtr,$value); + $this->_pData[$var] = $value; + } + + function __isset($var) { + if ($var === 'thisown') return true; + return array_key_exists($var, $this->_pData); + } + + function __get($var) { + if ($var === 'thisown') return swig_ESL_get_newobject($this->_cPtr); + return $this->_pData[$var]; + } function __construct($host_or_socket,$port=null,$user_or_password=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; - case 3: $r=new_ESLconnection($host_or_socket,$port,$user_or_password); break; - default: $r=new_ESLconnection($host_or_socket,$port,$user_or_password,$password); + if (is_resource($host_or_socket) && get_resource_type($host_or_socket) === '_p_ESLconnection') { + $this->_cPtr=$host_or_socket; + return; + } + switch (func_num_args()) { + case 1: $this->_cPtr=new_ESLconnection($host_or_socket); break; + case 2: $this->_cPtr=new_ESLconnection($host_or_socket,$port); break; + case 3: $this->_cPtr=new_ESLconnection($host_or_socket,$port,$user_or_password); break; + default: $this->_cPtr=new_ESLconnection($host_or_socket,$port,$user_or_password,$password); } - $this->_cPtr=$r; } function socketDescriptor() { @@ -140,7 +167,12 @@ class ESLconnection { function getInfo() { $r=ESLconnection_getInfo($this->_cPtr); - return is_resource($r) ? new ESLevent($r) : $r; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new ESLevent($r); + } + return $r; } function send($cmd) { @@ -149,7 +181,12 @@ class ESLconnection { function sendRecv($cmd) { $r=ESLconnection_sendRecv($this->_cPtr,$cmd); - return is_resource($r) ? new ESLevent($r) : $r; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new ESLevent($r); + } + return $r; } function api($cmd,$arg=null) { @@ -157,7 +194,12 @@ class ESLconnection { case 1: $r=ESLconnection_api($this->_cPtr,$cmd); break; default: $r=ESLconnection_api($this->_cPtr,$cmd,$arg); } - return is_resource($r) ? new ESLevent($r) : $r; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new ESLevent($r); + } + return $r; } function bgapi($cmd,$arg=null,$job_uuid=null) { @@ -166,12 +208,22 @@ class ESLconnection { case 2: $r=ESLconnection_bgapi($this->_cPtr,$cmd,$arg); break; default: $r=ESLconnection_bgapi($this->_cPtr,$cmd,$arg,$job_uuid); } - return is_resource($r) ? new ESLevent($r) : $r; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new ESLevent($r); + } + return $r; } function sendEvent($send_me) { $r=ESLconnection_sendEvent($this->_cPtr,$send_me); - return is_resource($r) ? new ESLevent($r) : $r; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new ESLevent($r); + } + return $r; } function sendMSG($send_me,$uuid=null) { @@ -184,17 +236,32 @@ class ESLconnection { function recvEvent() { $r=ESLconnection_recvEvent($this->_cPtr); - return is_resource($r) ? new ESLevent($r) : $r; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new ESLevent($r); + } + return $r; } function recvEventTimed($ms) { $r=ESLconnection_recvEventTimed($this->_cPtr,$ms); - return is_resource($r) ? new ESLevent($r) : $r; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new ESLevent($r); + } + return $r; } function filter($header,$value) { $r=ESLconnection_filter($this->_cPtr,$header,$value); - return is_resource($r) ? new ESLevent($r) : $r; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new ESLevent($r); + } + return $r; } function events($etype,$value) { @@ -207,7 +274,12 @@ class ESLconnection { case 2: $r=ESLconnection_execute($this->_cPtr,$app,$arg); break; default: $r=ESLconnection_execute($this->_cPtr,$app,$arg,$uuid); } - return is_resource($r) ? new ESLevent($r) : $r; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new ESLevent($r); + } + return $r; } function executeAsync($app,$arg=null,$uuid=null) { @@ -216,7 +288,12 @@ class ESLconnection { case 2: $r=ESLconnection_executeAsync($this->_cPtr,$app,$arg); break; default: $r=ESLconnection_executeAsync($this->_cPtr,$app,$arg,$uuid); } - return is_resource($r) ? new ESLevent($r) : $r; + if (is_resource($r)) { + $c=substr(get_resource_type($r), (strpos(get_resource_type($r), '__') ? strpos(get_resource_type($r), '__') + 2 : 3)); + if (class_exists($c)) return new $c($r); + return new ESLevent($r); + } + return $r; } function setAsyncExecute($val) { diff --git a/libs/esl/php/Makefile b/libs/esl/php/Makefile index 97674f85be..7cc42d2725 100644 --- a/libs/esl/php/Makefile +++ b/libs/esl/php/Makefile @@ -16,7 +16,7 @@ WRAP_GCC_WARNING_SILENCE=-Wno-unused-label -Wno-unused-function all: ESL.so esl_wrap.cpp: - swig -module ESL -php5 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i + swig2.0 -module ESL -php5 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i sed -e 's/ char \*type_name;/ const char \*type_name;/' -i esl_wrap.cpp esl_wrap.o: esl_wrap.cpp diff --git a/libs/esl/php/esl_wrap.cpp b/libs/esl/php/esl_wrap.cpp index 0389cc2151..83304bb226 100644 --- a/libs/esl/php/esl_wrap.cpp +++ b/libs/esl/php/esl_wrap.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.35 + * Version 2.0.7 * * 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 @@ -8,20 +8,27 @@ * interface file instead. * ----------------------------------------------------------------------------- */ +#define SWIGPHP + +#define SWIG_PREFIX "" +#define SWIG_PREFIX_LEN 0 #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& 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& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -71,6 +78,12 @@ template T SwigValueInit() { # endif #endif +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) @@ -135,7 +148,7 @@ template T SwigValueInit() { /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -154,11 +167,11 @@ template T SwigValueInit() { /* 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'. + 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. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -185,14 +198,14 @@ template T SwigValueInit() { /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return an 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: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -200,7 +213,7 @@ template T SwigValueInit() { //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -209,7 +222,7 @@ template T SwigValueInit() { // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -227,7 +240,7 @@ template T SwigValueInit() { 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 + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -245,7 +258,7 @@ template T SwigValueInit() { 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. + 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 @@ -259,9 +272,8 @@ template T SwigValueInit() { 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) @@ -286,7 +298,6 @@ template T SwigValueInit() { #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 @@ -309,8 +320,6 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { #endif - - #include #ifdef __cplusplus @@ -407,40 +416,58 @@ SWIG_TypeCompare(const char *nb, const char *tb) { } -/* 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); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + 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; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, 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); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + 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; } /* @@ -703,12 +730,9 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #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. + * phprun.swg * - * php4run.swg - * - * PHP4 runtime library + * PHP runtime library * ----------------------------------------------------------------------------- */ #ifdef __cplusplus @@ -716,7 +740,10 @@ extern "C" { #endif #include "zend.h" #include "zend_API.h" +#include "zend_exceptions.h" #include "php.h" +#include "ext/standard/php_string.h" +#include /* for abort(), used in generated code. */ #ifdef ZEND_RAW_FENTRY /* ZEND_RAW_FENTRY was added somewhere between 5.2.0 and 5.2.3 */ @@ -728,9 +755,18 @@ extern "C" { # define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_NAMED_FE(ZN, N, A) #endif +#ifndef Z_SET_ISREF_P +/* For PHP < 5.3 */ +# define Z_SET_ISREF_P(z) (z)->is_ref = 1 +#endif +#ifndef Z_SET_REFCOUNT_P +/* For PHP < 5.3 */ +# define Z_SET_REFCOUNT_P(z, rc) (z)->refcount = (rc) +#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_STRING_CONSTANT(N, V) zend_register_stringl_constant((char*)#N, sizeof(#N), (char*)(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);\ @@ -774,12 +810,12 @@ static int default_error_code = E_ERROR; 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) +#define SWIG_GetModule(clientdata) SWIG_Php_GetModule() +#define SWIG_SetModule(clientdata, pointer) SWIG_Php_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 { +typedef struct { void * ptr; int newobject; } swig_object_wrapper; @@ -788,10 +824,10 @@ typedef struct _swig_object_wrapper { 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) +#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 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 */ @@ -800,12 +836,56 @@ SWIG_ZTS_SetPointerZval(zval *z, void *ptr, swig_type_info *type, int newobject return; } if (type->clientdata) { + swig_object_wrapper *value; 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)); + value->newobject=(newobject & 1); + if ((newobject & 2) == 0) { + /* Just register the pointer as a resource. */ + ZEND_REGISTER_RESOURCE(z, value, *(int *)(type->clientdata)); + } else { + /* + * Wrap the resource in an object, the resource will be accessible + * via the "_cPtr" member. This is currently only used by + * directorin typemaps. + */ + zval *resource; + zend_class_entry **ce = NULL; + const char *type_name = type->name+3; /* +3 so: _p_Foo -> Foo */ + size_t type_name_len; + int result; + const char * p; + + /* Namespace__Foo -> Foo */ + /* FIXME: ugly and goes wrong for classes with __ in their names. */ + while ((p = strstr(type_name, "__")) != NULL) { + type_name = p + 2; + } + type_name_len = strlen(type_name); + + MAKE_STD_ZVAL(resource); + ZEND_REGISTER_RESOURCE(resource, value, *(int *)(type->clientdata)); + if (SWIG_PREFIX_LEN > 0) { + char * classname = (char*)emalloc(SWIG_PREFIX_LEN + type_name_len + 1); + strcpy(classname, SWIG_PREFIX); + strcpy(classname + SWIG_PREFIX_LEN, type_name); + result = zend_lookup_class(classname, SWIG_PREFIX_LEN + type_name_len, &ce TSRMLS_CC); + efree(classname); + } else { + result = zend_lookup_class((char *)type_name, type_name_len, &ce TSRMLS_CC); + } + if (result != SUCCESS) { + /* class does not exist */ + object_init(z); + } else { + object_init_ex(z, *ce); + } + Z_SET_REFCOUNT_P(z, 1); + Z_SET_ISREF_P(z); + zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval), NULL); + } return; } zend_error(E_ERROR, "Type: %s not registered with zend",type->name); @@ -860,7 +940,7 @@ SWIG_ZTS_ConvertResourcePtr(zval *z, swig_type_info *ty, int flags TSRMLS_DC) { const char *type_name; value = (swig_object_wrapper *) zend_list_find(z->value.lval, &type); - if ( flags && SWIG_POINTER_DISOWN ) { + if ( flags & SWIG_POINTER_DISOWN ) { value->newobject = 0; } p = value->ptr; @@ -903,7 +983,7 @@ SWIG_ZTS_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags TSRMLS_DC } static char const_name[] = "swig_runtime_data_type_pointer"; -static swig_module_info *SWIG_Php4_GetModule() { +static swig_module_info *SWIG_Php_GetModule() { zval *pointer; swig_module_info *ret = 0; @@ -911,7 +991,7 @@ static swig_module_info *SWIG_Php4_GetModule() { TSRMLS_FETCH(); - if (zend_get_constant(const_name, sizeof(const_name), pointer TSRMLS_CC)) { + if (zend_get_constant(const_name, sizeof(const_name) - 1, pointer TSRMLS_CC)) { if (pointer->type == IS_LONG) { ret = (swig_module_info *) pointer->value.lval; } @@ -920,7 +1000,7 @@ static swig_module_info *SWIG_Php4_GetModule() { return ret; } -static void SWIG_Php4_SetModule(swig_module_info *pointer) { +static void SWIG_Php_SetModule(swig_module_info *pointer) { TSRMLS_FETCH(); REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, 0); } @@ -953,6 +1033,15 @@ ZEND_DECLARE_MODULE_GLOBALS(ESL) #define SWIG_ErrorCode() (ESL_globals.error_code) #endif +#ifdef __GNUC__ +static void SWIG_FAIL() __attribute__ ((__noreturn__)); +#endif + +static void SWIG_FAIL() { + zend_error(SWIG_ErrorCode(), "%s", SWIG_ErrorMsg()); + abort(); +} + static void ESL_init_globals(zend_ESL_globals *globals ) { globals->error_msg = default_error_msg; globals->error_code = default_error_code; @@ -964,6 +1053,38 @@ static void SWIG_ResetError() { SWIG_ErrorMsg() = default_error_msg; SWIG_ErrorCode() = default_error_code; } + +ZEND_NAMED_FUNCTION(_wrap_swig_ESL_alter_newobject) { + zval **args[2]; + swig_object_wrapper *value; + int type; + int thisown; + + SWIG_ResetError(); + if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { + WRONG_PARAM_COUNT; + } + + value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type); + value->newobject = zval_is_true(*args[1]); + + return; +} +ZEND_NAMED_FUNCTION(_wrap_swig_ESL_get_newobject) { + zval **args[1]; + swig_object_wrapper *value; + int type; + + SWIG_ResetError(); + if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { + WRONG_PARAM_COUNT; + } + + value = (swig_object_wrapper *) zend_list_find((*args[0])->value.lval, &type); + RETVAL_LONG(value->newobject); + + return; +} #define SWIG_name "ESL" #ifdef __cplusplus extern "C" { @@ -1041,17 +1162,16 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_event_set) { } if (arg1) (arg1)->event = arg2; - return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_event_get) { ESLevent *arg1 = (ESLevent *) 0 ; - esl_event_t *result = 0 ; zval **args[1]; + esl_event_t *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -1065,12 +1185,12 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_event_get) { } 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); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_esl_event_t, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1091,13 +1211,17 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_set) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + convert_to_string_ex(args[1]); + arg2 = (char *) Z_STRVAL_PP(args[1]); + } /*@SWIG@*/; { - if (arg1->serialized_string) delete [] 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); @@ -1108,14 +1232,14 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_set) { return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_get) { ESLevent *arg1 = (ESLevent *) 0 ; - char *result = 0 ; zval **args[1]; + char *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -1133,12 +1257,12 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_get) { if(!result) { ZVAL_NULL(return_value); } else { - ZVAL_STRING(return_value,result, 1); + ZVAL_STRING(return_value, (char *)result, 1); } } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1159,24 +1283,23 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_mine_set) { } 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@*/ + /*@SWIG:/usr/share/swig2.0/php/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()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_mine_get) { ESLevent *arg1 = (ESLevent *) 0 ; - int result; zval **args[1]; + int result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -1195,16 +1318,16 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_mine_get) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } 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; + ESLevent *result = 0 ; SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); @@ -1213,34 +1336,42 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_0) { 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[0])->type==IS_NULL) { + arg1 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 1); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } 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; + ESLevent *result = 0 ; SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); @@ -1254,26 +1385,26 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_1) { } } if(arg_count > 1) { - /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/share/swig2.0/php/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); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 1); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_2) { ESLevent *arg1 = (ESLevent *) 0 ; - ESLevent *result = 0 ; zval **args[1]; + ESLevent *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -1286,12 +1417,12 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_2) { } } result = (ESLevent *)new ESLevent(arg1); - { - SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 1); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 1); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1305,15 +1436,15 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent) { int _v; { void *tmp; - _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_esl_event_t, 0) >= 0); + _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); + _wrap_new_ESLevent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } _v = (Z_TYPE_PP(argv[1]) == IS_LONG); if (_v) { - return _wrap_new_ESLevent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); + _wrap_new_ESLevent__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } } } @@ -1321,10 +1452,10 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent) { int _v; { void *tmp; - _v = (SWIG_ConvertPtr( *argv[0], (void**)&tmp, SWIGTYPE_p_ESLevent, 0) >= 0); + _v = (SWIG_ConvertPtr(*argv[0], (void**)&tmp, SWIGTYPE_p_ESLevent, 0) >= 0); } if (_v) { - return _wrap_new_ESLevent__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); + _wrap_new_ESLevent__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } } if ((argc >= 1) && (argc <= 2)) { @@ -1332,18 +1463,18 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent) { _v = (Z_TYPE_PP(argv[0]) == IS_STRING); if (_v) { if (argc <= 1) { - return _wrap_new_ESLevent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); + _wrap_new_ESLevent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } _v = (Z_TYPE_PP(argv[1]) == IS_STRING); if (_v) { - return _wrap_new_ESLevent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); + _wrap_new_ESLevent__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } } } SWIG_ErrorCode() = E_ERROR; SWIG_ErrorMsg() = "No matching function for overloaded 'new_ESLevent'"; - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1360,16 +1491,18 @@ static void __wrap_delete_ESLevent(zend_rsrc_list_entry *rsrc, const char *type_ 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; - + return; +fail: + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) NULL ; - char *result = 0 ; zval **args[2]; int arg_count; + char *result = 0 ; SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); @@ -1384,9 +1517,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + convert_to_string_ex(args[1]); + arg2 = (char *) Z_STRVAL_PP(args[1]); + } /*@SWIG@*/; } @@ -1395,22 +1532,22 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize) { if(!result) { ZVAL_NULL(return_value); } else { - ZVAL_STRING(return_value,result, 1); + ZVAL_STRING(return_value, (char *)result, 1); } } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } 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; + bool result; SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); @@ -1438,7 +1575,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_setPriority) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1446,9 +1583,9 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_getHeader) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; int arg3 = (int) -1 ; - char *result = 0 ; zval **args[3]; int arg_count; + char *result = 0 ; SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); @@ -1463,13 +1600,17 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_getHeader) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/share/swig2.0/php/utils.i,7,CONVERT_INT_IN@*/ convert_to_long_ex(args[2]); arg3 = (int) Z_LVAL_PP(args[2]); /*@SWIG@*/; @@ -1480,19 +1621,19 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_getHeader) { if(!result) { ZVAL_NULL(return_value); } else { - ZVAL_STRING(return_value,result, 1); + ZVAL_STRING(return_value, (char *)result, 1); } } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_getBody) { ESLevent *arg1 = (ESLevent *) 0 ; - char *result = 0 ; zval **args[1]; + char *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -1510,19 +1651,19 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_getBody) { if(!result) { ZVAL_NULL(return_value); } else { - ZVAL_STRING(return_value,result, 1); + ZVAL_STRING(return_value, (char *)result, 1); } } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_getType) { ESLevent *arg1 = (ESLevent *) 0 ; - char *result = 0 ; zval **args[1]; + char *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -1540,20 +1681,20 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_getType) { if(!result) { ZVAL_NULL(return_value); } else { - ZVAL_STRING(return_value,result, 1); + ZVAL_STRING(return_value, (char *)result, 1); } } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_addBody) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; - bool result; zval **args[2]; + bool result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { @@ -1567,9 +1708,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addBody) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + convert_to_string_ex(args[1]); + arg2 = (char *) Z_STRVAL_PP(args[1]); + } /*@SWIG@*/; result = (bool)(arg1)->addBody((char const *)arg2); @@ -1578,7 +1723,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addBody) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1586,8 +1731,8 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addHeader) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - bool result; zval **args[3]; + bool result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { @@ -1601,15 +1746,23 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addHeader) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + convert_to_string_ex(args[2]); + arg3 = (char *) Z_STRVAL_PP(args[2]); + } /*@SWIG@*/; result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3); @@ -1618,7 +1771,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addHeader) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1626,8 +1779,8 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_pushHeader) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - bool result; zval **args[3]; + bool result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { @@ -1641,15 +1794,23 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_pushHeader) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + convert_to_string_ex(args[2]); + arg3 = (char *) Z_STRVAL_PP(args[2]); + } /*@SWIG@*/; result = (bool)(arg1)->pushHeader((char const *)arg2,(char const *)arg3); @@ -1658,7 +1819,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_pushHeader) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1666,8 +1827,8 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_unshiftHeader) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - bool result; zval **args[3]; + bool result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { @@ -1681,15 +1842,23 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_unshiftHeader) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + convert_to_string_ex(args[2]); + arg3 = (char *) Z_STRVAL_PP(args[2]); + } /*@SWIG@*/; result = (bool)(arg1)->unshiftHeader((char const *)arg2,(char const *)arg3); @@ -1698,15 +1867,15 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_unshiftHeader) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_delHeader) { ESLevent *arg1 = (ESLevent *) 0 ; char *arg2 = (char *) 0 ; - bool result; zval **args[2]; + bool result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { @@ -1720,9 +1889,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_delHeader) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + convert_to_string_ex(args[1]); + arg2 = (char *) Z_STRVAL_PP(args[1]); + } /*@SWIG@*/; result = (bool)(arg1)->delHeader((char const *)arg2); @@ -1731,14 +1904,14 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_delHeader) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_firstHeader) { ESLevent *arg1 = (ESLevent *) 0 ; - char *result = 0 ; zval **args[1]; + char *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -1756,19 +1929,19 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_firstHeader) { if(!result) { ZVAL_NULL(return_value); } else { - ZVAL_STRING(return_value,result, 1); + ZVAL_STRING(return_value, (char *)result, 1); } } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLevent_nextHeader) { ESLevent *arg1 = (ESLevent *) 0 ; - char *result = 0 ; zval **args[1]; + char *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -1786,12 +1959,12 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_nextHeader) { if(!result) { ZVAL_NULL(return_value); } else { - ZVAL_STRING(return_value,result, 1); + ZVAL_STRING(return_value, (char *)result, 1); } } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1800,8 +1973,8 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_0) { int arg2 ; char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; - ESLconnection *result = 0 ; zval **args[4]; + ESLconnection *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) { @@ -1809,36 +1982,48 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_0) { } - /*@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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[0])->type==IS_NULL) { + arg1 = (char *) 0; + } else { + 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,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/share/swig2.0/php/utils.i,7,CONVERT_INT_IN@*/ convert_to_long_ex(args[1]); arg2 = (int) Z_LVAL_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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + convert_to_string_ex(args[2]); + arg3 = (char *) Z_STRVAL_PP(args[2]); + } /*@SWIG@*/; - /*@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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[3])->type==IS_NULL) { + arg4 = (char *) 0; + } else { + convert_to_string_ex(args[3]); + arg4 = (char *) Z_STRVAL_PP(args[3]); + } /*@SWIG@*/; result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4); - { - SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1846,8 +2031,8 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_1) { char *arg1 = (char *) 0 ; int arg2 ; char *arg3 = (char *) 0 ; - ESLconnection *result = 0 ; zval **args[3]; + ESLconnection *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { @@ -1855,30 +2040,38 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_1) { } - /*@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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[0])->type==IS_NULL) { + arg1 = (char *) 0; + } else { + 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,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/share/swig2.0/php/utils.i,7,CONVERT_INT_IN@*/ convert_to_long_ex(args[1]); arg2 = (int) Z_LVAL_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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + convert_to_string_ex(args[2]); + arg3 = (char *) Z_STRVAL_PP(args[2]); + } /*@SWIG@*/; result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3); - { - SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1887,8 +2080,8 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_2) { char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; - ESLconnection *result = 0 ; zval **args[4]; + ESLconnection *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 4 || zend_get_parameters_array_ex(4, args) != SUCCESS) { @@ -1896,36 +2089,52 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_2) { } - /*@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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[0])->type==IS_NULL) { + arg1 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + convert_to_string_ex(args[2]); + arg3 = (char *) Z_STRVAL_PP(args[2]); + } /*@SWIG@*/; - /*@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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[3])->type==IS_NULL) { + arg4 = (char *) 0; + } else { + convert_to_string_ex(args[3]); + arg4 = (char *) Z_STRVAL_PP(args[3]); + } /*@SWIG@*/; result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4); - { - SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -1933,8 +2142,8 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_3) { char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - ESLconnection *result = 0 ; zval **args[3]; + ESLconnection *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { @@ -1942,37 +2151,49 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_3) { } - /*@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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[0])->type==IS_NULL) { + arg1 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + 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); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_4) { int arg1 ; - ESLconnection *result = 0 ; zval **args[1]; + ESLconnection *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -1980,18 +2201,18 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_4) { } - /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/share/swig2.0/php/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); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLconnection, 1); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -2005,7 +2226,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { int _v; _v = (Z_TYPE_PP(argv[0]) == IS_LONG); if (_v) { - return _wrap_new_ESLconnection__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU); + _wrap_new_ESLconnection__SWIG_4(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } } if (argc == 3) { @@ -2016,7 +2237,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { if (_v) { _v = (Z_TYPE_PP(argv[2]) == IS_STRING); if (_v) { - return _wrap_new_ESLconnection__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); + _wrap_new_ESLconnection__SWIG_1(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } } } @@ -2029,7 +2250,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { if (_v) { _v = (Z_TYPE_PP(argv[2]) == IS_STRING); if (_v) { - return _wrap_new_ESLconnection__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU); + _wrap_new_ESLconnection__SWIG_3(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } } } @@ -2044,7 +2265,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { if (_v) { _v = (Z_TYPE_PP(argv[3]) == IS_STRING); if (_v) { - return _wrap_new_ESLconnection__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); + _wrap_new_ESLconnection__SWIG_0(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } } } @@ -2060,7 +2281,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { if (_v) { _v = (Z_TYPE_PP(argv[3]) == IS_STRING); if (_v) { - return _wrap_new_ESLconnection__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); + _wrap_new_ESLconnection__SWIG_2(INTERNAL_FUNCTION_PARAM_PASSTHRU); return; } } } @@ -2069,7 +2290,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection) { SWIG_ErrorCode() = E_ERROR; SWIG_ErrorMsg() = "No matching function for overloaded 'new_ESLconnection'"; - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -2086,14 +2307,16 @@ static void __wrap_delete_ESLconnection(zend_rsrc_list_entry *rsrc, const char * 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; - + return; +fail: + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_socketDescriptor) { ESLconnection *arg1 = (ESLconnection *) 0 ; - int result; zval **args[1]; + int result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -2112,14 +2335,14 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_socketDescriptor) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_connected) { ESLconnection *arg1 = (ESLconnection *) 0 ; - int result; zval **args[1]; + int result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -2138,14 +2361,14 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_connected) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_getInfo) { ESLconnection *arg1 = (ESLconnection *) 0 ; - ESLevent *result = 0 ; zval **args[1]; + ESLevent *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -2159,20 +2382,20 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_getInfo) { } 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); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_send) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; - int result; zval **args[2]; + int result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { @@ -2186,9 +2409,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_send) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + convert_to_string_ex(args[1]); + arg2 = (char *) Z_STRVAL_PP(args[1]); + } /*@SWIG@*/; result = (int)(arg1)->send((char const *)arg2); @@ -2197,15 +2424,15 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_send) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendRecv) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; - ESLevent *result = 0 ; zval **args[2]; + ESLevent *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { @@ -2219,18 +2446,22 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendRecv) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -2238,9 +2469,9 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_api) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) NULL ; - ESLevent *result = 0 ; zval **args[3]; int arg_count; + ESLevent *result = 0 ; SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); @@ -2255,25 +2486,33 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_api) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + convert_to_string_ex(args[2]); + arg3 = (char *) Z_STRVAL_PP(args[2]); + } /*@SWIG@*/; } result = (ESLevent *)(arg1)->api((char const *)arg2,(char const *)arg3); - { - SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -2282,9 +2521,9 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_bgapi) { char *arg2 = (char *) 0 ; char *arg3 = (char *) NULL ; char *arg4 = (char *) NULL ; - ESLevent *result = 0 ; zval **args[4]; int arg_count; + ESLevent *result = 0 ; SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); @@ -2299,40 +2538,52 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_bgapi) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[3])->type==IS_NULL) { + arg4 = (char *) 0; + } else { + convert_to_string_ex(args[3]); + arg4 = (char *) Z_STRVAL_PP(args[3]); + } /*@SWIG@*/; } result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4); - { - SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendEvent) { ESLconnection *arg1 = (ESLconnection *) 0 ; ESLevent *arg2 = (ESLevent *) 0 ; - ESLevent *result = 0 ; zval **args[2]; + ESLevent *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { @@ -2351,12 +2602,12 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendEvent) { } } result = (ESLevent *)(arg1)->sendEvent(arg2); - { - SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -2364,9 +2615,9 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendMSG) { ESLconnection *arg1 = (ESLconnection *) 0 ; ESLevent *arg2 = (ESLevent *) 0 ; char *arg3 = (char *) NULL ; - int result; zval **args[3]; int arg_count; + int result; SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); @@ -2386,9 +2637,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendMSG) { } } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + convert_to_string_ex(args[2]); + arg3 = (char *) Z_STRVAL_PP(args[2]); + } /*@SWIG@*/; } @@ -2398,14 +2653,14 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendMSG) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_recvEvent) { ESLconnection *arg1 = (ESLconnection *) 0 ; - ESLevent *result = 0 ; zval **args[1]; + ESLevent *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -2419,20 +2674,20 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_recvEvent) { } 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); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_recvEventTimed) { ESLconnection *arg1 = (ESLconnection *) 0 ; int arg2 ; - ESLevent *result = 0 ; zval **args[2]; + ESLevent *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { @@ -2446,18 +2701,18 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_recvEventTimed) { } 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@*/ + /*@SWIG:/usr/share/swig2.0/php/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); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -2465,8 +2720,8 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_filter) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - ESLevent *result = 0 ; zval **args[3]; + ESLevent *result = 0 ; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { @@ -2480,24 +2735,32 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_filter) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + convert_to_string_ex(args[2]); + arg3 = (char *) Z_STRVAL_PP(args[2]); + } /*@SWIG@*/; result = (ESLevent *)(arg1)->filter((char const *)arg2,(char const *)arg3); - { - SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -2505,8 +2768,8 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_events) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - int result; zval **args[3]; + int result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_array_ex(3, args) != SUCCESS) { @@ -2520,15 +2783,23 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_events) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + convert_to_string_ex(args[2]); + arg3 = (char *) Z_STRVAL_PP(args[2]); + } /*@SWIG@*/; result = (int)(arg1)->events((char const *)arg2,(char const *)arg3); @@ -2537,7 +2808,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_events) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -2546,9 +2817,9 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute) { char *arg2 = (char *) 0 ; char *arg3 = (char *) NULL ; char *arg4 = (char *) NULL ; - ESLevent *result = 0 ; zval **args[4]; int arg_count; + ESLevent *result = 0 ; SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); @@ -2563,32 +2834,44 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[3])->type==IS_NULL) { + arg4 = (char *) 0; + } else { + convert_to_string_ex(args[3]); + arg4 = (char *) Z_STRVAL_PP(args[3]); + } /*@SWIG@*/; } result = (ESLevent *)(arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4); - { - SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -2597,9 +2880,9 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_executeAsync) { char *arg2 = (char *) 0 ; char *arg3 = (char *) NULL ; char *arg4 = (char *) NULL ; - ESLevent *result = 0 ; zval **args[4]; int arg_count; + ESLevent *result = 0 ; SWIG_ResetError(); arg_count = ZEND_NUM_ARGS(); @@ -2614,40 +2897,52 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_executeAsync) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[2])->type==IS_NULL) { + arg3 = (char *) 0; + } else { + 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[3])->type==IS_NULL) { + arg4 = (char *) 0; + } else { + convert_to_string_ex(args[3]); + arg4 = (char *) Z_STRVAL_PP(args[3]); + } /*@SWIG@*/; } result = (ESLevent *)(arg1)->executeAsync((char const *)arg2,(char const *)arg3,(char const *)arg4); - { - SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); - } + + SWIG_SetPointerZval(return_value, (void *)result, SWIGTYPE_p_ESLevent, 0); + return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setAsyncExecute) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; - int result; zval **args[2]; + int result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { @@ -2661,9 +2956,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setAsyncExecute) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + convert_to_string_ex(args[1]); + arg2 = (char *) Z_STRVAL_PP(args[1]); + } /*@SWIG@*/; result = (int)(arg1)->setAsyncExecute((char const *)arg2); @@ -2672,15 +2971,15 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setAsyncExecute) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setEventLock) { ESLconnection *arg1 = (ESLconnection *) 0 ; char *arg2 = (char *) 0 ; - int result; zval **args[2]; + int result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_array_ex(2, args) != SUCCESS) { @@ -2694,9 +2993,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setEventLock) { } 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:/usr/share/swig2.0/php/utils.i,62,CONVERT_STRING_IN@*/ + if ((*args[1])->type==IS_NULL) { + arg2 = (char *) 0; + } else { + convert_to_string_ex(args[1]); + arg2 = (char *) Z_STRVAL_PP(args[1]); + } /*@SWIG@*/; result = (int)(arg1)->setEventLock((char const *)arg2); @@ -2705,14 +3008,14 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setEventLock) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } ZEND_NAMED_FUNCTION(_wrap_ESLconnection_disconnect) { ESLconnection *arg1 = (ESLconnection *) 0 ; - int result; zval **args[1]; + int result; SWIG_ResetError(); if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) { @@ -2731,7 +3034,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_disconnect) { } return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } @@ -2745,7 +3048,7 @@ ZEND_NAMED_FUNCTION(_wrap_eslSetLogLevel) { } - /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/share/swig2.0/php/utils.i,7,CONVERT_INT_IN@*/ convert_to_long_ex(args[0]); arg1 = (int) Z_LVAL_PP(args[0]); /*@SWIG@*/; @@ -2754,23 +3057,21 @@ ZEND_NAMED_FUNCTION(_wrap_eslSetLogLevel) { return; fail: - zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg()); + SWIG_FAIL(); } -/* NEW Destructor style */ static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_esl_priority_t) { /* No destructor for simple type _p_esl_priority_t */ + efree(rsrc->ptr); } -/* 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_event_t) { /* No destructor for simple type _p_esl_event_t */ + efree(rsrc->ptr); } -/* NEW Destructor style */ static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_ESLconnection) { __wrap_delete_ESLconnection(rsrc, SWIGTYPE_p_ESLconnection->name TSRMLS_CC); } @@ -2820,14 +3121,18 @@ static zend_function_entry ESL_functions[] = { SWIG_ZEND_NAMED_FE(eslconnection_seteventlock,_wrap_ESLconnection_setEventLock,NULL) SWIG_ZEND_NAMED_FE(eslconnection_disconnect,_wrap_ESLconnection_disconnect,NULL) SWIG_ZEND_NAMED_FE(eslsetloglevel,_wrap_eslSetLogLevel,NULL) + SWIG_ZEND_NAMED_FE(swig_ESL_alter_newobject,_wrap_swig_ESL_alter_newobject,NULL) + SWIG_ZEND_NAMED_FE(swig_ESL_get_newobject,_wrap_swig_ESL_get_newobject,NULL) {NULL, NULL, NULL} }; /* init section */ -zend_module_entry ESL_module_entry = { -#if ZEND_MODULE_API_NO > 20010900 - STANDARD_MODULE_HEADER, +#if ZEND_MODULE_API_NO <= 20090626 +#undef ZEND_MODULE_BUILD_ID +#define ZEND_MODULE_BUILD_ID (char*)"API" ZEND_TOSTR(ZEND_MODULE_API_NO) ZEND_BUILD_TS ZEND_BUILD_DEBUG ZEND_BUILD_SYSTEM ZEND_BUILD_EXTRA #endif +zend_module_entry ESL_module_entry = { + STANDARD_MODULE_HEADER, (char*)"ESL", ESL_functions, PHP_MINIT(ESL), @@ -2835,9 +3140,7 @@ zend_module_entry ESL_module_entry = { 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; diff --git a/libs/esl/php/php_ESL.h b/libs/esl/php/php_ESL.h index 41056b3dda..50e80578b3 100644 --- a/libs/esl/php/php_ESL.h +++ b/libs/esl/php/php_ESL.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.35 + * Version 2.0.7 * * 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 @@ -8,8 +8,6 @@ * interface file instead. * ----------------------------------------------------------------------------- */ - - #ifndef PHP_ESL_H #define PHP_ESL_H diff --git a/libs/esl/php/single_command.php b/libs/esl/php/single_command.php index 76d83bc8de..b96079718b 100755 --- a/libs/esl/php/single_command.php +++ b/libs/esl/php/single_command.php @@ -6,10 +6,9 @@ if ($argc > 1) { array_shift($argv); $command = sprintf('%s', implode(' ', $argv)); printf("Command to run is: %s\n", $command); - - $sock = new ESLconnection('localhost', '8021', 'ClueCon'); - $res = $sock->api($command); - printf("%s\n", $res->getBody()); + $esl = new eslConnection('127.0.0.1', '8021', 'ClueCon'); + $e = $esl->api("$command"); + print $e->getBody(); } else { printf("ERROR: You Need To Pass A Command\nUsage:\n\t%s ", $argv[0]); } diff --git a/libs/esl/php/test.php b/libs/esl/php/test.php index 5c4534118a..ed5956457c 100644 --- a/libs/esl/php/test.php +++ b/libs/esl/php/test.php @@ -5,3 +5,4 @@ $esl = new eslConnection('127.0.0.1', '8021', 'ClueCon'); $e = $esl->sendRecv("api status"); print $e->getBody(); +?>