move some modules to use the new module interface macros.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5344 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2007-06-13 17:48:49 +00:00
1 parent b67f9c5b2a
commit 784c7f8c3d
10 files changed
+53 -43

No files matched your search

+7 -4
View File
@@ -50,7 +50,10 @@ MonoClass *mod_mono_find_assembly_class(MonoImage * image);
/* Managed functions */
void mod_mono_switch_console_printf(switch_text_channel_t channel, char *file, const char *func, int line, char *fmt, char *msg);
static const char modname[] = "mod_mono";
SWITCH_MODULE_LOAD_FUNCTION(mod_mono_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_mono_shutdown);
SWITCH_MODULE_DEFINITION(mod_mono, mod_mono_load, mod_mono_shutdown, NULL);
static switch_memory_pool_t *mono_pool = NULL;
static struct {
@@ -74,9 +77,9 @@ static switch_loadable_module_interface_t mono_module_interface = {
* This function will initialise the memory pool and plugin hash for this module,
* it will then initialise a new mono domain.
*/
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface, char *filename)
SWITCH_MODULE_LOAD_FUNCTION(mod_mono_load)
{
*interface = &mono_module_interface;
*module_interface = &mono_module_interface;
/* Initialise memory pool */
if (switch_core_new_memory_pool(&mono_pool) != SWITCH_STATUS_SUCCESS) {
@@ -158,7 +161,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
* Function for cleanly shutting down mod_mono
*
*/
SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_mono_shutdown)
{
if (globals.domain) {
mono_jit_cleanup(globals.domain);
+5 -3
View File
@@ -49,7 +49,9 @@ PyThreadState *mainThreadState = NULL;
void init_freeswitch(void);
static switch_api_interface_t python_run_interface;
const char modname[] = "mod_python";
SWITCH_MODULE_LOAD_FUNCTION(mod_python_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_python_shutdown);
SWITCH_MODULE_DEFINITION(mod_python, mod_python_load, mod_python_shutdown, NULL);
static void eval_some_python(char *uuid, char *args)
{
@@ -221,7 +223,7 @@ static switch_loadable_module_interface_t python_module_interface = {
/*.directory_interface */ NULL
};
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
SWITCH_MODULE_LOAD_FUNCTION(mod_python_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &python_module_interface;
@@ -242,7 +244,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
/*
Called when the system shuts down*/
SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_python_shutdown)
{
PyInterpreterState *mainInterpreterState;
PyThreadState *myThreadState;