mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-17 09:41:51 +00:00
[mod_lua] Fix leaks.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
%module freeswitch
|
||||
%include ../../../../swig_common.i
|
||||
//%include "cstring.i"
|
||||
%include std_string.i
|
||||
|
||||
/**
|
||||
* tell swig to treat these variables as mutable so they
|
||||
@@ -44,7 +45,6 @@
|
||||
$1 = default_swiglua_fn;
|
||||
}
|
||||
|
||||
|
||||
%ignore SwitchToMempool;
|
||||
%newobject EventConsumer::pop;
|
||||
%newobject Session;
|
||||
@@ -56,10 +56,7 @@
|
||||
%newobject API::executeString;
|
||||
%newobject CoreSession::playAndDetectSpeech;
|
||||
%newobject JSON;
|
||||
%newobject JSON::encode;
|
||||
%newobject JSON::decode;
|
||||
%newobject JSON::execute;
|
||||
%newobject JSON::execute2;
|
||||
|
||||
%include "typemaps.i"
|
||||
%apply int *OUTPUT { int *len };
|
||||
@@ -130,11 +127,11 @@ class JSON {
|
||||
JSON();
|
||||
~JSON();
|
||||
cJSON *decode(const char *str);
|
||||
char *encode(SWIGLUA_TABLE lua_table);
|
||||
std::string encode(SWIGLUA_TABLE lua_table);
|
||||
cJSON *execute(const char *);
|
||||
cJSON *execute(SWIGLUA_TABLE table);
|
||||
char *execute2(const char *);
|
||||
char *execute2(SWIGLUA_TABLE table);
|
||||
std::string execute2(const char *);
|
||||
std::string execute2(SWIGLUA_TABLE table);
|
||||
void encode_empty_table_as_object(bool flag);
|
||||
void return_unformatted_json(bool flag);
|
||||
};
|
||||
|
||||
@@ -600,7 +600,7 @@ void JSON::LuaTable2cJSON(lua_State *L, int index, cJSON **json)
|
||||
// Stack is now the same as it was on entry to this function
|
||||
}
|
||||
|
||||
char *JSON::encode(SWIGLUA_TABLE lua_table)
|
||||
std::string JSON::encode(SWIGLUA_TABLE lua_table)
|
||||
{
|
||||
lua_State *L = lua_table.L;
|
||||
cJSON *json = NULL;
|
||||
@@ -613,8 +613,10 @@ char *JSON::encode(SWIGLUA_TABLE lua_table)
|
||||
}
|
||||
|
||||
char *s = _return_unformatted_json ? cJSON_PrintUnformatted(json) : cJSON_Print(json);
|
||||
std::string result = std::string(s);
|
||||
free(s);
|
||||
cJSON_Delete(json);
|
||||
return s;
|
||||
return result;
|
||||
}
|
||||
|
||||
int JSON::cJSON2LuaTable(lua_State *L, cJSON *json) {
|
||||
@@ -724,16 +726,22 @@ cJSON *JSON::execute(SWIGLUA_TABLE table)
|
||||
return reply;
|
||||
}
|
||||
|
||||
char *JSON::execute2(const char *str)
|
||||
std::string JSON::execute2(const char *str)
|
||||
{
|
||||
cJSON *reply = execute(str);
|
||||
|
||||
return _return_unformatted_json ? cJSON_PrintUnformatted(reply) : cJSON_Print(reply);
|
||||
cJSON *reply = execute(str);
|
||||
char *s = _return_unformatted_json ? cJSON_PrintUnformatted(reply) : cJSON_Print(reply);
|
||||
std::string result = std::string(s);
|
||||
free(s);
|
||||
cJSON_Delete(reply);
|
||||
return result;
|
||||
}
|
||||
|
||||
char *JSON::execute2(SWIGLUA_TABLE table)
|
||||
std::string JSON::execute2(SWIGLUA_TABLE table)
|
||||
{
|
||||
cJSON *reply = execute(table);
|
||||
|
||||
return _return_unformatted_json ? cJSON_PrintUnformatted(reply) : cJSON_Print(reply);
|
||||
cJSON *reply = execute(table);
|
||||
char *s = _return_unformatted_json ? cJSON_PrintUnformatted(reply) : cJSON_Print(reply);
|
||||
std::string result = std::string(s);
|
||||
free(s);
|
||||
cJSON_Delete(reply);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ extern "C" {
|
||||
#include "mod_lua_extra.h"
|
||||
}
|
||||
#include <switch_cpp.h>
|
||||
#include <string>
|
||||
|
||||
#ifndef lua_pushglobaltable
|
||||
#define lua_pushglobaltable(L) lua_pushvalue(L,LUA_GLOBALSINDEX)
|
||||
@@ -89,11 +90,11 @@ namespace LUA {
|
||||
JSON();
|
||||
~JSON();
|
||||
cJSON *decode(const char *);
|
||||
char *encode(SWIGLUA_TABLE table);
|
||||
std::string encode(SWIGLUA_TABLE table);
|
||||
cJSON *execute(const char *);
|
||||
cJSON *execute(SWIGLUA_TABLE table);
|
||||
char *execute2(const char *);
|
||||
char *execute2(SWIGLUA_TABLE table);
|
||||
std::string execute2(const char *);
|
||||
std::string execute2(SWIGLUA_TABLE table);
|
||||
void encode_empty_table_as_object(bool flag);
|
||||
void return_unformatted_json(bool flag);
|
||||
static int cJSON2LuaTable(lua_State *L, cJSON *json);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- mod_lua_wrap.cpp.old 2015-06-16 12:27:19.024000000 -0500
|
||||
+++ mod_lua_wrap.cpp 2015-06-16 12:34:51.540000000 -0500
|
||||
@@ -3065,7 +3065,7 @@
|
||||
@@ -4242,7 +4242,7 @@ static int _wrap_Stream_read(lua_State* L) {
|
||||
}
|
||||
|
||||
result = (char *)(arg1)->read(arg2);
|
||||
@@ -9,7 +9,7 @@
|
||||
lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
@@ -6855,7 +6855,7 @@
|
||||
@@ -8304,7 +8304,7 @@ static int _wrap_new_Session__SWIG_0(lua_State* L) {
|
||||
|
||||
SWIG_check_num_args("LUA::Session::Session",0,0)
|
||||
result = (LUA::Session *)new LUA::Session();
|
||||
@@ -18,7 +18,7 @@
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
@@ -6882,7 +6882,7 @@
|
||||
@@ -8331,7 +8331,7 @@ static int _wrap_new_Session__SWIG_1(lua_State* L) {
|
||||
}
|
||||
|
||||
result = (LUA::Session *)new LUA::Session(arg1,arg2);
|
||||
@@ -27,7 +27,7 @@
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
@@ -6902,7 +6902,7 @@
|
||||
@@ -8351,7 +8351,7 @@ static int _wrap_new_Session__SWIG_2(lua_State* L) {
|
||||
if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("LUA::Session::Session",1,"char *");
|
||||
arg1 = (char *)lua_tostring(L, 1);
|
||||
result = (LUA::Session *)new LUA::Session(arg1);
|
||||
@@ -36,7 +36,7 @@
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
@@ -6926,7 +6926,7 @@
|
||||
@@ -8375,7 +8375,7 @@ static int _wrap_new_Session__SWIG_3(lua_State* L) {
|
||||
}
|
||||
|
||||
result = (LUA::Session *)new LUA::Session(arg1);
|
||||
@@ -45,7 +45,7 @@
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
@@ -9217,6 +9217,7 @@ static int _wrap_Dbh_test_reactive__SWIG_0(lua_State* L) {
|
||||
@@ -9485,6 +9485,7 @@ static int _wrap_Dbh_test_reactive__SWIG_0(lua_State* L) {
|
||||
arg2 = (char *)lua_tostring(L, 2);
|
||||
arg3 = (char *)lua_tostring(L, 3);
|
||||
arg4 = (char *)lua_tostring(L, 4);
|
||||
@@ -53,7 +53,7 @@
|
||||
result = (bool)(arg1)->test_reactive(arg2,arg3,arg4);
|
||||
lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
@@ -9404,6 +9405,7 @@ static int _wrap_Dbh_query(lua_State* L) {
|
||||
@@ -9672,6 +9673,7 @@ static int _wrap_Dbh_query(lua_State* L) {
|
||||
(&arg3)->idx = 3;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@
|
||||
result = (bool)(arg1)->query(arg2,arg3);
|
||||
lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
@@ -9427,7 +9429,7 @@ static int _wrap_Dbh_affected_rows(lua_State* L) {
|
||||
@@ -9695,7 +9697,7 @@ static int _wrap_Dbh_affected_rows(lua_State* L) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
|
||||
SWIG_fail_ptr("Dbh_affected_rows",1,SWIGTYPE_p_LUA__Dbh);
|
||||
}
|
||||
@@ -70,7 +70,7 @@
|
||||
result = (int)(arg1)->affected_rows();
|
||||
lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
@@ -9451,7 +9453,7 @@ static int _wrap_Dbh_last_error(lua_State* L) {
|
||||
@@ -9719,7 +9721,7 @@ static int _wrap_Dbh_last_error(lua_State* L) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
|
||||
SWIG_fail_ptr("Dbh_last_error",1,SWIGTYPE_p_LUA__Dbh);
|
||||
}
|
||||
@@ -79,7 +79,7 @@
|
||||
result = (char *)(arg1)->last_error();
|
||||
lua_pushstring(L,(const char *)result); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
@@ -9474,7 +9476,7 @@ static int _wrap_Dbh_clear_error(lua_State* L) {
|
||||
@@ -9742,7 +9744,7 @@ static int _wrap_Dbh_clear_error(lua_State* L) {
|
||||
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){
|
||||
SWIG_fail_ptr("Dbh_clear_error",1,SWIGTYPE_p_LUA__Dbh);
|
||||
}
|
||||
@@ -88,7 +88,7 @@
|
||||
(arg1)->clear_error();
|
||||
|
||||
return SWIG_arg;
|
||||
@@ -9502,6 +9504,7 @@ static int _wrap_Dbh_load_extension(lua_State* L) {
|
||||
@@ -9770,6 +9772,7 @@ static int _wrap_Dbh_load_extension(lua_State* L) {
|
||||
}
|
||||
|
||||
arg2 = (char *)lua_tostring(L, 2);
|
||||
@@ -96,7 +96,7 @@
|
||||
result = (int)(arg1)->load_extension((char const *)arg2);
|
||||
lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
@@ -9601,6 +9604,7 @@ static int _wrap_JSON_decode(lua_State* L) {
|
||||
@@ -9869,6 +9872,7 @@ static int _wrap_JSON_decode(lua_State* L) {
|
||||
}
|
||||
|
||||
arg2 = (char *)lua_tostring(L, 2);
|
||||
@@ -104,15 +104,15 @@
|
||||
result = (cJSON *)(arg1)->decode((char const *)arg2);
|
||||
{
|
||||
SWIG_arg += LUA::JSON::cJSON2LuaTable(L, result);
|
||||
@@ -9634,6 +9638,7 @@ static int _wrap_JSON_encode(lua_State* L) {
|
||||
@@ -9902,6 +9906,7 @@ static int _wrap_JSON_encode(lua_State* L) {
|
||||
(&arg2)->L = L;
|
||||
(&arg2)->idx = 2;
|
||||
}
|
||||
+ switch_assert(arg1);
|
||||
result = (char *)(arg1)->encode(arg2);
|
||||
lua_pushstring(L,(const char *)result); SWIG_arg++;
|
||||
result = (arg1)->encode(arg2);
|
||||
lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
@@ -9661,6 +9666,7 @@ static int _wrap_JSON_execute__SWIG_0(lua_State* L) {
|
||||
@@ -9929,6 +9934,7 @@ static int _wrap_JSON_execute__SWIG_0(lua_State* L) {
|
||||
}
|
||||
|
||||
arg2 = (char *)lua_tostring(L, 2);
|
||||
@@ -120,7 +120,7 @@
|
||||
result = (cJSON *)(arg1)->execute((char const *)arg2);
|
||||
{
|
||||
SWIG_arg += LUA::JSON::cJSON2LuaTable(L, result);
|
||||
@@ -9694,6 +9700,7 @@ static int _wrap_JSON_execute__SWIG_1(lua_State* L) {
|
||||
@@ -9962,6 +9968,7 @@ static int _wrap_JSON_execute__SWIG_1(lua_State* L) {
|
||||
(&arg2)->L = L;
|
||||
(&arg2)->idx = 2;
|
||||
}
|
||||
@@ -128,23 +128,23 @@
|
||||
result = (cJSON *)(arg1)->execute(arg2);
|
||||
{
|
||||
SWIG_arg += LUA::JSON::cJSON2LuaTable(L, result);
|
||||
@@ -9778,6 +9785,7 @@ static int _wrap_JSON_execute2__SWIG_0(lua_State* L) {
|
||||
@@ -10046,6 +10053,7 @@ static int _wrap_JSON_execute2__SWIG_0(lua_State* L) {
|
||||
}
|
||||
|
||||
arg2 = (char *)lua_tostring(L, 2);
|
||||
+ switch_assert(arg1);
|
||||
result = (char *)(arg1)->execute2((char const *)arg2);
|
||||
lua_pushstring(L,(const char *)result); SWIG_arg++;
|
||||
result = (arg1)->execute2((char const *)arg2);
|
||||
lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
@@ -9808,6 +9816,7 @@ static int _wrap_JSON_execute2__SWIG_1(lua_State* L) {
|
||||
@@ -10076,6 +10084,7 @@ static int _wrap_JSON_execute2__SWIG_1(lua_State* L) {
|
||||
(&arg2)->L = L;
|
||||
(&arg2)->idx = 2;
|
||||
}
|
||||
+ switch_assert(arg1);
|
||||
result = (char *)(arg1)->execute2(arg2);
|
||||
lua_pushstring(L,(const char *)result); SWIG_arg++;
|
||||
result = (arg1)->execute2(arg2);
|
||||
lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
@@ -9888,6 +9897,7 @@ static int _wrap_JSON_encode_empty_table_as_object(lua_State* L) {
|
||||
@@ -10156,6 +10165,7 @@ static int _wrap_JSON_encode_empty_table_as_object(lua_State* L) {
|
||||
}
|
||||
|
||||
arg2 = (lua_toboolean(L, 2)!=0);
|
||||
@@ -152,7 +152,7 @@
|
||||
(arg1)->encode_empty_table_as_object(arg2);
|
||||
|
||||
return SWIG_arg;
|
||||
@@ -9914,6 +9924,7 @@ static int _wrap_JSON_return_unformatted_json(lua_State* L) {
|
||||
@@ -10182,6 +10192,7 @@ static int _wrap_JSON_return_unformatted_json(lua_State* L) {
|
||||
}
|
||||
|
||||
arg2 = (lua_toboolean(L, 2)!=0);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 3.0.10
|
||||
* Version 3.0.12
|
||||
*
|
||||
* 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
|
||||
@@ -2691,23 +2691,24 @@ SWIG_Lua_dostring(lua_State *L, const char *str) {
|
||||
#define SWIGTYPE_p_lua_State swig_types[13]
|
||||
#define SWIGTYPE_p_p_switch_event_node_t swig_types[14]
|
||||
#define SWIGTYPE_p_session_flag_t swig_types[15]
|
||||
#define SWIGTYPE_p_switch_call_cause_t swig_types[16]
|
||||
#define SWIGTYPE_p_switch_channel_state_t swig_types[17]
|
||||
#define SWIGTYPE_p_switch_channel_t swig_types[18]
|
||||
#define SWIGTYPE_p_switch_core_session_t swig_types[19]
|
||||
#define SWIGTYPE_p_switch_event_t swig_types[20]
|
||||
#define SWIGTYPE_p_switch_event_types_t swig_types[21]
|
||||
#define SWIGTYPE_p_switch_input_args_t swig_types[22]
|
||||
#define SWIGTYPE_p_switch_input_type_t swig_types[23]
|
||||
#define SWIGTYPE_p_switch_priority_t swig_types[24]
|
||||
#define SWIGTYPE_p_switch_queue_t swig_types[25]
|
||||
#define SWIGTYPE_p_switch_state_handler_table_t swig_types[26]
|
||||
#define SWIGTYPE_p_switch_status_t swig_types[27]
|
||||
#define SWIGTYPE_p_switch_stream_handle_t swig_types[28]
|
||||
#define SWIGTYPE_p_uint32_t swig_types[29]
|
||||
#define SWIGTYPE_p_void swig_types[30]
|
||||
static swig_type_info *swig_types[32];
|
||||
static swig_module_info swig_module = {swig_types, 31, 0, 0, 0, 0};
|
||||
#define SWIGTYPE_p_std__string swig_types[16]
|
||||
#define SWIGTYPE_p_switch_call_cause_t swig_types[17]
|
||||
#define SWIGTYPE_p_switch_channel_state_t swig_types[18]
|
||||
#define SWIGTYPE_p_switch_channel_t swig_types[19]
|
||||
#define SWIGTYPE_p_switch_core_session_t swig_types[20]
|
||||
#define SWIGTYPE_p_switch_event_t swig_types[21]
|
||||
#define SWIGTYPE_p_switch_event_types_t swig_types[22]
|
||||
#define SWIGTYPE_p_switch_input_args_t swig_types[23]
|
||||
#define SWIGTYPE_p_switch_input_type_t swig_types[24]
|
||||
#define SWIGTYPE_p_switch_priority_t swig_types[25]
|
||||
#define SWIGTYPE_p_switch_queue_t swig_types[26]
|
||||
#define SWIGTYPE_p_switch_state_handler_table_t swig_types[27]
|
||||
#define SWIGTYPE_p_switch_status_t swig_types[28]
|
||||
#define SWIGTYPE_p_switch_stream_handle_t swig_types[29]
|
||||
#define SWIGTYPE_p_uint32_t swig_types[30]
|
||||
#define SWIGTYPE_p_void swig_types[31]
|
||||
static swig_type_info *swig_types[33];
|
||||
static swig_module_info swig_module = {swig_types, 32, 0, 0, 0, 0};
|
||||
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
|
||||
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
|
||||
|
||||
@@ -2724,6 +2725,17 @@ typedef struct{} LANGUAGE_OBJ;
|
||||
}
|
||||
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
|
||||
int ret = lua_isstring(L, idx);
|
||||
if (!ret)
|
||||
ret = lua_isnil(L, idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#include "switch.h"
|
||||
#include "switch_cpp.h"
|
||||
#include "freeswitch_lua.h"
|
||||
@@ -2885,17 +2897,273 @@ SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_typ
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
|
||||
int ret = lua_isstring(L, idx);
|
||||
if (!ret)
|
||||
ret = lua_isnil(L, idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
static int _wrap_new_string__SWIG_0(lua_State* L) {
|
||||
int SWIG_arg = 0;
|
||||
std::string *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("std::string::string",0,0)
|
||||
result = (std::string *)new std::string();
|
||||
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 = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
std::string *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("std::string::string",1,1)
|
||||
if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("std::string::string",1,"char const *");
|
||||
arg1 = (char *)lua_tostring(L, 1);
|
||||
result = (std::string *)new std::string((char const *)arg1);
|
||||
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 = SWIG_lua_isnilstring(L,argv[0]);
|
||||
}
|
||||
if (_v) {
|
||||
return _wrap_new_string__SWIG_1(L);
|
||||
}
|
||||
}
|
||||
|
||||
SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_string'\n"
|
||||
" Possible C/C++ prototypes are:\n"
|
||||
" std::string::string()\n"
|
||||
" std::string::string(char const *)\n");
|
||||
lua_error(L);return 0;
|
||||
}
|
||||
|
||||
|
||||
static int _wrap_string_size(lua_State* L) {
|
||||
int SWIG_arg = 0;
|
||||
std::string *arg1 = (std::string *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
SWIG_check_num_args("std::string::size",1,1)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::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();
|
||||
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 = 0;
|
||||
std::string *arg1 = (std::string *) 0 ;
|
||||
unsigned int result;
|
||||
|
||||
SWIG_check_num_args("std::string::length",1,1)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::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();
|
||||
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 = 0;
|
||||
std::string *arg1 = (std::string *) 0 ;
|
||||
bool result;
|
||||
|
||||
SWIG_check_num_args("std::string::empty",1,1)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::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();
|
||||
lua_pushboolean(L,(int)(result!=0)); 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 = 0;
|
||||
std::string *arg1 = (std::string *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("std::string::c_str",1,1)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::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();
|
||||
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 = 0;
|
||||
std::string *arg1 = (std::string *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
SWIG_check_num_args("std::string::data",1,1)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::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();
|
||||
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 = 0;
|
||||
std::string *arg1 = (std::string *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
SWIG_check_num_args("std::string::assign",2,2)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::assign",1,"std::string *");
|
||||
if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("std::string::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);
|
||||
|
||||
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 int _proxy__wrap_new_string(lua_State *L) {
|
||||
assert(lua_istable(L,1));
|
||||
lua_pushcfunction(L,_wrap_new_string);
|
||||
assert(!lua_isnil(L,-1));
|
||||
lua_replace(L,1); /* replace our table with real constructor */
|
||||
lua_call(L,lua_gettop(L)-1,1);
|
||||
return 1;
|
||||
}
|
||||
static swig_lua_attribute swig_string_attributes[] = {
|
||||
{0,0,0}
|
||||
};
|
||||
static swig_lua_method swig_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_method swig_string_meta[] = {
|
||||
{0,0}
|
||||
};
|
||||
|
||||
static swig_lua_attribute swig_string_Sf_SwigStatic_attributes[] = {
|
||||
{0,0,0}
|
||||
};
|
||||
static swig_lua_const_info swig_string_Sf_SwigStatic_constants[]= {
|
||||
{0,0,0,0,0,0}
|
||||
};
|
||||
static swig_lua_method swig_string_Sf_SwigStatic_methods[]= {
|
||||
{0,0}
|
||||
};
|
||||
static swig_lua_class* swig_string_Sf_SwigStatic_classes[]= {
|
||||
0
|
||||
};
|
||||
|
||||
static swig_lua_namespace swig_string_Sf_SwigStatic = {
|
||||
"string",
|
||||
swig_string_Sf_SwigStatic_methods,
|
||||
swig_string_Sf_SwigStatic_attributes,
|
||||
swig_string_Sf_SwigStatic_constants,
|
||||
swig_string_Sf_SwigStatic_classes,
|
||||
0
|
||||
};
|
||||
static swig_lua_class *swig_string_bases[] = {0};
|
||||
static const char *swig_string_base_names[] = {0};
|
||||
static swig_lua_class _wrap_class_string = { "string", "string", &SWIGTYPE_p_std__string,_proxy__wrap_new_string, swig_delete_string, swig_string_methods, swig_string_attributes, &swig_string_Sf_SwigStatic, swig_string_meta, swig_string_bases, swig_string_base_names };
|
||||
|
||||
static int _wrap_setGlobalVariable(lua_State* L) {
|
||||
int SWIG_arg = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
@@ -9624,7 +9892,7 @@ static int _wrap_JSON_encode(lua_State* L) {
|
||||
int SWIG_arg = 0;
|
||||
LUA::JSON *arg1 = (LUA::JSON *) 0 ;
|
||||
SWIGLUA_TABLE arg2 ;
|
||||
char *result = 0 ;
|
||||
std::string result;
|
||||
|
||||
SWIG_check_num_args("LUA::JSON::encode",2,2)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::JSON::encode",1,"LUA::JSON *");
|
||||
@@ -9639,8 +9907,8 @@ static int _wrap_JSON_encode(lua_State* L) {
|
||||
(&arg2)->idx = 2;
|
||||
}
|
||||
switch_assert(arg1);
|
||||
result = (char *)(arg1)->encode(arg2);
|
||||
lua_pushstring(L,(const char *)result); SWIG_arg++;
|
||||
result = (arg1)->encode(arg2);
|
||||
lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
@@ -9774,7 +10042,7 @@ static int _wrap_JSON_execute2__SWIG_0(lua_State* L) {
|
||||
int SWIG_arg = 0;
|
||||
LUA::JSON *arg1 = (LUA::JSON *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *result = 0 ;
|
||||
std::string result;
|
||||
|
||||
SWIG_check_num_args("LUA::JSON::execute2",2,2)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::JSON::execute2",1,"LUA::JSON *");
|
||||
@@ -9786,8 +10054,8 @@ static int _wrap_JSON_execute2__SWIG_0(lua_State* L) {
|
||||
|
||||
arg2 = (char *)lua_tostring(L, 2);
|
||||
switch_assert(arg1);
|
||||
result = (char *)(arg1)->execute2((char const *)arg2);
|
||||
lua_pushstring(L,(const char *)result); SWIG_arg++;
|
||||
result = (arg1)->execute2((char const *)arg2);
|
||||
lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
@@ -9802,7 +10070,7 @@ static int _wrap_JSON_execute2__SWIG_1(lua_State* L) {
|
||||
int SWIG_arg = 0;
|
||||
LUA::JSON *arg1 = (LUA::JSON *) 0 ;
|
||||
SWIGLUA_TABLE arg2 ;
|
||||
char *result = 0 ;
|
||||
std::string result;
|
||||
|
||||
SWIG_check_num_args("LUA::JSON::execute2",2,2)
|
||||
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::JSON::execute2",1,"LUA::JSON *");
|
||||
@@ -9817,8 +10085,8 @@ static int _wrap_JSON_execute2__SWIG_1(lua_State* L) {
|
||||
(&arg2)->idx = 2;
|
||||
}
|
||||
switch_assert(arg1);
|
||||
result = (char *)(arg1)->execute2(arg2);
|
||||
lua_pushstring(L,(const char *)result); SWIG_arg++;
|
||||
result = (arg1)->execute2(arg2);
|
||||
lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
if(0) SWIG_fail;
|
||||
@@ -10017,6 +10285,7 @@ static swig_lua_method swig_SwigModule_methods[]= {
|
||||
{0,0}
|
||||
};
|
||||
static swig_lua_class* swig_SwigModule_classes[]= {
|
||||
&_wrap_class_string,
|
||||
&_wrap_class_IVRMenu,
|
||||
&_wrap_class_API,
|
||||
&_wrap_class_input_callback_state_t,
|
||||
@@ -10067,6 +10336,7 @@ 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_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};
|
||||
@@ -10100,6 +10370,7 @@ static swig_type_info *swig_type_initial[] = {
|
||||
&_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,
|
||||
@@ -10133,6 +10404,7 @@ 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}};
|
||||
@@ -10166,6 +10438,7 @@ static swig_cast_info *swig_cast_initial[] = {
|
||||
_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,
|
||||
|
||||
Reference in New Issue
Block a user