提交 88437786 authored 作者: Anthony Minessale's avatar Anthony Minessale

add namespace to perl

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8358 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 9ff934f7
...@@ -16,7 +16,7 @@ swigclean: clean ...@@ -16,7 +16,7 @@ swigclean: clean
mod_perl_wrap.cpp: mod_perl_wrap.cpp:
swig -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i swig -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i
echo "#include \"mod_perl_extra.c\"" >> mod_perl_wrap.cpp echo "#include \"mod_perl_extra.c\"" >> mod_perl_wrap.cpp
patch -s -p0 -i hack.diff # patch -s -p0 -i hack.diff
......
...@@ -307,6 +307,7 @@ sub DESTROY { ...@@ -307,6 +307,7 @@ sub DESTROY {
*setPrivate = *freeswitchc::CoreSession_setPrivate; *setPrivate = *freeswitchc::CoreSession_setPrivate;
*getPrivate = *freeswitchc::CoreSession_getPrivate; *getPrivate = *freeswitchc::CoreSession_getPrivate;
*getVariable = *freeswitchc::CoreSession_getVariable; *getVariable = *freeswitchc::CoreSession_getVariable;
*process_callback_result = *freeswitchc::CoreSession_process_callback_result;
*recordFile = *freeswitchc::CoreSession_recordFile; *recordFile = *freeswitchc::CoreSession_recordFile;
*setCallerData = *freeswitchc::CoreSession_setCallerData; *setCallerData = *freeswitchc::CoreSession_setCallerData;
*originate = *freeswitchc::CoreSession_originate; *originate = *freeswitchc::CoreSession_originate;
......
...@@ -6,6 +6,8 @@ static STRLEN n_a; ...@@ -6,6 +6,8 @@ static STRLEN n_a;
#define init_me() cb_function = hangup_func_str = NULL; hangup_func_arg = NULL; hh = mark = 0; my_perl = NULL; cb_arg = NULL #define init_me() cb_function = hangup_func_str = NULL; hangup_func_arg = NULL; hh = mark = 0; my_perl = NULL; cb_arg = NULL
using namespace PERL;
Session::Session() : CoreSession() Session::Session() : CoreSession()
{ {
init_me(); init_me();
......
...@@ -17,6 +17,7 @@ extern "C" { ...@@ -17,6 +17,7 @@ extern "C" {
#include <switch_cpp.h> #include <switch_cpp.h>
namespace PERL {
class Session : public CoreSession { class Session : public CoreSession {
private: private:
virtual void do_hangup_hook(); virtual void do_hangup_hook();
...@@ -45,5 +46,5 @@ class Session : public CoreSession { ...@@ -45,5 +46,5 @@ class Session : public CoreSession {
char *hangup_func_arg; char *hangup_func_arg;
void setPERL(PerlInterpreter *pi); void setPERL(PerlInterpreter *pi);
}; };
}
#endif #endif
--- mod_perl_wrap.cpp 2008-05-01 18:05:28.000000000 -0400 --- mod_perl_wrap2.cpp 2008-05-11 20:28:24.000000000 -0400
+++ old.cpp 2008-05-01 18:05:51.000000000 -0400 +++ mod_perl_wrap.cpp 2008-05-11 20:26:06.000000000 -0400
@@ -6754,7 +6754,7 @@
@@ -6293,7 +6293,7 @@
if ((items < 0) || (items > 0)) { if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: new_Session();"); SWIG_croak("Usage: new_Session();");
} }
- result = (Session *)new Session(); - result = (PERL::Session *)new PERL::Session(); result->setPERL(my_perl);
+ result = (Session *)new Session(); result->setPERL(my_perl); + result = (PERL::Session *)new PERL::Session();
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ; ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi); XSRETURN(argvi);
fail: fail:
@@ -6320,7 +6320,7 @@ @@ -6781,7 +6781,7 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Session" "', argument " "1"" of type '" "char *""'"); SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Session" "', argument " "1"" of type '" "char *""'");
} }
arg1 = reinterpret_cast< char * >(buf1); arg1 = reinterpret_cast< char * >(buf1);
- result = (Session *)new Session(arg1); - result = (PERL::Session *)new PERL::Session(arg1); result->setPERL(my_perl);
+ result = (Session *)new Session(arg1); result->setPERL(my_perl); + result = (PERL::Session *)new PERL::Session(arg1);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ; ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
if (alloc1 == SWIG_NEWOBJ) delete[] buf1; if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
XSRETURN(argvi); XSRETURN(argvi);
@@ -6348,7 +6348,7 @@ @@ -6809,7 +6809,7 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Session" "', argument " "1"" of type '" "switch_core_session_t *""'"); SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Session" "', argument " "1"" of type '" "switch_core_session_t *""'");
} }
arg1 = reinterpret_cast< switch_core_session_t * >(argp1); arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
- result = (Session *)new Session(arg1); - result = (PERL::Session *)new PERL::Session(arg1); result->setPERL(my_perl);
+ result = (Session *)new Session(arg1); result->setPERL(my_perl); + result = (PERL::Session *)new PERL::Session(arg1);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ; ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi); XSRETURN(argvi);
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论