]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
move some modules to use the new module interface macros.
authorMichael Jerris <mike@jerris.com>
Wed, 13 Jun 2007 17:06:10 +0000 (17:06 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 13 Jun 2007 17:06:10 +0000 (17:06 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5343 d0543943-73ff-0310-b7d9-9358b9ac24b2

34 files changed:
src/mod/asr_tts/mod_cepstral/mod_cepstral.c
src/mod/codecs/mod_amr/mod_amr.c
src/mod/codecs/mod_g711/mod_g711.c
src/mod/codecs/mod_g722/mod_g722.c
src/mod/codecs/mod_g723_1/mod_g723_1.c
src/mod/codecs/mod_g726/mod_g726.c
src/mod/codecs/mod_g729/mod_g729.c
src/mod/codecs/mod_gsm/mod_gsm.c
src/mod/codecs/mod_h26x/mod_h26x.c
src/mod/codecs/mod_ilbc/mod_ilbc.c
src/mod/codecs/mod_l16/mod_l16.c
src/mod/codecs/mod_speex/mod_speex.c
src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
src/mod/directories/mod_ldap/mod_ldap.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/mod/endpoints/mod_portaudio/mod_portaudio.c
src/mod/endpoints/mod_woomera/mod_woomera.c
src/mod/event_handlers/mod_cdr/mod_cdr.cpp
src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
src/mod/event_handlers/mod_event_socket/mod_event_socket.c
src/mod/event_handlers/mod_event_test/mod_event_test.c
src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c
src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
src/mod/formats/mod_native_file/mod_native_file.c
src/mod/formats/mod_sndfile/mod_sndfile.c
src/mod/languages/mod_perl/mod_perl.c
src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
src/mod/loggers/mod_console/mod_console.c
src/mod/say/mod_say_en/mod_say_en.c
src/mod/timers/mod_softtimer/mod_softtimer.c
src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c

index 2c5c3d2da34ada6a5c8d59be4b5ce4a062655d71..8931cd1f762aa9a3fcfc8b6c2d5e53d539af3e0c 100644 (file)
@@ -51,7 +51,8 @@
 #undef SWIFT_FAILED
 #define SWIFT_FAILED(r) ((void *)(r) < (void *)0)
 
-static const char modname[] = "mod_cepstral";
+SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_load);
+SWITCH_MODULE_DEFINITION(mod_cepstral, mod_cepstral_load, NULL, NULL);
 
 static swift_engine *engine;
 
@@ -426,7 +427,7 @@ static const switch_loadable_module_interface_t cepstral_module_interface = {
        /*.directory_interface */ NULL
 };
 
-switch_status_t switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_load)
 {
 
        /* Open the Swift TTS Engine */
index e6227f8b1dcb751643a15a80fc739119b0f3532c..29150541892db67b7ea2b3566570fe4fac115953 100644 (file)
@@ -32,7 +32,9 @@
  *
  */
 #include "switch.h"
-static const char modname[] = "mod_amr";
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load);
+SWITCH_MODULE_DEFINITION(mod_amr, mod_amr_load, NULL, NULL);
 
 #ifndef AMR_PASSTHROUGH
 #include "amr/interf_enc.h"
@@ -322,7 +324,7 @@ static switch_loadable_module_interface_t amr_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_amr_load)
 {
 #ifndef AMR_PASSTHROUGH
        char *cf = "amr.conf";
index 3ab8c5faaf4007faac14f43a8aceb0938408b041..4fc632f80d58b5755c27eccce703aaebbb0291e0 100644 (file)
@@ -32,8 +32,8 @@
 #include <switch.h>
 #include <g7xx/g711.h>
 
-
-static const char modname[] = "mod_g711";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g711_load);
+SWITCH_MODULE_DEFINITION(mod_g711, mod_g711_load, NULL, NULL);
 
 
 static switch_status_t switch_g711u_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
@@ -415,7 +415,7 @@ static switch_loadable_module_interface_t g711_module_interface = {
 };
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g711_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &g711_module_interface;
index 86a60b1fe1224ee31004689ed38e2d5acf6f3746..e7228890898b0d20a93642b5bcd4a8b0104f9d8c 100644 (file)
@@ -33,7 +33,8 @@
 #include <switch.h>
 #include "g7xx/g722.h"
 
-static const char modname[] = "mod_g722";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g722_load);
+SWITCH_MODULE_DEFINITION(mod_g722, mod_g722_load, NULL, NULL);
 
 struct g722_context {
        g722_decode_state_t decoder_object;
@@ -172,7 +173,7 @@ static switch_loadable_module_interface_t g722_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_g722_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &g722_module_interface;
index 8a7bb28a6a6a2207f5a753a5ad48da8a66c4479b..7b4710d650478cef8a6f88ed38b08c1f71d13894 100644 (file)
@@ -49,7 +49,8 @@ Flag UseVx = True;
 enum Crate WrkRate = Rate63;
 #endif
 
-static const char modname[] = "mod_g723_1";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g723_1_load);
+SWITCH_MODULE_DEFINITION(mod_g723_1, mod_g723_1_load, NULL, NULL);
 
 #ifndef G723_PASSTHROUGH
 struct g723_context {
@@ -202,7 +203,7 @@ static switch_loadable_module_interface_t g723_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_g723_1_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &g723_module_interface;
index f3225322f5709adacb28876b7bfbc3d159d8c5de..6525ca14de2ae482e8eaf7e2c7ccc1c5f1c6a51e 100644 (file)
@@ -33,7 +33,8 @@
 #include "g72x.h"
 #include "switch_bitpack.h"
 
-static const char modname[] = "mod_g726";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g726_load);
+SWITCH_MODULE_DEFINITION(mod_g726, mod_g726_load, NULL, NULL);
 
 typedef int (*encoder_t) (int, int, g726_state *);
 typedef int (*decoder_t) (int, int, g726_state *);
@@ -427,7 +428,7 @@ static switch_loadable_module_interface_t g726_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_g726_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &g726_module_interface;
index 555261891b2fb666049c75c761b54def532e9cf4..c4d07b6ccd5266c7ec10990ff525053205a63965 100644 (file)
  * mod_g729.c -- G729 Codec Module
  *
  */
-
-static const char modname[] = "mod_g729";
-
 #include "switch.h"
 
+SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load);
+SWITCH_MODULE_DEFINITION(mod_g729, mod_g729_load, NULL, NULL);
+
 #ifndef G729_PASSTHROUGH
 #include "g729/g729.h"
 
@@ -310,7 +310,7 @@ static switch_loadable_module_interface_t g729_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_g729_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &g729_module_interface;
index bc73aa0dac754e3287288cea517284d48b046d18..0dbb545b863e529c46dd3eaa2daf86c3b322eef1 100644 (file)
  */
 #include "switch.h"
 #include "gsm.h"
-static const char modname[] = "mod_gsm";
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_gsm_load);
+SWITCH_MODULE_DEFINITION(mod_gsm, mod_gsm_load, NULL, NULL);
+
 struct gsm_context {
        gsm encoder;
        gsm decoder;
@@ -162,7 +165,8 @@ static switch_loadable_module_interface_t gsm_module_interface = {
        /*.codec_interface */ &gsm_codec_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_gsm_load)
 {
 
        /* connect my internal structure to the blank pointer passed to me */
index c18420db788aa29431f25574247afc65569ff884..c12e0db818afbaa52b5fe98090fcf28741a0dc07 100644 (file)
@@ -31,8 +31,8 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_h26x";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_h26x_load);
+SWITCH_MODULE_DEFINITION(mod_h26x, mod_h26x_load, NULL, NULL);
 
 static switch_status_t switch_h26x_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
 {
@@ -132,8 +132,7 @@ static switch_loadable_module_interface_t h26x_module_interface = {
        /*.api_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_h26x_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &h26x_module_interface;
index 1cc15c3ee1e8c9955c9d78f4ff872bb0fae48d65..a1a6cbde0a11b75b36a8aa36c5aad250cb8a4b82 100644 (file)
@@ -34,7 +34,8 @@
 #include "iLBC_decode.h"
 #include "iLBC_define.h"
 
-static const char modname[] = "mod_ilbc";
+SWITCH_MODULE_LOAD_FUNCTION(mod_ilbc_load);
+SWITCH_MODULE_DEFINITION(mod_ilbc, mod_ilbc_load, NULL, NULL);
 
 struct ilbc_context {
        iLBC_Enc_Inst_t encoder;
@@ -314,9 +315,7 @@ static switch_loadable_module_interface_t ilbc_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_ilbc_load)
 {
 
        /* connect my internal structure to the blank pointer passed to me */
index 9e8412968611050a83b076c9bcf8c78548a52187..92b5e2fde117d6a3ba715d9950d83fb947b8ba55 100644 (file)
@@ -31,8 +31,8 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_l16";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_l16_load);
+SWITCH_MODULE_DEFINITION(mod_l16, mod_l16_load, NULL, NULL);
 
 static switch_status_t switch_raw_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
 {
@@ -424,7 +424,7 @@ static switch_loadable_module_interface_t raw_module_interface = {
 };
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_l16_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &raw_module_interface;
index d4b46874fb43832fb4990e5b3a8965fc008a9a3b..60db8f56048ca8cc17964c01959b2d1bda76af04 100644 (file)
@@ -33,7 +33,8 @@
 #include <speex/speex.h>
 #include <speex/speex_preprocess.h>
 
-static const char modname[] = "mod_speex";
+SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load);
+SWITCH_MODULE_DEFINITION(mod_speex, mod_speex_load, NULL, NULL);
 
 static const switch_codec_settings_t default_codec_settings = {
        /*.quality */ 5,
@@ -403,7 +404,7 @@ static switch_loadable_module_interface_t speex_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_speex_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &speex_module_interface;
index 46bf7225f9fe6241f64c3f6bb18d800c3231c294..03ea8054cc2462db669cb1988971bb9a9220c74d 100644 (file)
@@ -34,8 +34,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-
-static const char modname[] = "mod_dialplan_directory";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load);
+SWITCH_MODULE_DEFINITION(mod_dialplan_directory, mod_dialplan_directory_load, NULL, NULL);
 
 static struct {
        char *directory_name;
@@ -166,7 +166,7 @@ static const switch_loadable_module_interface_t directory_dialplan_module_interf
        /*.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_dialplan_directory_load)
 {
 
        load_config();
index c0b6c4c8758695896a5234ef8182b1289faea3ee..3683e051100abc681f9bca8f3bca4812631161c8 100644 (file)
@@ -34,7 +34,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-static const char modname[] = "mod_dialplan_xml";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_xml_load);
+SWITCH_MODULE_DEFINITION(mod_dialplan_xml, mod_dialplan_xml_load, NULL, NULL);
 
 typedef enum {
        BREAK_ON_TRUE,
@@ -392,7 +393,7 @@ static const switch_loadable_module_interface_t dialplan_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_dialplan_xml_load)
 {
 
        /* connect my internal structure to the blank pointer passed to me */
index 9bef0254cae332ffd245b99e93ec4fe337a5e43d..eb5f26e600534d1025e89fb8eb4c01544efe9c03 100644 (file)
@@ -40,7 +40,8 @@
 #include <ldap.h>
 #endif
 
-static const char modname[] = "mod_ldap";
+SWITCH_MODULE_LOAD_FUNCTION(mod_ldap_load);
+SWITCH_MODULE_DEFINITION(mod_ldap, mod_ldap_load, NULL, NULL);
 
 struct ldap_context {
        LDAP *ld;
@@ -207,7 +208,7 @@ static const switch_directory_interface_t ldap_directory_interface = {
 };
 
 
-static switch_loadable_module_interface_t skel_module_interface = {
+static switch_loadable_module_interface_t ldap_module_interface = {
        /*.module_name */ modname,
        /*.endpoint_interface */ NULL,
        /*.timer_interface */ NULL,
@@ -220,10 +221,10 @@ static switch_loadable_module_interface_t skel_module_interface = {
        /*.directory_interface */ &ldap_directory_interface
 };
 
-switch_status_t switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_ldap_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
-       *module_interface = &skel_module_interface;
+       *module_interface = &ldap_module_interface;
 
        /* indicate that the module should continue to be loaded */
        return SWITCH_STATUS_SUCCESS;
index ceb9d2689f006123b58b09462405297cceeda911..588440dec8ed0909c29f205e41974aa09bc8edd7 100644 (file)
@@ -43,7 +43,9 @@
 #define DL_EVENT_CONNECTED "dingaling::connected"
 #define MDL_CHAT_PROTO "jingle"
 
-static const char modname[] = "mod_dingaling";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown);
+SWITCH_MODULE_DEFINITION(mod_dingaling, mod_dingaling_load, mod_dingaling_shutdown, NULL);
 
 static switch_memory_pool_t *module_pool = NULL;
 
@@ -1824,7 +1826,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
 
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load)
 {
 
        if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
@@ -1927,8 +1929,7 @@ static switch_status_t init_profile(mdl_profile_t *profile, uint8_t login)
        return SWITCH_STATUS_SUCCESS;
 }
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown)
 {
        sign_off();
 
index a639f59b1acc27ef845a04d104af0c6d701e94bf..8605cf8f8bfa537fdfddfbe1be31ebbcac002d09 100644 (file)
@@ -39,7 +39,9 @@
 
 #define MY_EVENT_RINGING "portaudio::ringing"
 
-static const char modname[] = "mod_portaudio";
+SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_portaudio_shutdown);
+SWITCH_MODULE_DEFINITION(mod_portaudio, mod_portaudio_load, mod_portaudio_shutdown, NULL);
 
 static switch_memory_pool_t *module_pool = NULL;
 //static int running = 1;
@@ -872,7 +874,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_load)
 {
 
        switch_status_t status;
@@ -1039,7 +1041,7 @@ static switch_status_t load_config(void)
        return status;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_portaudio_shutdown)
 {
        if (globals.read_codec.implementation) {
                switch_core_codec_destroy(&globals.read_codec);
index d8582b25d2bcbf39211e55d89011382f46c6e0f0..6b4076108062b2285c8a1d1f2967e9abb23e3a46 100644 (file)
 //#define MEDIA_ANSWER "ANSWER"
 //#define USE_ANSWER 1
 
-static const char modname[] = "mod_woomera";
+SWITCH_MODULE_LOAD_FUNCTION(mod_woomera_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_woomera_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_woomera_runtime);
+SWITCH_MODULE_DEFINITION(mod_woomera, mod_woomera_load, mod_woomera_shutdown, mod_woomera_runtime);
 
 static switch_memory_pool_t *module_pool = NULL;
 
@@ -1269,7 +1272,7 @@ static void *woomera_thread_run(void *obj)
        return NULL;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_woomera_runtime)
 {
 
        woomera_thread_run(&default_profile);
@@ -1277,7 +1280,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
        return SWITCH_STATUS_TERM;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_woomera_shutdown)
 {
        int x = 0;
        woomera_profile_thread_running(&default_profile, 1, 0);
@@ -1291,7 +1294,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_woomera_load)
 {
 
        struct woomera_profile *profile = &default_profile;
index f96f7289a552a6ee1ef165380dae8b39e94a9579..0761e5a343b8afaad287086a55b9134038f6eae7 100644 (file)
 #include <sys/stat.h>
 #include <fcntl.h>
 
-static const char modname[] = "mod_cdr - CDR Engine";
+SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_cdr_runtime);
+SWITCH_MODULE_DEFINITION(mod_cdr, mod_cdr_load, mod_cdr_shutdown, mod_cdr_runtime);
+
 static int RUNNING = 0;
 static CDRContainer *newcdrcontainer;
 static switch_memory_pool_t *module_pool;
@@ -122,10 +126,10 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface **interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
-       *interface = &cdr_module_interface;
+       *module_interface = &cdr_module_interface;
        
        switch_core_add_state_handler(&state_handlers);
        
@@ -142,7 +146,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_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_cdr_runtime)
 {
        RUNNING = 1;
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_cdr made it to runtime.  Wee!\n");
@@ -196,7 +200,7 @@ SWITCH_STANDARD_API(modcdr_show_available)
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_shutdown)
 {
        delete newcdrcontainer;
        switch_thread_rwlock_destroy(cdr_rwlock);
index 50a0616e5160d3678b690090567c317acb580be3..7fce2a0a869c3f32913d7acfb89c52bcd183cd0c 100644 (file)
 #include <switch.h>
 static char *MARKER = "1";
 
-static const char modname[] = "mod_event_multicast";
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime);
+SWITCH_MODULE_DEFINITION(mod_event_multicast, mod_event_multicast_load, mod_event_multicast_shutdown, mod_event_multicast_runtime);
 
 static switch_memory_pool_t *module_pool = NULL;
 
@@ -183,7 +186,7 @@ static switch_loadable_module_interface_t event_test_module_interface = {
 };
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load)
 {
 
        memset(&globals, 0, sizeof(globals));
@@ -246,7 +249,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown)
 {
        int x = 0;
 
@@ -259,8 +262,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
        return SWITCH_STATUS_SUCCESS;
 }
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime)
 {
        switch_event_t *local_event;
        char buf[65536] = { 0 };
index 8149ec62f46b66b6a6b5fb80aec9bd43fb348f08..7131d3f2931e18bfc773913c2f109be14c066543 100644 (file)
 #include <switch.h>
 #define CMD_BUFLEN 1024 * 1000
 
-static const char modname[] = "mod_event_socket";
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime);
+SWITCH_MODULE_DEFINITION(mod_event_socket, mod_event_socket_load, mod_event_socket_shutdown, mod_event_socket_runtime);
+
 static char *MARKER = "1";
 
 typedef enum {
@@ -280,7 +284,7 @@ static void close_socket(switch_socket_t ** sock)
        switch_mutex_unlock(listen_list.sock_mutex);
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown)
 {
        listener_t *l;
 
@@ -300,8 +304,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(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_event_socket_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &event_socket_module_interface;
@@ -1188,7 +1191,7 @@ static int config(void)
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
 {
        switch_memory_pool_t *pool = NULL, *listener_pool = NULL;
        switch_status_t rv;
index d5d15243939b7c48fcff84651bdb3c96d9790626..98b502d060f1123061898148ecf2e8e9cd47d31d 100644 (file)
@@ -31,7 +31,8 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_event_test";
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_test_load);
+SWITCH_MODULE_DEFINITION(mod_event_test, mod_event_test_load, NULL, NULL);
 
 //#define TORTURE_ME
 
@@ -124,8 +125,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
 }
 #endif
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_test_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &event_test_module_interface;
index 460fa7f7ac2c81fa3d88afaf297a10fb067ef7bb..b83d56b698eb0ae5b9a5bf5fcd13e3f13ef8d816 100644 (file)
 #include <switch.h>
 #include <iksemel.h>
 
-static const char modname[] = "mod_xmpp_event";
+SWITCH_MODULE_LOAD_FUNCTION(mod_xmpp_event_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xmpp_event_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_xmpp_event_runtime);
+SWITCH_MODULE_DEFINITION(mod_xmpp_event, mod_xmpp_event_load, mod_xmpp_event_shutdown, mod_xmpp_event_runtime);
 
 static int RUNNING = 0;
 static iksfilter *my_filter;
@@ -397,7 +400,7 @@ static switch_loadable_module_interface_t xmpp_event_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_xmpp_event_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &xmpp_event_module_interface;
@@ -411,7 +414,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xmpp_event_shutdown)
 {
 
        if (RUNNING) {
@@ -424,7 +427,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_xmpp_event_runtime)
 {
        RUNNING = 1;
        xmpp_connect(globals.jid, globals.passwd);
index 99b19836ce1be13b0e231d2a2a461b80e9cf34bf..3f12329f8e8617a4ffa4d0749cb48150514e2d76 100644 (file)
 #endif
 #include <howl.h>
 
-static const char modname[] = "mod_zeroconf";
+SWITCH_MODULE_LOAD_FUNCTION(mod_zeroconf_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_zeroconf_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_zeroconf_runtime);
+SWITCH_MODULE_DEFINITION(mod_zeroconf, mod_zeroconf_load, mod_zeroconf_shutdown, mod_zeroconf_runtime);
 
 static switch_memory_pool_t *module_pool = NULL;
 
@@ -249,7 +252,7 @@ static switch_loadable_module_interface_t zeroconf_module_interface = {
 
 static int RUNNING = 0;
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_zeroconf_shutdown)
 {
        if (RUNNING == 1) {
                RUNNING = -1;
@@ -258,8 +261,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
        return SWITCH_STATUS_SUCCESS;
 }
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_zeroconf_load)
 {
 
        memset(&globals, 0, sizeof(globals));
@@ -298,7 +300,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
 }
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_zeroconf_runtime)
 {
 
        RUNNING = 1;
index c33b0872ce7784563ccf08c26e27bd48e730c821..b48e013e67974d6430ac4ed01ad0655d1bdb146d 100644 (file)
@@ -31,7 +31,8 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_native_file";
+SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load);
+SWITCH_MODULE_DEFINITION(mod_native_file, mod_native_file_load, NULL, NULL);
 
 struct native_file_context {
        switch_file_t *fd;
@@ -163,7 +164,7 @@ static switch_loadable_module_interface_t native_file_module_interface = {
 
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load)
 {
 
        const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS];
index a453b0dcddb9ca7fb475e35194f158b902be5b85..52978985e288db9e80e278da66f57e3ed5798b02 100644 (file)
@@ -32,7 +32,8 @@
 #include <switch.h>
 #include <sndfile.h>
 
-static const char modname[] = "mod_sndfile";
+SWITCH_MODULE_LOAD_FUNCTION(mod_sndfile_load);
+SWITCH_MODULE_DEFINITION(mod_sndfile, mod_sndfile_load, NULL, NULL);
 
 static switch_memory_pool_t *module_pool = NULL;
 
@@ -361,7 +362,7 @@ static switch_status_t setup_formats(void)
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_sndfile_load)
 {
 
        if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
index d54d50d6f5bb62412386a0f026fc6a80360af2b4..34a5d0a9f8cdf5502ada2618b6e1deeff3aca7f4 100644 (file)
@@ -43,7 +43,9 @@
 static char *embedding[] = { "", "-e", "" };
 EXTERN_C void xs_init(pTHX);
 
-static const char modname[] = "mod_perl";
+SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_perl_shutdown);
+SWITCH_MODULE_DEFINITION(mod_perl, mod_perl_load, mod_perl_shutdown, NULL);
 
 static struct {
        PerlInterpreter *my_perl;
@@ -100,7 +102,7 @@ static switch_loadable_module_interface_t perl_module_interface = {
 };
 
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_perl_shutdown)
 {
        if (globals.my_perl) {
                perl_destruct(globals.my_perl);
@@ -111,7 +113,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load)
 {
 
        PerlInterpreter *my_perl;
index ec27254ccd6faabcc2ef7cc260a85acbd26c4357..efc8abbfd1bb6b3cb961a188e04d0206a177d71b 100644 (file)
@@ -38,8 +38,9 @@
 #include <curl/curl.h>
 #endif
 
-static const char modname[] = "mod_spidermonkey";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spidermonkey_shutdown);
+SWITCH_MODULE_DEFINITION(mod_spidermonkey, mod_spidermonkey_load, mod_spidermonkey_shutdown, NULL);
 
 static void session_destroy(JSContext * cx, JSObject * obj);
 static JSBool session_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval);
@@ -3046,7 +3047,7 @@ static void  message_query_handler(switch_event_t *event)
 
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load)
 {
        switch_status_t status;
 
@@ -3069,7 +3070,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_spidermonkey_shutdown)
 {
        curl_global_cleanup();
        return SWITCH_STATUS_SUCCESS;
index 0969cb527c7af5d3238cbfaecda2e4bf24b0af9b..0b69aec02519c9e76dd326d55cdfbc50018dec58 100644 (file)
@@ -31,7 +31,9 @@
  */
 #include <switch.h>
 
-static const char modname[] = "mod_console";
+SWITCH_MODULE_LOAD_FUNCTION(mod_console_load);
+SWITCH_MODULE_DEFINITION(mod_console, mod_console_load, NULL, NULL);
+
 static const uint8_t STATIC_LEVELS[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
 static int COLORIZE = 0;
 #ifdef WIN32
@@ -188,7 +190,7 @@ static switch_status_t switch_console_logger(const switch_log_node_t *node, swit
        return SWITCH_STATUS_SUCCESS;
 }
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_console_load)
 {
        if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
index 52d895012208fe5200be0a322d6112a5e676d06b..0a08fde3e33b4251b5ec981bb7f84ff11bd6a97a 100644 (file)
@@ -33,8 +33,8 @@
 #include <math.h>
 #include <ctype.h>
 
-static const char modname[] = "mod_say_en";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_say_en_load);
+SWITCH_MODULE_DEFINITION(mod_say_en, mod_say_en_load, NULL, NULL);
 
 #define say_num(num, t) {                                                      \
                char tmp[80];\
@@ -537,7 +537,7 @@ static switch_loadable_module_interface_t say_en_module_interface = {
        /*.asr_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_say_en_load)
 {
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = &say_en_module_interface;
index cc305d8c98bed76d71009a3fa7601e6dbe227cdd..b26060685e987fcec654791d97870e05f7499830 100644 (file)
@@ -46,7 +46,11 @@ static struct {
        switch_mutex_t *mutex;
 } globals;
 
-static const char modname[] = "mod_softtimer";
+SWITCH_MODULE_LOAD_FUNCTION(mod_softtimer_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_softtimer_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_softtimer_runtime);
+SWITCH_MODULE_DEFINITION(mod_softtimer, mod_softtimer_load, mod_softtimer_shutdown, mod_softtimer_runtime);
+
 #define MAX_ELEMENTS 1000
 
 struct timer_private {
@@ -191,13 +195,13 @@ static const switch_timer_interface_t timer_interface = {
        /*.timer_destroy */ timer_destroy
 };
 
-static const switch_loadable_module_interface_t mod_softtimer_module_interface = {
+static const switch_loadable_module_interface_t softtimer_module_interface = {
        /*.module_name */ modname,
        /*.endpoint_interface */ NULL,
        /*.timer_interface */ &timer_interface
 };
 
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_softtimer_load)
 {
 
        if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
@@ -206,7 +210,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
        }
 
        /* connect my internal structure to the blank pointer passed to me */
-       *module_interface = &mod_softtimer_module_interface;
+       *module_interface = &softtimer_module_interface;
 
        /* indicate that the module should continue to be loaded */
        return SWITCH_STATUS_SUCCESS;
@@ -218,7 +222,8 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
 
 #define STEP_MS 1
 #define STEP_MIC 1000
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_softtimer_runtime)
 {
        switch_time_t reference = switch_time_now();
        uint32_t current_ms = 0;
@@ -267,8 +272,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
        return SWITCH_STATUS_TERM;
 }
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_softtimer_shutdown)
 {
 
        if (globals.RUNNING) {
index 03643274a19ef83a9b03ea59e8bc05a88131e6a6..db25bff0783bf038468225d5ac1b4f509a19e598 100644 (file)
@@ -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;
index 0a1fd9f2d7a7637b05ed2a07ae30ebae1d18f056..9d44400e01ef1b815154eda8a228b6f065936254 100644 (file)
@@ -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;
index e2ebb81a45f862acf987b5abc99723f8d0773eb5..9861774454b1dcb3ef3862cad1f3f59679411c44 100644 (file)
 #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;