From d138afa72c533d6bc8fc5e7b5608e60ed5793b4f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sun, 5 Mar 2006 21:19:44 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@751 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/languages/mod_perl/fs_perl.pm | 2 + src/mod/languages/mod_perl/switch_swig.c | 18 ++++++- src/mod/languages/mod_perl/switch_swig_wrap.c | 54 +++++++++++++++---- 3 files changed, 62 insertions(+), 12 deletions(-) diff --git a/src/mod/languages/mod_perl/fs_perl.pm b/src/mod/languages/mod_perl/fs_perl.pm index ea8be4e676..e0adcb0b09 100644 --- a/src/mod/languages/mod_perl/fs_perl.pm +++ b/src/mod/languages/mod_perl/fs_perl.pm @@ -47,7 +47,9 @@ package fs_perl; *fs_core_set_globals = *fs_perlc::fs_core_set_globals; *fs_core_init = *fs_perlc::fs_core_init; +*fs_core_destroy = *fs_perlc::fs_core_destroy; *fs_loadable_module_init = *fs_perlc::fs_loadable_module_init; +*fs_loadable_module_shutdown = *fs_perlc::fs_loadable_module_shutdown; *fs_console_loop = *fs_perlc::fs_console_loop; *fs_console_log = *fs_perlc::fs_console_log; *fs_console_clean = *fs_perlc::fs_console_clean; diff --git a/src/mod/languages/mod_perl/switch_swig.c b/src/mod/languages/mod_perl/switch_swig.c index 4ed7936391..2e37ab82fe 100644 --- a/src/mod/languages/mod_perl/switch_swig.c +++ b/src/mod/languages/mod_perl/switch_swig.c @@ -19,14 +19,30 @@ int fs_core_init(char *path) return status == SWITCH_STATUS_SUCCESS ? 1 : 0; } +int fs_core_destroy(void) +{ + switch_status status; + + status = switch_core_destroy(); + + return status == SWITCH_STATUS_SUCCESS ? 1 : 0; +} + int fs_loadable_module_init(void) { return switch_loadable_module_init() == SWITCH_STATUS_SUCCESS ? 1 : 0; } -void fs_console_loop(void) +int fs_loadable_module_shutdown(void) +{ + switch_loadable_module_shutdown(); + return 1; +} + +int fs_console_loop(void) { switch_console_loop(); + return 0; } void fs_console_log(char *msg) diff --git a/src/mod/languages/mod_perl/switch_swig_wrap.c b/src/mod/languages/mod_perl/switch_swig_wrap.c index d4e2445b4e..895c8d24eb 100644 --- a/src/mod/languages/mod_perl/switch_swig_wrap.c +++ b/src/mod/languages/mod_perl/switch_swig_wrap.c @@ -1044,9 +1044,6 @@ XS(_wrap_fs_core_set_globals) { int argvi = 0; dXSARGS; - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: fs_core_set_globals();"); - } fs_core_set_globals(); @@ -1082,15 +1079,30 @@ XS(_wrap_fs_core_init) { } +XS(_wrap_fs_core_destroy) { + { + int result; + int argvi = 0; + dXSARGS; + + result = (int)fs_core_destroy(); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + ; + } + croak(Nullch); +} + + XS(_wrap_fs_loadable_module_init) { { int result; int argvi = 0; dXSARGS; - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: fs_loadable_module_init();"); - } result = (int)fs_loadable_module_init(); ST(argvi) = sv_newmortal(); @@ -1103,17 +1115,35 @@ XS(_wrap_fs_loadable_module_init) { } +XS(_wrap_fs_loadable_module_shutdown) { + { + int result; + int argvi = 0; + dXSARGS; + + result = (int)fs_loadable_module_shutdown(); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + ; + } + croak(Nullch); +} + + XS(_wrap_fs_console_loop) { { + int result; int argvi = 0; dXSARGS; - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: fs_console_loop();"); - } - fs_console_loop(); - + + result = (int)fs_console_loop(); + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); XSRETURN(argvi); fail: ; @@ -1415,7 +1445,9 @@ static swig_variable_info swig_variables[] = { static swig_command_info swig_commands[] = { {"fs_perlc::fs_core_set_globals", _wrap_fs_core_set_globals}, {"fs_perlc::fs_core_init", _wrap_fs_core_init}, +{"fs_perlc::fs_core_destroy", _wrap_fs_core_destroy}, {"fs_perlc::fs_loadable_module_init", _wrap_fs_loadable_module_init}, +{"fs_perlc::fs_loadable_module_shutdown", _wrap_fs_loadable_module_shutdown}, {"fs_perlc::fs_console_loop", _wrap_fs_console_loop}, {"fs_perlc::fs_console_log", _wrap_fs_console_log}, {"fs_perlc::fs_console_clean", _wrap_fs_console_clean},