mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 21:22:09 +00:00
move some modules to use the new module interface macros.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5343 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -32,7 +32,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <switch.h>
|
||||
|
||||
static const char modname[] = "mod_xml_cdr";
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load);
|
||||
SWITCH_MODULE_DEFINITION(mod_xml_cdr, mod_xml_cdr_load, NULL, NULL);
|
||||
|
||||
static switch_status_t my_on_hangup(switch_core_session_t *session)
|
||||
{
|
||||
@@ -91,7 +92,7 @@ static const switch_state_handler_table_t state_handlers = {
|
||||
};
|
||||
|
||||
|
||||
static const switch_loadable_module_interface_t mod_xml_cdr_module_interface = {
|
||||
static const switch_loadable_module_interface_t xml_cdr_module_interface = {
|
||||
/*.module_name = */ modname,
|
||||
/*.endpoint_interface = */ NULL,
|
||||
/*.timer_interface = */ NULL,
|
||||
@@ -100,12 +101,12 @@ static const switch_loadable_module_interface_t mod_xml_cdr_module_interface = {
|
||||
/*.application_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_xml_cdr_load)
|
||||
{
|
||||
/* test global state handlers */
|
||||
switch_core_add_state_handler(&state_handlers);
|
||||
|
||||
*module_interface = &mod_xml_cdr_module_interface;
|
||||
*module_interface = &xml_cdr_module_interface;
|
||||
|
||||
/* indicate that the module should continue to be loaded */
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
@@ -31,7 +31,9 @@
|
||||
#include <switch.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
static const char modname[] = "mod_xml_curl";
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load);
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown);
|
||||
SWITCH_MODULE_DEFINITION(mod_xml_curl, mod_xml_curl_load, mod_xml_curl_shutdown, NULL);
|
||||
|
||||
struct xml_binding {
|
||||
char *url;
|
||||
@@ -229,7 +231,7 @@ static switch_status_t do_config(void)
|
||||
}
|
||||
|
||||
|
||||
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load)
|
||||
{
|
||||
/* connect my internal structure to the blank pointer passed to me */
|
||||
*module_interface = &xml_curl_module_interface;
|
||||
@@ -244,7 +246,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown)
|
||||
{
|
||||
curl_global_cleanup();
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
@@ -42,7 +42,10 @@
|
||||
#include <xmlrpc-c/server.h>
|
||||
#include <xmlrpc-c/server_abyss.h>
|
||||
|
||||
static const char modname[] = "mod_xml_rpc";
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_rpc_load);
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown);
|
||||
SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime);
|
||||
SWITCH_MODULE_DEFINITION(mod_xml_rpc, mod_xml_rpc_load, mod_xml_rpc_shutdown, mod_xml_rpc_runtime);
|
||||
|
||||
static switch_loadable_module_interface_t xml_rpc_module_interface = {
|
||||
/*.module_name */ modname,
|
||||
@@ -112,7 +115,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_realm, globals.realm)
|
||||
}
|
||||
|
||||
|
||||
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
|
||||
SWITCH_MODULE_LOAD_FUNCTION(mod_xml_rpc_load)
|
||||
{
|
||||
/* connect my internal structure to the blank pointer passed to me */
|
||||
*module_interface = &xml_rpc_module_interface;
|
||||
@@ -357,7 +360,7 @@ static xmlrpc_value *freeswitch_man(xmlrpc_env * const envP, xmlrpc_value * cons
|
||||
return val;
|
||||
}
|
||||
|
||||
SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
|
||||
SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
|
||||
{
|
||||
TServer abyssServer;
|
||||
xmlrpc_registry *registryP;
|
||||
@@ -402,7 +405,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
|
||||
|
||||
|
||||
|
||||
SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown)
|
||||
{
|
||||
globals.running = 0;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user