[Freeswitch-svn] [commit] r5343 - in freeswitch/trunk/src/mod: asr_tts/mod_cepstral codecs/mod_amr codecs/mod_g711 codecs/mod_g722 codecs/mod_g723_1 codecs/mod_g726 codecs/mod_g729 codecs/mod_gsm codecs/mod_h26x codecs/mod_ilbc codecs/mod_l16 codecs/mod_speex dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml directories/mod_ldap endpoints/mod_dingaling endpoints/mod_portaudio endpoints/mod_woomera event_handlers/mod_cdr event_handlers/mod_event_multicast event_handlers/mod_event_socket event_handlers/mod_event_test event_handlers/mod_xmpp_event event_handlers/mod_zeroconf formats/mod_native_file formats/mod_sndfile languages/mod_perl languages/mod_spidermonkey loggers/mod_console say/mod_say_en timers/mod_softtimer xml_int/mod_xml_cdr xml_int/mod_xml_curl xml_int/mod_xml_rpc

Freeswitch SVN mikej at freeswitch.org
Wed Jun 13 13:06:10 EDT 2007


Author: mikej
Date: Wed Jun 13 13:06:10 2007
New Revision: 5343

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

Log:
move some modules to use the new module interface macros.


Modified: freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	(original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	/*.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 */

Modified: freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	/*.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";

Modified: freeswitch/trunk/src/mod/codecs/mod_g711/mod_g711.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_g711/mod_g711.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_g711/mod_g711.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 };
 
 
-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;

Modified: freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	/*.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;

Modified: freeswitch/trunk/src/mod/codecs/mod_g723_1/mod_g723_1.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_g723_1/mod_g723_1.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_g723_1/mod_g723_1.c	Wed Jun 13 13:06:10 2007
@@ -49,7 +49,8 @@
 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 @@
 	/*.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;

Modified: freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	/*.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;

Modified: freeswitch/trunk/src/mod/codecs/mod_g729/mod_g729.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_g729/mod_g729.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_g729/mod_g729.c	Wed Jun 13 13:06:10 2007
@@ -31,11 +31,11 @@
  * 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 @@
 	/*.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;

Modified: freeswitch/trunk/src/mod/codecs/mod_gsm/mod_gsm.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_gsm/mod_gsm.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_gsm/mod_gsm.c	Wed Jun 13 13:06:10 2007
@@ -31,7 +31,10 @@
  */
 #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 @@
 	/*.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 */

Modified: freeswitch/trunk/src/mod/codecs/mod_h26x/mod_h26x.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_h26x/mod_h26x.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_h26x/mod_h26x.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	/*.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;

Modified: freeswitch/trunk/src/mod/codecs/mod_ilbc/mod_ilbc.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_ilbc/mod_ilbc.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_ilbc/mod_ilbc.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	/*.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 */

Modified: freeswitch/trunk/src/mod/codecs/mod_l16/mod_l16.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_l16/mod_l16.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_l16/mod_l16.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 };
 
 
-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;

Modified: freeswitch/trunk/src/mod/codecs/mod_speex/mod_speex.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_speex/mod_speex.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_speex/mod_speex.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	/*.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;

Modified: freeswitch/trunk/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
==============================================================================
--- freeswitch/trunk/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c	(original)
+++ freeswitch/trunk/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	/*.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();

Modified: freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
==============================================================================
--- freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	(original)
+++ freeswitch/trunk/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	/*.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 */

Modified: freeswitch/trunk/src/mod/directories/mod_ldap/mod_ldap.c
==============================================================================
--- freeswitch/trunk/src/mod/directories/mod_ldap/mod_ldap.c	(original)
+++ freeswitch/trunk/src/mod/directories/mod_ldap/mod_ldap.c	Wed Jun 13 13:06:10 2007
@@ -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 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 @@
 	/*.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;

Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 
 }
 
-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 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown)
 {
 	sign_off();
 

Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 }
 
 
-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 @@
 	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);

Modified: freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c	Wed Jun 13 13:06:10 2007
@@ -48,7 +48,10 @@
 //#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 @@
 	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 @@
 	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 @@
 	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;

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr/mod_cdr.cpp
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr/mod_cdr.cpp	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr/mod_cdr.cpp	Wed Jun 13 13:06:10 2007
@@ -40,7 +40,11 @@
 #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 @@
 	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 @@
 	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 @@
 	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);

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	Wed Jun 13 13:06:10 2007
@@ -32,7 +32,10 @@
 #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 @@
 };
 
 
-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_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown)
 {
 	int x = 0;
 
@@ -259,8 +262,7 @@
 	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 };

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Wed Jun 13 13:06:10 2007
@@ -32,7 +32,11 @@
 #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 @@
 	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_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 @@
 }
 
 
-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;

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_test/mod_event_test.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_test/mod_event_test.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_test/mod_event_test.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 }
 #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;

Modified: freeswitch/trunk/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c	Wed Jun 13 13:06:10 2007
@@ -32,7 +32,10 @@
 #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 @@
 	/*.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_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xmpp_event_shutdown)
 {
 
 	if (RUNNING) {
@@ -424,7 +427,7 @@
 	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);

Modified: freeswitch/trunk/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c	Wed Jun 13 13:06:10 2007
@@ -35,7 +35,10 @@
 #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 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 @@
 	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_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_zeroconf_runtime)
 {
 
 	RUNNING = 1;

Modified: freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c	(original)
+++ freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 
 
 
-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];

Modified: freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c	(original)
+++ freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	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) {

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	Wed Jun 13 13:06:10 2007
@@ -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 @@
 };
 
 
-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 @@
 	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;

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 
 }
 
-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 @@
 	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;

Modified: freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c
==============================================================================
--- freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c	(original)
+++ freeswitch/trunk/src/mod/loggers/mod_console/mod_console.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	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");

Modified: freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c
==============================================================================
--- freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c	(original)
+++ freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 	/*.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;

Modified: freeswitch/trunk/src/mod/timers/mod_softtimer/mod_softtimer.c
==============================================================================
--- freeswitch/trunk/src/mod/timers/mod_softtimer/mod_softtimer.c	(original)
+++ freeswitch/trunk/src/mod/timers/mod_softtimer/mod_softtimer.c	Wed Jun 13 13:06:10 2007
@@ -46,7 +46,11 @@
 	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 @@
 	/*.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 @@
 	}
 
 	/* 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 @@
 
 #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 @@
 	return SWITCH_STATUS_TERM;
 }
 
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_softtimer_shutdown)
 {
 
 	if (globals.RUNNING) {

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c	(original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c	Wed Jun 13 13:06:10 2007
@@ -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_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 @@
 	/*.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;

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c	(original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c	Wed Jun 13 13:06:10 2007
@@ -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 @@
 }
 
 
-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 @@
 	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;

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	(original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	Wed Jun 13 13:06:10 2007
@@ -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_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 @@
 	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_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown)
 {
 	globals.running = 0;
 	return SWITCH_STATUS_SUCCESS;



More information about the Freeswitch-svn mailing list