add some methods
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12359 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
6955b86b53
commit
8777ec780e
|
@ -2084,6 +2084,56 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
static int _wrap_ESLevent_firstHeader(lua_State* L) {
|
||||
int SWIG_arg = -1;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("firstHeader",1,1)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("firstHeader",1,"ESLevent *");
|
||||
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
|
||||
SWIG_fail_ptr("ESLevent_firstHeader",1,SWIGTYPE_p_ESLevent);
|
||||
}
|
||||
|
||||
result = (char *)(arg1)->firstHeader();
|
||||
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_nextHeader(lua_State* L) {
|
||||
int SWIG_arg = -1;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("nextHeader",1,1)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("nextHeader",1,"ESLevent *");
|
||||
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
|
||||
SWIG_fail_ptr("ESLevent_nextHeader",1,SWIGTYPE_p_ESLevent);
|
||||
}
|
||||
|
||||
result = (char *)(arg1)->nextHeader();
|
||||
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 void swig_delete_ESLevent(void *obj) {
|
||||
ESLevent *arg1 = (ESLevent *) obj;
|
||||
delete arg1;
|
||||
|
@ -2097,6 +2147,8 @@ static swig_lua_method swig_ESLevent_methods[] = {
|
|||
{"addBody", _wrap_ESLevent_addBody},
|
||||
{"addHeader", _wrap_ESLevent_addHeader},
|
||||
{"delHeader", _wrap_ESLevent_delHeader},
|
||||
{"firstHeader", _wrap_ESLevent_firstHeader},
|
||||
{"nextHeader", _wrap_ESLevent_nextHeader},
|
||||
{0,0}
|
||||
};
|
||||
static swig_lua_attribute swig_ESLevent_attributes[] = {
|
||||
|
|
|
@ -89,6 +89,8 @@ sub DESTROY {
|
|||
*addBody = *ESLc::ESLevent_addBody;
|
||||
*addHeader = *ESLc::ESLevent_addHeader;
|
||||
*delHeader = *ESLc::ESLevent_delHeader;
|
||||
*firstHeader = *ESLc::ESLevent_firstHeader;
|
||||
*nextHeader = *ESLc::ESLevent_nextHeader;
|
||||
sub DISOWN {
|
||||
my $self = shift;
|
||||
my $ptr = tied(%$self);
|
||||
|
|
|
@ -2504,6 +2504,62 @@ XS(_wrap_ESLevent_delHeader) {
|
|||
}
|
||||
|
||||
|
||||
XS(_wrap_ESLevent_firstHeader) {
|
||||
{
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: ESLevent_firstHeader(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_firstHeader" "', argument " "1"" of type '" "ESLevent *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< ESLevent * >(argp1);
|
||||
result = (char *)(arg1)->firstHeader();
|
||||
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_ESLevent_nextHeader) {
|
||||
{
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int argvi = 0;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: ESLevent_nextHeader(self);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_nextHeader" "', argument " "1"" of type '" "ESLevent *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< ESLevent * >(argp1);
|
||||
result = (char *)(arg1)->nextHeader();
|
||||
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_new_ESLconnection__SWIG_0) {
|
||||
{
|
||||
char *arg1 = (char *) 0 ;
|
||||
|
@ -3361,6 +3417,8 @@ static swig_command_info swig_commands[] = {
|
|||
{"ESLc::ESLevent_addBody", _wrap_ESLevent_addBody},
|
||||
{"ESLc::ESLevent_addHeader", _wrap_ESLevent_addHeader},
|
||||
{"ESLc::ESLevent_delHeader", _wrap_ESLevent_delHeader},
|
||||
{"ESLc::ESLevent_firstHeader", _wrap_ESLevent_firstHeader},
|
||||
{"ESLc::ESLevent_nextHeader", _wrap_ESLevent_nextHeader},
|
||||
{"ESLc::new_ESLconnection", _wrap_new_ESLconnection},
|
||||
{"ESLc::delete_ESLconnection", _wrap_delete_ESLconnection},
|
||||
{"ESLc::ESLconnection_connected", _wrap_ESLconnection_connected},
|
||||
|
|
|
@ -4,12 +4,18 @@ my $con = new ESL::ESLconnection("localhost", "8021", "ClueCon");
|
|||
|
||||
$con->events("plain", "all");
|
||||
|
||||
for(;;) {
|
||||
while($con->connected()) {
|
||||
#my $e = $con->recvEventTimed(100);
|
||||
my $e = $con->recvEvent();
|
||||
|
||||
if ($e) {
|
||||
print $e->serialize();
|
||||
#print $e->serialize();
|
||||
my $h = $e->firstHeader();
|
||||
while ($h) {
|
||||
printf "Header: [%s] = [%s]\n", $h, $e->getHeader($h);
|
||||
$h = $e->nextHeader();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -99,6 +99,14 @@ class ESLevent {
|
|||
function delHeader($header_name) {
|
||||
return ESLevent_delHeader($this->_cPtr,$header_name);
|
||||
}
|
||||
|
||||
function firstHeader() {
|
||||
return ESLevent_firstHeader($this->_cPtr);
|
||||
}
|
||||
|
||||
function nextHeader() {
|
||||
return ESLevent_nextHeader($this->_cPtr);
|
||||
}
|
||||
}
|
||||
|
||||
class ESLconnection {
|
||||
|
|
|
@ -1091,7 +1091,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_set) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1159,7 +1159,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_mine_set) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1213,13 +1213,13 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_0) {
|
|||
WRONG_PARAM_COUNT;
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1254,7 +1254,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_1) {
|
|||
}
|
||||
}
|
||||
if(arg_count > 1) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1384,7 +1384,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
if(arg_count > 1) {
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1460,7 +1460,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_getHeader) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1557,7 +1557,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addBody) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1591,13 +1591,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addHeader) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1630,7 +1630,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_delHeader) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1645,6 +1645,66 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
ZEND_NAMED_FUNCTION(_wrap_ESLevent_firstHeader) {
|
||||
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_firstHeader. Expected SWIGTYPE_p_ESLevent");
|
||||
}
|
||||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
result = (char *)(arg1)->firstHeader();
|
||||
{
|
||||
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_nextHeader) {
|
||||
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_nextHeader. Expected SWIGTYPE_p_ESLevent");
|
||||
}
|
||||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
result = (char *)(arg1)->nextHeader();
|
||||
{
|
||||
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_new_ESLconnection__SWIG_0) {
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
@ -1658,19 +1718,19 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_0) {
|
|||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1696,7 +1756,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_1) {
|
|||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1831,7 +1891,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_send) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1864,7 +1924,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendRecv) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1900,13 +1960,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_api) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -1943,13 +2003,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_bgapi) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -2041,7 +2101,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_recvEventTimed) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -2075,13 +2135,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_filter) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -2115,13 +2175,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_events) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -2158,20 +2218,20 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -2205,7 +2265,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setBlockingExecute) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -2238,7 +2298,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setEventLock) {
|
|||
}
|
||||
if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -2263,7 +2323,7 @@ ZEND_NAMED_FUNCTION(_wrap_eslSetLogLevel) {
|
|||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/
|
||||
/*@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@*/;
|
||||
|
@ -2314,6 +2374,8 @@ static zend_function_entry ESL_functions[] = {
|
|||
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(eslevent_firstheader,_wrap_ESLevent_firstHeader,NULL)
|
||||
SWIG_ZEND_NAMED_FE(eslevent_nextheader,_wrap_ESLevent_nextHeader,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)
|
||||
|
|
|
@ -47,6 +47,8 @@ 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_ESLevent_firstHeader);
|
||||
ZEND_NAMED_FUNCTION(_wrap_ESLevent_nextHeader);
|
||||
ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection);
|
||||
ZEND_NAMED_FUNCTION(_wrap_ESLconnection_connected);
|
||||
ZEND_NAMED_FUNCTION(_wrap_ESLconnection_getInfo);
|
||||
|
|
|
@ -60,6 +60,8 @@ class ESLevent:
|
|||
def addBody(*args): return apply(__ESL.ESLevent_addBody, args)
|
||||
def addHeader(*args): return apply(__ESL.ESLevent_addHeader, args)
|
||||
def delHeader(*args): return apply(__ESL.ESLevent_delHeader, args)
|
||||
def firstHeader(*args): return apply(__ESL.ESLevent_firstHeader, args)
|
||||
def nextHeader(*args): return apply(__ESL.ESLevent_nextHeader, args)
|
||||
ESLevent_swigregister = __ESL.ESLevent_swigregister
|
||||
ESLevent_swigregister(ESLevent)
|
||||
|
||||
|
|
|
@ -3469,6 +3469,50 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ESLevent_firstHeader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:ESLevent_firstHeader",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_firstHeader" "', argument " "1"" of type '" "ESLevent *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< ESLevent * >(argp1);
|
||||
result = (char *)(arg1)->firstHeader();
|
||||
resultobj = SWIG_FromCharPtr((const char *)result);
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ESLevent_nextHeader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:ESLevent_nextHeader",&obj0)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLevent_nextHeader" "', argument " "1"" of type '" "ESLevent *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< ESLevent * >(argp1);
|
||||
result = (char *)(arg1)->nextHeader();
|
||||
resultobj = SWIG_FromCharPtr((const char *)result);
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *ESLevent_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *obj;
|
||||
if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
|
||||
|
@ -4174,6 +4218,8 @@ static PyMethodDef SwigMethods[] = {
|
|||
{ (char *)"ESLevent_addBody", _wrap_ESLevent_addBody, METH_VARARGS, NULL},
|
||||
{ (char *)"ESLevent_addHeader", _wrap_ESLevent_addHeader, METH_VARARGS, NULL},
|
||||
{ (char *)"ESLevent_delHeader", _wrap_ESLevent_delHeader, METH_VARARGS, NULL},
|
||||
{ (char *)"ESLevent_firstHeader", _wrap_ESLevent_firstHeader, METH_VARARGS, NULL},
|
||||
{ (char *)"ESLevent_nextHeader", _wrap_ESLevent_nextHeader, METH_VARARGS, NULL},
|
||||
{ (char *)"ESLevent_swigregister", ESLevent_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"new_ESLconnection", _wrap_new_ESLconnection, METH_VARARGS, NULL},
|
||||
{ (char *)"delete_ESLconnection", _wrap_delete_ESLconnection, METH_VARARGS, NULL},
|
||||
|
|
|
@ -1902,7 +1902,7 @@ SWIG_ruby_failed(void)
|
|||
}
|
||||
|
||||
|
||||
/*@SWIG:/usr/share/swig/1.3.35/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
|
||||
/*@SWIG:/usr/local/share/swig/1.3.35/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
|
||||
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
|
||||
{
|
||||
VALUE obj = args[0];
|
||||
|
@ -2591,6 +2591,54 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
SWIGINTERN VALUE
|
||||
_wrap_ESLevent_firstHeader(int argc, VALUE *argv, VALUE self) {
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
VALUE vresult = Qnil;
|
||||
|
||||
if ((argc < 0) || (argc > 0)) {
|
||||
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","firstHeader", 1, self ));
|
||||
}
|
||||
arg1 = reinterpret_cast< ESLevent * >(argp1);
|
||||
result = (char *)(arg1)->firstHeader();
|
||||
vresult = SWIG_FromCharPtr((const char *)result);
|
||||
return vresult;
|
||||
fail:
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN VALUE
|
||||
_wrap_ESLevent_nextHeader(int argc, VALUE *argv, VALUE self) {
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
VALUE vresult = Qnil;
|
||||
|
||||
if ((argc < 0) || (argc > 0)) {
|
||||
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLevent, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLevent *","nextHeader", 1, self ));
|
||||
}
|
||||
arg1 = reinterpret_cast< ESLevent * >(argp1);
|
||||
result = (char *)(arg1)->nextHeader();
|
||||
vresult = SWIG_FromCharPtr((const char *)result);
|
||||
return vresult;
|
||||
fail:
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
||||
swig_class cESLconnection;
|
||||
|
||||
SWIGINTERN VALUE
|
||||
|
@ -3586,6 +3634,8 @@ SWIGEXPORT void Init_ESL(void) {
|
|||
rb_define_method(cESLevent.klass, "addBody", VALUEFUNC(_wrap_ESLevent_addBody), -1);
|
||||
rb_define_method(cESLevent.klass, "addHeader", VALUEFUNC(_wrap_ESLevent_addHeader), -1);
|
||||
rb_define_method(cESLevent.klass, "delHeader", VALUEFUNC(_wrap_ESLevent_delHeader), -1);
|
||||
rb_define_method(cESLevent.klass, "firstHeader", VALUEFUNC(_wrap_ESLevent_firstHeader), -1);
|
||||
rb_define_method(cESLevent.klass, "nextHeader", VALUEFUNC(_wrap_ESLevent_nextHeader), -1);
|
||||
cESLevent.mark = 0;
|
||||
cESLevent.destroy = (void (*)(void *)) free_ESLevent;
|
||||
cESLevent.trackObjects = 0;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <esl_oop.h>
|
||||
|
||||
#define connection_construct_common() memset(&handle, 0, sizeof(handle)); last_event_obj = NULL
|
||||
#define event_construct_common() event = NULL; serialized_string = NULL; mine = 0
|
||||
#define event_construct_common() event = NULL; serialized_string = NULL; mine = 0; hp = NULL
|
||||
|
||||
void eslSetLogLevel(int level)
|
||||
{
|
||||
|
@ -264,6 +264,26 @@ ESLevent::~ESLevent()
|
|||
}
|
||||
}
|
||||
|
||||
const char *ESLevent::nextHeader(void)
|
||||
{
|
||||
const char *name = NULL;
|
||||
|
||||
if (hp) {
|
||||
name = hp->name;
|
||||
hp = hp->next;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
const char *ESLevent::firstHeader(void)
|
||||
{
|
||||
if (event) {
|
||||
hp = event->headers;
|
||||
}
|
||||
|
||||
return nextHeader();
|
||||
}
|
||||
|
||||
const char *ESLevent::serialize(const char *format)
|
||||
{
|
||||
|
|
|
@ -44,6 +44,8 @@ EXTERN_C
|
|||
|
||||
|
||||
class ESLevent {
|
||||
private:
|
||||
esl_event_header_t *hp;
|
||||
public:
|
||||
esl_event_t *event;
|
||||
char *serialized_string;
|
||||
|
@ -61,6 +63,8 @@ class ESLevent {
|
|||
bool addBody(const char *value);
|
||||
bool addHeader(const char *header_name, const char *value);
|
||||
bool delHeader(const char *header_name);
|
||||
const char *firstHeader(void);
|
||||
const char *nextHeader(void);
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue