mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
FS-6796 #comment avoid use c++ string since it causing troubles
This commit is contained in:
@@ -33,5 +33,4 @@ lua_wrap: mod_lua_extra.c
|
||||
swig -lua -c++ -I../../../../src/include -oh mod_lua_wrap.h -o mod_lua_wrap.cpp freeswitch.i
|
||||
echo "#include \"mod_lua_extra.c\"" >> mod_lua_wrap.cpp
|
||||
patch -s -p0 -i hack.diff
|
||||
sed -i -e 's/lua_strlen/lua_rawlen/' mod_lua_wrap.cpp
|
||||
|
||||
|
||||
@@ -43,7 +43,8 @@
|
||||
%newobject API::execute;
|
||||
%newobject API::executeString;
|
||||
|
||||
%include "std_string.i"
|
||||
%include "typemaps.i"
|
||||
%apply int *OUTPUT { int *len };
|
||||
|
||||
/**
|
||||
* tell swig to grok everything defined in these header files and
|
||||
|
||||
@@ -2946,18 +2946,18 @@ fail:
|
||||
static int _wrap_Stream_raw_write(lua_State* L) {
|
||||
int SWIG_arg = -1;
|
||||
Stream *arg1 = (Stream *) 0 ;
|
||||
std::string arg2 ;
|
||||
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
SWIG_check_num_args("raw_write",2,2)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raw_write",1,"Stream *");
|
||||
if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"std::string");
|
||||
if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"char const *");
|
||||
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){
|
||||
SWIG_fail_ptr("Stream_raw_write",1,SWIGTYPE_p_Stream);
|
||||
}
|
||||
|
||||
(&arg2)->assign(lua_tostring(L,2),lua_rawlen(L,2));
|
||||
(arg1)->raw_write(arg2);
|
||||
arg2 = (char *)lua_tostring(L, 2);
|
||||
(arg1)->raw_write((char const *)arg2,lua_rawlen(L, 2));
|
||||
SWIG_arg=0;
|
||||
|
||||
return SWIG_arg;
|
||||
|
||||
@@ -22,7 +22,10 @@ class Stream {
|
||||
Stream(void);
|
||||
Stream(switch_stream_handle_t *);
|
||||
virtual ~ Stream();
|
||||
string read();
|
||||
|
||||
%inline %{
|
||||
char *read(int *len);
|
||||
%}
|
||||
void write(const char *data);
|
||||
void raw_write(void *data, int len);
|
||||
const char *get_data(void);
|
||||
|
||||
Reference in New Issue
Block a user