[Freeswitch-svn] [commit] r8203 - freeswitch/trunk/src/mod/languages/mod_perl
Freeswitch SVN
brian at freeswitch.org
Fri Apr 25 20:45:43 EDT 2008
Author: brian
Date: Fri Apr 25 20:45:43 2008
New Revision: 8203
Modified:
freeswitch/trunk/src/mod/languages/mod_perl/mod_perl.c
Log:
cleanup a tiny bit
Modified: freeswitch/trunk/src/mod/languages/mod_perl/mod_perl.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/mod_perl.c (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/mod_perl.c Fri Apr 25 20:45:43 2008
@@ -29,6 +29,7 @@
* mod_perl.c -- Perl
*
*/
+
#ifdef __ICC
#pragma warning (disable:1419)
#endif
@@ -47,8 +48,6 @@
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_perl_shutdown);
SWITCH_MODULE_DEFINITION(mod_perl, mod_perl_load, mod_perl_shutdown, NULL);
-
-
static STRLEN n_a;
static struct {
@@ -57,7 +56,6 @@
char *xml_handler;
} globals;
-
static void Perl_safe_eval(PerlInterpreter *my_perl, const char *string, int tf)
{
char *st = switch_mprintf("eval { %s }; $__ERR = $@", string);
@@ -89,7 +87,6 @@
{
int error = 0;
-
if (*input_code == '~') {
char *buff = input_code + 1;
perl_parse(my_perl, xs_init, 3, embedding, NULL);
@@ -108,8 +105,6 @@
}
}
-
-
static void perl_function(switch_core_session_t *session, char *data)
{
char *uuid = switch_core_session_get_uuid(session);
@@ -197,7 +192,6 @@
if (session) {
uuid = switch_core_session_get_uuid(session);
}
-
switch_snprintf(code, sizeof(code),
"use lib '%s/perl';\n"
@@ -210,7 +204,6 @@
SWITCH_GLOBAL_dirs.base_dir,
switch_str_nil(uuid)
-
);
perl_parse(my_perl, xs_init, 3, embedding, NULL);
@@ -235,11 +228,9 @@
Perl_safe_eval(my_perl, "undef(*);", TRUE);
destroy_perl(&my_perl);
-
return SWITCH_STATUS_SUCCESS;
}
-
static switch_xml_t perl_fetch(const char *section,
const char *tag_name,
const char *key_name,
@@ -282,7 +273,6 @@
sv_setpv(this, section);
hv_store(hash, "section", 7, this, 0);
-
if (switch_strlen_zero(tag_name)) {
tag_name = "";
}
@@ -299,7 +289,6 @@
sv_setpv(this, key_name);
hv_store(hash, "key_name", 8, this, 0);
-
if (switch_strlen_zero(key_value)) {
key_value = "";
}
@@ -312,7 +301,6 @@
abort();
}
-
if (params) {
for (hp = params->headers; hp; hp = hp->next) {
this = newSV(strlen(hp->value)+1);
@@ -344,16 +332,13 @@
}
return xml;
-
}
static switch_status_t do_config(void)
{
-
char *cf = "perl.conf";
switch_xml_t cfg, xml, settings, param;
-
if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
return SWITCH_STATUS_TERM;
@@ -375,13 +360,11 @@
}
}
-
switch_xml_free(xml);
return SWITCH_STATUS_SUCCESS;
}
-
SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load)
{
switch_application_interface_t *app_interface;
@@ -397,15 +380,10 @@
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Allocated perl intrepreter.\n");
-
perl_construct(my_perl);
perl_parse(my_perl, xs_init, 3, embedding, NULL);
perl_run(my_perl);
globals.my_perl = my_perl;
-
- //switch_snprintf(code, sizeof(code), "use lib '%s/perl';use freeswitch\n", SWITCH_GLOBAL_dirs.base_dir);
-
-
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
More information about the Freeswitch-svn
mailing list