diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java index bd99bbc43b..30350b001e 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java @@ -41,16 +41,16 @@ public class Stream { this(freeswitchJNI.new_Stream__SWIG_1(SWIGTYPE_p_switch_stream_handle_t.getCPtr(arg0)), true); } - public SWIGTYPE_p_std__string read() { - return new SWIGTYPE_p_std__string(freeswitchJNI.Stream_read(swigCPtr, this), true); + public String read(SWIGTYPE_p_int len) { + return freeswitchJNI.Stream_read(swigCPtr, this, SWIGTYPE_p_int.getCPtr(len)); } public void write(String data) { freeswitchJNI.Stream_write(swigCPtr, this, data); } - public void raw_write(SWIGTYPE_p_std__string data) { - freeswitchJNI.Stream_raw_write(swigCPtr, this, SWIGTYPE_p_std__string.getCPtr(data)); + public void raw_write(String data, int len) { + freeswitchJNI.Stream_raw_write(swigCPtr, this, data, len); } public String get_data() { diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java index 6e8f6aee86..359bd8b5bc 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java @@ -47,9 +47,9 @@ class freeswitchJNI { public final static native long new_Stream__SWIG_0(); public final static native long new_Stream__SWIG_1(long jarg1); public final static native void delete_Stream(long jarg1); - public final static native long Stream_read(long jarg1, Stream jarg1_); + public final static native String Stream_read(long jarg1, Stream jarg1_, long jarg2); public final static native void Stream_write(long jarg1, Stream jarg1_, String jarg2); - public final static native void Stream_raw_write(long jarg1, Stream jarg1_, long jarg2); + public final static native void Stream_raw_write(long jarg1, Stream jarg1_, String jarg2, int jarg3); public final static native String Stream_get_data(long jarg1, Stream jarg1_); public final static native void Event_event_set(long jarg1, Event jarg1_, long jarg2); public final static native long Event_event_get(long jarg1, Event jarg1_); diff --git a/src/mod/languages/mod_java/switch_swig_wrap.cpp b/src/mod/languages/mod_java/switch_swig_wrap.cpp index 115707859e..a24b28ceaa 100644 --- a/src/mod/languages/mod_java/switch_swig_wrap.cpp +++ b/src/mod/languages/mod_java/switch_swig_wrap.cpp @@ -972,17 +972,19 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1Stream(JN } -SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; +SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { + jstring jresult = 0 ; Stream *arg1 = (Stream *) 0 ; - std::string result; + int *arg2 = (int *) 0 ; + char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(Stream **)&jarg1; - result = (arg1)->read(); - *(std::string **)&jresult = new std::string((std::string &)result); + arg2 = *(int **)&jarg2; + result = (char *)(arg1)->read(arg2); + if(result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } @@ -1005,22 +1007,23 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1write(JNI } -SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1raw_1write(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { +SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1raw_1write(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { Stream *arg1 = (Stream *) 0 ; - std::string arg2 ; - std::string *argp2 ; + char *arg2 = (char *) 0 ; + int arg3 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(Stream **)&jarg1; - argp2 = *(std::string **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null std::string"); - return ; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return ; } - arg2 = *argp2; - (arg1)->raw_write(arg2); + arg3 = (int)jarg3; + (arg1)->raw_write((char const *)arg2,arg3); + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); } diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index 5c4483a240..17af7c5b33 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -1495,10 +1495,10 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { #define SWIGTYPE_p_SWIGLUA_FN swig_types[8] #define SWIGTYPE_p_Stream swig_types[9] #define SWIGTYPE_p_input_callback_state swig_types[10] -#define SWIGTYPE_p_lua_State swig_types[11] -#define SWIGTYPE_p_p_switch_event_node_t swig_types[12] -#define SWIGTYPE_p_session_flag_t swig_types[13] -#define SWIGTYPE_p_std__string swig_types[14] +#define SWIGTYPE_p_int swig_types[11] +#define SWIGTYPE_p_lua_State swig_types[12] +#define SWIGTYPE_p_p_switch_event_node_t swig_types[13] +#define SWIGTYPE_p_session_flag_t swig_types[14] #define SWIGTYPE_p_switch_call_cause_t swig_types[15] #define SWIGTYPE_p_switch_channel_state_t swig_types[16] #define SWIGTYPE_p_switch_channel_t swig_types[17] @@ -1538,272 +1538,163 @@ typedef struct{} LANGUAGE_OBJ; #include "freeswitch_lua.h" - #include +#ifdef __cplusplus /* generic alloc/dealloc fns*/ +#define SWIG_ALLOC_ARRAY(TYPE,LEN) new TYPE[LEN] +#define SWIG_FREE_ARRAY(PTR) delete[] PTR; +#else +#define SWIG_ALLOC_ARRAY(TYPE,LEN) (TYPE *)malloc(LEN*sizeof(TYPE)) +#define SWIG_FREE_ARRAY(PTR) free(PTR); +#endif +/* counting the size of arrays:*/ +int SWIG_itable_size(lua_State* L, int index) +{ + int n=0; + while(1){ + lua_rawgeti(L,index,n+1); + if (lua_isnil(L,-1))break; + ++n; + lua_pop(L,1); + } + lua_pop(L,1); + return n; +} + +int SWIG_table_size(lua_State* L, int index) +{ + int n=0; + lua_pushnil(L); /* first key*/ + while (lua_next(L, index) != 0) { + ++n; + lua_pop(L, 1); /* removes `value'; keeps `key' for next iteration*/ + } + return n; +} + +/* super macro to declare array typemap helper fns */ +#define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\ + int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\ + int i;\ + for (i = 0; i < size; i++) {\ + lua_rawgeti(L,index,i+1);\ + if (lua_isnumber(L,-1)){\ + array[i] = (TYPE)lua_tonumber(L,-1);\ + } else {\ + lua_pop(L,1);\ + return 0;\ + }\ + lua_pop(L,1);\ + }\ + return 1;\ + }\ + static TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\ + TYPE *array;\ + if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\ + lua_pushfstring(L,"expected a table of size %d",size);\ + return 0;\ + }\ + array=SWIG_ALLOC_ARRAY(TYPE,size);\ + if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\ + lua_pushstring(L,"table must contain numbers");\ + SWIG_FREE_ARRAY(array);\ + return 0;\ + }\ + return array;\ + }\ + static TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\ + {\ + TYPE *array;\ + if (!lua_istable(L,index)) {\ + lua_pushstring(L,"expected a table");\ + return 0;\ + }\ + *size=SWIG_itable_size(L,index);\ + if (*size<1){\ + lua_pushstring(L,"table appears to be empty");\ + return 0;\ + }\ + array=SWIG_ALLOC_ARRAY(TYPE,*size);\ + if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\ + lua_pushstring(L,"table must contain numbers");\ + SWIG_FREE_ARRAY(array);\ + return 0;\ + }\ + return array;\ + }\ + void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\ + int i;\ + lua_newtable(L);\ + for (i = 0; i < size; i++){\ + lua_pushnumber(L,(lua_Number)array[i]);\ + lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \ + }\ + } + +SWIG_DECLARE_TYPEMAP_ARR_FN(int,int); +SWIG_DECLARE_TYPEMAP_ARR_FN(uint,unsigned int); +SWIG_DECLARE_TYPEMAP_ARR_FN(short,short); +SWIG_DECLARE_TYPEMAP_ARR_FN(ushort,unsigned short); +SWIG_DECLARE_TYPEMAP_ARR_FN(long,long); +SWIG_DECLARE_TYPEMAP_ARR_FN(ulong,unsigned long); +SWIG_DECLARE_TYPEMAP_ARR_FN(float,float); +SWIG_DECLARE_TYPEMAP_ARR_FN(double,double); + +int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){ + int i; + for (i = 0; i < size; i++) { + lua_rawgeti(L,index,i+1); + if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){ + lua_pop(L,1); + return 0; + } + lua_pop(L,1); + } + return 1; +} +static void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){ + void **array; + if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) { + lua_pushfstring(L,"expected a table of size %d",size); + return 0; + } + array=SWIG_ALLOC_ARRAY(void*,size); + if (!SWIG_read_ptr_array(L,index,array,size,type)){ + lua_pushfstring(L,"table must contain pointers of type %s",type->name); + SWIG_FREE_ARRAY(array); + return 0; + } + return array; +} +static void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){ + void **array; + if (!lua_istable(L,index)) { + lua_pushstring(L,"expected a table"); + return 0; + } + *size=SWIG_itable_size(L,index); + if (*size<1){ + lua_pushstring(L,"table appears to be empty"); + return 0; + } + array=SWIG_ALLOC_ARRAY(void*,*size); + if (!SWIG_read_ptr_array(L,index,array,*size,type)){ + lua_pushfstring(L,"table must contain pointers of type %s",type->name); + SWIG_FREE_ARRAY(array); + return 0; + } + return array; +} +void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){ + int i; + lua_newtable(L); + for (i = 0; i < size; i++){ + SWIG_NewPointerObj(L,array[i],type,own); + lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ + } +} #ifdef __cplusplus extern "C" { #endif -static int _wrap_new_string__SWIG_0(lua_State* L) { - int SWIG_arg = -1; - std::string *result = 0 ; - - SWIG_check_num_args("std::string",0,0) - result = (std::string *)new std::string(); - SWIG_arg=0; - SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_string__SWIG_1(lua_State* L) { - int SWIG_arg = -1; - char *arg1 = (char *) 0 ; - std::string *result = 0 ; - - SWIG_check_num_args("std::string",1,1) - if(!lua_isstring(L,1)) SWIG_fail_arg("std::string",1,"char const *"); - arg1 = (char *)lua_tostring(L, 1); - result = (std::string *)new std::string((char const *)arg1); - SWIG_arg=0; - SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_string(lua_State* L) { - int argc; - int argv[2]={ - 1,2 - }; - - argc = lua_gettop(L); - if (argc == 0) { - return _wrap_new_string__SWIG_0(L); - } - if (argc == 1) { - int _v; - { - _v = lua_isstring(L,argv[0]); - } - if (_v) { - return _wrap_new_string__SWIG_1(L); - } - } - - lua_pushstring(L,"No matching function for overloaded 'new_string'"); - lua_error(L);return 0; -} - - -static int _wrap_string_size(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - unsigned int result; - - SWIG_check_num_args("size",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("size",1,"std::string const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_size",1,SWIGTYPE_p_std__string); - } - - result = (unsigned int)((std::string const *)arg1)->size(); - SWIG_arg=0; - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_string_length(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - unsigned int result; - - SWIG_check_num_args("length",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("length",1,"std::string const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_length",1,SWIGTYPE_p_std__string); - } - - result = (unsigned int)((std::string const *)arg1)->length(); - SWIG_arg=0; - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_string_empty(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - bool result; - - SWIG_check_num_args("empty",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("empty",1,"std::string const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_empty",1,SWIGTYPE_p_std__string); - } - - result = (bool)((std::string const *)arg1)->empty(); - SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_string_c_str(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - char *result = 0 ; - - SWIG_check_num_args("c_str",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("c_str",1,"std::string const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_c_str",1,SWIGTYPE_p_std__string); - } - - result = (char *)((std::string const *)arg1)->c_str(); - 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_string_data(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - char *result = 0 ; - - SWIG_check_num_args("data",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("data",1,"std::string const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_data",1,SWIGTYPE_p_std__string); - } - - result = (char *)((std::string const *)arg1)->data(); - 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_string_assign(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - char *arg2 = (char *) 0 ; - - SWIG_check_num_args("assign",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("assign",1,"std::string *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("assign",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_assign",1,SWIGTYPE_p_std__string); - } - - arg2 = (char *)lua_tostring(L, 2); - (arg1)->assign((char const *)arg2); - SWIG_arg=0; - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_delete_string(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - - SWIG_check_num_args("std::string::~string",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::~string",1,"std::string *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_string",1,SWIGTYPE_p_std__string); - } - - delete arg1; - - SWIG_arg=0; - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static void swig_delete_string(void *obj) { -std::string *arg1 = (std::string *) obj; -delete arg1; -} -static swig_lua_method swig_std_string_methods[] = { - {"size", _wrap_string_size}, - {"length", _wrap_string_length}, - {"empty", _wrap_string_empty}, - {"c_str", _wrap_string_c_str}, - {"data", _wrap_string_data}, - {"assign", _wrap_string_assign}, - {0,0} -}; -static swig_lua_attribute swig_std_string_attributes[] = { - {0,0,0} -}; -static swig_lua_class *swig_std_string_bases[] = {0}; -static const char *swig_std_string_base_names[] = {0}; -static swig_lua_class _wrap_class_std_string = { "string", &SWIGTYPE_p_std__string,_wrap_new_string, swig_delete_string, swig_std_string_methods, swig_std_string_attributes, swig_std_string_bases, swig_std_string_base_names }; - static int _wrap_setGlobalVariable(lua_State* L) { int SWIG_arg = -1; char *arg1 = (char *) 0 ; @@ -2894,8 +2785,11 @@ fail: static int _wrap_Stream_read(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; - std::string result; + int *arg2 = (int *) 0 ; + char *result = 0 ; + int temp2 ; + arg2 = &temp2; SWIG_check_num_args("read",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"Stream *"); @@ -2903,9 +2797,10 @@ static int _wrap_Stream_read(lua_State* L) { SWIG_fail_ptr("Stream_read",1,SWIGTYPE_p_Stream); } - result = (arg1)->read(); + result = (char *)(arg1)->read(arg2); SWIG_arg=0; - lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -2947,17 +2842,20 @@ static int _wrap_Stream_raw_write(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; char *arg2 = (char *) 0 ; - - SWIG_check_num_args("raw_write",2,2) + int arg3 ; + + SWIG_check_num_args("raw_write",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raw_write",1,"Stream *"); if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"char const *"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("raw_write",3,"int"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ SWIG_fail_ptr("Stream_raw_write",1,SWIGTYPE_p_Stream); } arg2 = (char *)lua_tostring(L, 2); - (arg1)->raw_write((char const *)arg2,lua_rawlen(L, 2)); + arg3 = (int)lua_tonumber(L, 3); + (arg1)->raw_write((char const *)arg2,arg3); SWIG_arg=0; return SWIG_arg; @@ -8383,10 +8281,10 @@ static swig_type_info _swigt__p_LUA__Session = {"_p_LUA__Session", "LUA::Session static swig_type_info _swigt__p_SWIGLUA_FN = {"_p_SWIGLUA_FN", "SWIGLUA_FN *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)&_wrap_class_Stream, 0}; static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state_t, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_lua_State = {"_p_lua_State", "lua_State *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_switch_event_node_t = {"_p_p_switch_event_node_t", "switch_event_node_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_session_flag_t = {"_p_session_flag_t", "enum session_flag_t *|session_flag_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)&_wrap_class_std_string, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -8415,10 +8313,10 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_SWIGLUA_FN, &_swigt__p_Stream, &_swigt__p_input_callback_state, + &_swigt__p_int, &_swigt__p_lua_State, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, - &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -8447,10 +8345,10 @@ static swig_cast_info _swigc__p_LUA__Session[] = { {&_swigt__p_LUA__Session, 0, static swig_cast_info _swigc__p_SWIGLUA_FN[] = { {&_swigt__p_SWIGLUA_FN, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_lua_State[] = { {&_swigt__p_lua_State, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -8479,10 +8377,10 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_SWIGLUA_FN, _swigc__p_Stream, _swigc__p_input_callback_state, + _swigc__p_int, _swigc__p_lua_State, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, - _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, diff --git a/src/mod/languages/mod_perl/mod_perl_wrap.cpp b/src/mod/languages/mod_perl/mod_perl_wrap.cpp index 87885f798d..e581200ba4 100644 --- a/src/mod/languages/mod_perl/mod_perl_wrap.cpp +++ b/src/mod/languages/mod_perl/mod_perl_wrap.cpp @@ -1457,9 +1457,9 @@ SWIG_Perl_SetModule(swig_module_info *module) { #define SWIGTYPE_p_Stream swig_types[8] #define SWIGTYPE_p_char swig_types[9] #define SWIGTYPE_p_input_callback_state swig_types[10] -#define SWIGTYPE_p_p_switch_event_node_t swig_types[11] -#define SWIGTYPE_p_session_flag_t swig_types[12] -#define SWIGTYPE_p_std__string swig_types[13] +#define SWIGTYPE_p_int swig_types[11] +#define SWIGTYPE_p_p_switch_event_node_t swig_types[12] +#define SWIGTYPE_p_session_flag_t swig_types[13] #define SWIGTYPE_p_switch_call_cause_t swig_types[14] #define SWIGTYPE_p_switch_channel_state_t swig_types[15] #define SWIGTYPE_p_switch_channel_t swig_types[16] @@ -3403,26 +3403,36 @@ XS(_wrap_delete_Stream) { XS(_wrap_Stream_read) { { Stream *arg1 = (Stream *) 0 ; - std::string result; + int *arg2 = (int *) 0 ; + char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; int argvi = 0; dXSARGS; - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Stream_read(self);"); + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: Stream_read(self,len);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Stream, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_read" "', argument " "1"" of type '" "Stream *""'"); } arg1 = reinterpret_cast< Stream * >(argp1); - result = (arg1)->read(); - ST(argvi) = SWIG_NewPointerObj((new std::string(static_cast< const std::string& >(result))), SWIGTYPE_p_std__string, SWIG_POINTER_OWN | 0); argvi++ ; + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_read" "', argument " "2"" of type '" "int *""'"); + } + arg2 = reinterpret_cast< int * >(argp2); + result = (char *)(arg1)->read(arg2); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + XSRETURN(argvi); fail: + SWIG_croak_null(); } } @@ -3469,39 +3479,46 @@ XS(_wrap_Stream_write) { XS(_wrap_Stream_raw_write) { { Stream *arg1 = (Stream *) 0 ; - std::string arg2 ; + char *arg2 = (char *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; int argvi = 0; dXSARGS; - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Stream_raw_write(self,data);"); + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: Stream_raw_write(self,data,len);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Stream, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_raw_write" "', argument " "1"" of type '" "Stream *""'"); } arg1 = reinterpret_cast< Stream * >(argp1); - { - res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_std__string, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); - } else { - arg2 = *(reinterpret_cast< std::string * >(argp2)); - } + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_raw_write" "', argument " "2"" of type '" "char const *""'"); } - (arg1)->raw_write(arg2); + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Stream_raw_write" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + (arg1)->raw_write((char const *)arg2,arg3); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); } } @@ -9977,9 +9994,9 @@ static swig_type_info _swigt__p_PerlInterpreter = {"_p_PerlInterpreter", "PerlIn static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)"freeswitch::Stream", 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)"freeswitch::input_callback_state_t", 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_switch_event_node_t = {"_p_p_switch_event_node_t", "switch_event_node_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_session_flag_t = {"_p_session_flag_t", "enum session_flag_t *|session_flag_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -10008,9 +10025,9 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Stream, &_swigt__p_char, &_swigt__p_input_callback_state, + &_swigt__p_int, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, - &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -10039,9 +10056,9 @@ static swig_cast_info _swigc__p_PerlInterpreter[] = { {&_swigt__p_PerlInterpret static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -10070,9 +10087,9 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Stream, _swigc__p_char, _swigc__p_input_callback_state, + _swigc__p_int, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, - _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp index 3b2198bc2f..e7afa21ba5 100644 --- a/src/mod/languages/mod_python/mod_python_wrap.cpp +++ b/src/mod/languages/mod_python/mod_python_wrap.cpp @@ -2505,9 +2505,9 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) #define SWIGTYPE_p_Stream swig_types[7] #define SWIGTYPE_p_char swig_types[8] #define SWIGTYPE_p_input_callback_state swig_types[9] -#define SWIGTYPE_p_p_switch_event_node_t swig_types[10] -#define SWIGTYPE_p_session_flag_t swig_types[11] -#define SWIGTYPE_p_std__string swig_types[12] +#define SWIGTYPE_p_int swig_types[10] +#define SWIGTYPE_p_p_switch_event_node_t swig_types[11] +#define SWIGTYPE_p_session_flag_t swig_types[12] #define SWIGTYPE_p_switch_call_cause_t swig_types[13] #define SWIGTYPE_p_switch_channel_state_t swig_types[14] #define SWIGTYPE_p_switch_channel_t swig_types[15] @@ -4336,19 +4336,28 @@ fail: SWIGINTERN PyObject *_wrap_Stream_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Stream *arg1 = (Stream *) 0 ; - std::string result; + int *arg2 = (int *) 0 ; + char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Stream_read",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:Stream_read",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Stream, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_read" "', argument " "1"" of type '" "Stream *""'"); } arg1 = reinterpret_cast< Stream * >(argp1); - result = (arg1)->read(); - resultobj = SWIG_NewPointerObj((new std::string(static_cast< const std::string& >(result))), SWIGTYPE_p_std__string, SWIG_POINTER_OWN | 0 ); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_read" "', argument " "2"" of type '" "int *""'"); + } + arg2 = reinterpret_cast< int * >(argp2); + result = (char *)(arg1)->read(arg2); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; @@ -4391,37 +4400,41 @@ fail: SWIGINTERN PyObject *_wrap_Stream_raw_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Stream *arg1 = (Stream *) 0 ; - std::string arg2 ; + char *arg2 = (char *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Stream_raw_write",&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOO:Stream_raw_write",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Stream, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_raw_write" "', argument " "1"" of type '" "Stream *""'"); } arg1 = reinterpret_cast< Stream * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__string, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); - } else { - std::string * temp = reinterpret_cast< std::string * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_raw_write" "', argument " "2"" of type '" "char const *""'"); } - (arg1)->raw_write(arg2); + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Stream_raw_write" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + (arg1)->raw_write((char const *)arg2,arg3); resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; return NULL; } @@ -9793,9 +9806,9 @@ static swig_type_info _swigt__p_PYTHON__Session = {"_p_PYTHON__Session", "PYTHON static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_switch_event_node_t = {"_p_p_switch_event_node_t", "switch_event_node_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_session_flag_t = {"_p_session_flag_t", "enum session_flag_t *|session_flag_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -9823,9 +9836,9 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Stream, &_swigt__p_char, &_swigt__p_input_callback_state, + &_swigt__p_int, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, - &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -9853,9 +9866,9 @@ static swig_cast_info _swigc__p_PYTHON__Session[] = { {&_swigt__p_PYTHON__Sessi static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -9883,9 +9896,9 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Stream, _swigc__p_char, _swigc__p_input_callback_state, + _swigc__p_int, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, - _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, diff --git a/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp index e21988d418..1e2147f31f 100644 --- a/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp @@ -1495,10 +1495,10 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { #define SWIGTYPE_p_SWIGLUA_FN swig_types[8] #define SWIGTYPE_p_Stream swig_types[9] #define SWIGTYPE_p_input_callback_state swig_types[10] -#define SWIGTYPE_p_lua_State swig_types[11] -#define SWIGTYPE_p_p_switch_event_node_t swig_types[12] -#define SWIGTYPE_p_session_flag_t swig_types[13] -#define SWIGTYPE_p_std__string swig_types[14] +#define SWIGTYPE_p_int swig_types[11] +#define SWIGTYPE_p_lua_State swig_types[12] +#define SWIGTYPE_p_p_switch_event_node_t swig_types[13] +#define SWIGTYPE_p_session_flag_t swig_types[14] #define SWIGTYPE_p_switch_call_cause_t swig_types[15] #define SWIGTYPE_p_switch_channel_state_t swig_types[16] #define SWIGTYPE_p_switch_channel_t swig_types[17] @@ -2630,21 +2630,25 @@ fail: static int _wrap_Stream_read(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; - std::string result; + int *arg2 = (int *) 0 ; + char *result = 0 ; - SWIG_check_num_args("read",1,1) + SWIG_check_num_args("read",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"Stream *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("read",2,"int *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ SWIG_fail_ptr("Stream_read",1,SWIGTYPE_p_Stream); } - result = (arg1)->read(); - SWIG_arg=0; - { - std::string * resultptr = new std::string((std::string &) result); - SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_std__string,1); SWIG_arg++; + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_int,0))){ + SWIG_fail_ptr("Stream_read",2,SWIGTYPE_p_int); } + + result = (char *)(arg1)->read(arg2); + SWIG_arg=0; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -2685,24 +2689,21 @@ fail: static int _wrap_Stream_raw_write(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; - std::string arg2 ; - std::string *argp2 ; + char *arg2 = (char *) 0 ; + int arg3 ; - SWIG_check_num_args("raw_write",2,2) + SWIG_check_num_args("raw_write",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raw_write",1,"Stream *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("raw_write",2,"std::string"); + if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"char const *"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("raw_write",3,"int"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ SWIG_fail_ptr("Stream_raw_write",1,SWIGTYPE_p_Stream); } - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("Stream_raw_write",2,SWIGTYPE_p_std__string); - } - arg2 = *argp2; - - (arg1)->raw_write(arg2); + arg2 = (char *)lua_tostring(L, 2); + arg3 = (int)lua_tonumber(L, 3); + (arg1)->raw_write((char const *)arg2,arg3); SWIG_arg=0; return SWIG_arg; @@ -8128,10 +8129,10 @@ static swig_type_info _swigt__p_LUA__Session = {"_p_LUA__Session", "LUA::Session static swig_type_info _swigt__p_SWIGLUA_FN = {"_p_SWIGLUA_FN", "SWIGLUA_FN *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)&_wrap_class_Stream, 0}; static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state_t, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_lua_State = {"_p_lua_State", "lua_State *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_switch_event_node_t = {"_p_p_switch_event_node_t", "switch_event_node_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_session_flag_t = {"_p_session_flag_t", "enum session_flag_t *|session_flag_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -8160,10 +8161,10 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_SWIGLUA_FN, &_swigt__p_Stream, &_swigt__p_input_callback_state, + &_swigt__p_int, &_swigt__p_lua_State, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, - &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -8192,10 +8193,10 @@ static swig_cast_info _swigc__p_LUA__Session[] = { {&_swigt__p_LUA__Session, 0, static swig_cast_info _swigc__p_SWIGLUA_FN[] = { {&_swigt__p_SWIGLUA_FN, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_lua_State[] = { {&_swigt__p_lua_State, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -8224,10 +8225,10 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_SWIGLUA_FN, _swigc__p_Stream, _swigc__p_input_callback_state, + _swigc__p_int, _swigc__p_lua_State, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, - _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t,