[asterisk-commits] trunk r20003 - in /trunk: ./ apps/ cdr/ channels/ codecs/ formats/ funcs/ inc...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 14 07:09:28 MST 2006


Author: rizzo
Date: Fri Apr 14 09:08:19 2006
New Revision: 20003

URL: http://svn.digium.com/view/asterisk?rev=20003&view=rev
Log:
This rather large commit changes the way modules are loaded. 
 
As partly documented in loader.c and include/asterisk/module.h,
modules are now expected to return all of their methods and flags
into a structure 'mod_data', and are normally loaded with RTLD_NOW
| RTLD_LOCAL, so symbols are resolved immediately and conflicts
should be less likely.  Only in a small number of cases (res_*,
typically) modules are loaded RTLD_GLOBAL, so they can export
symbols.
 
The core of the change is only the two files loader.c and
include/asterisk/module.h, all the rest is simply adaptation of the
existing modules to the new API, a rather mechanical (but believe
me, time and finger-consuming!) process whose detail you can figure
out by svn diff'ing any single module.

Expect some minor compilation issue after this change, please
report it on mantis http://bugs.digium.com/view.php?id=6968
so we collect all the feedback in one place.

I am just sorry that this change missed SVN version number 20000!


Modified:
    trunk/apps/app_adsiprog.c
    trunk/apps/app_alarmreceiver.c
    trunk/apps/app_amd.c
    trunk/apps/app_authenticate.c
    trunk/apps/app_cdr.c
    trunk/apps/app_chanisavail.c
    trunk/apps/app_channelredirect.c
    trunk/apps/app_chanspy.c
    trunk/apps/app_controlplayback.c
    trunk/apps/app_db.c
    trunk/apps/app_dial.c
    trunk/apps/app_dictate.c
    trunk/apps/app_directed_pickup.c
    trunk/apps/app_directory.c
    trunk/apps/app_disa.c
    trunk/apps/app_dumpchan.c
    trunk/apps/app_echo.c
    trunk/apps/app_exec.c
    trunk/apps/app_externalivr.c
    trunk/apps/app_festival.c
    trunk/apps/app_flash.c
    trunk/apps/app_forkcdr.c
    trunk/apps/app_getcpeid.c
    trunk/apps/app_hasnewvoicemail.c
    trunk/apps/app_ices.c
    trunk/apps/app_image.c
    trunk/apps/app_ivrdemo.c
    trunk/apps/app_lookupblacklist.c
    trunk/apps/app_lookupcidname.c
    trunk/apps/app_macro.c
    trunk/apps/app_meetme.c
    trunk/apps/app_milliwatt.c
    trunk/apps/app_mixmonitor.c
    trunk/apps/app_morsecode.c
    trunk/apps/app_mp3.c
    trunk/apps/app_nbscat.c
    trunk/apps/app_osplookup.c
    trunk/apps/app_page.c
    trunk/apps/app_parkandannounce.c
    trunk/apps/app_playback.c
    trunk/apps/app_privacy.c
    trunk/apps/app_queue.c
    trunk/apps/app_random.c
    trunk/apps/app_read.c
    trunk/apps/app_readfile.c
    trunk/apps/app_realtime.c
    trunk/apps/app_record.c
    trunk/apps/app_rpt.c
    trunk/apps/app_sayunixtime.c
    trunk/apps/app_senddtmf.c
    trunk/apps/app_sendtext.c
    trunk/apps/app_setcallerid.c
    trunk/apps/app_setcdruserfield.c
    trunk/apps/app_settransfercapability.c
    trunk/apps/app_skel.c
    trunk/apps/app_sms.c
    trunk/apps/app_softhangup.c
    trunk/apps/app_speech_utils.c
    trunk/apps/app_stack.c
    trunk/apps/app_system.c
    trunk/apps/app_talkdetect.c
    trunk/apps/app_test.c
    trunk/apps/app_transfer.c
    trunk/apps/app_url.c
    trunk/apps/app_userevent.c
    trunk/apps/app_verbose.c
    trunk/apps/app_voicemail.c
    trunk/apps/app_waitforring.c
    trunk/apps/app_waitforsilence.c
    trunk/apps/app_while.c
    trunk/apps/app_zapateller.c
    trunk/apps/app_zapbarge.c
    trunk/apps/app_zapras.c
    trunk/apps/app_zapscan.c
    trunk/asterisk.c
    trunk/cdr.c
    trunk/cdr/cdr_csv.c
    trunk/cdr/cdr_custom.c
    trunk/cdr/cdr_manager.c
    trunk/channels/chan_agent.c
    trunk/channels/chan_features.c
    trunk/channels/chan_iax2.c
    trunk/channels/chan_local.c
    trunk/channels/chan_mgcp.c
    trunk/channels/chan_oss.c
    trunk/channels/chan_phone.c
    trunk/channels/chan_sip.c
    trunk/channels/chan_skinny.c
    trunk/channels/chan_zap.c
    trunk/cli.c
    trunk/codecs/codec_a_mu.c
    trunk/codecs/codec_adpcm.c
    trunk/codecs/codec_alaw.c
    trunk/codecs/codec_g723_1.c
    trunk/codecs/codec_g726.c
    trunk/codecs/codec_gsm.c
    trunk/codecs/codec_ilbc.c
    trunk/codecs/codec_lpc10.c
    trunk/codecs/codec_speex.c
    trunk/codecs/codec_ulaw.c
    trunk/file.c
    trunk/formats/format_g723.c
    trunk/formats/format_g726.c
    trunk/formats/format_g729.c
    trunk/formats/format_gsm.c
    trunk/formats/format_h263.c
    trunk/formats/format_h264.c
    trunk/formats/format_ilbc.c
    trunk/formats/format_jpeg.c
    trunk/formats/format_ogg_vorbis.c
    trunk/formats/format_pcm.c
    trunk/formats/format_sln.c
    trunk/formats/format_vox.c
    trunk/formats/format_wav.c
    trunk/formats/format_wav_gsm.c
    trunk/funcs/func_base64.c
    trunk/funcs/func_callerid.c
    trunk/funcs/func_cdr.c
    trunk/funcs/func_channel.c
    trunk/funcs/func_curl.c
    trunk/funcs/func_cut.c
    trunk/funcs/func_db.c
    trunk/funcs/func_enum.c
    trunk/funcs/func_env.c
    trunk/funcs/func_groupcount.c
    trunk/funcs/func_language.c
    trunk/funcs/func_logic.c
    trunk/funcs/func_math.c
    trunk/funcs/func_md5.c
    trunk/funcs/func_moh.c
    trunk/funcs/func_odbc.c
    trunk/funcs/func_rand.c
    trunk/funcs/func_sha1.c
    trunk/funcs/func_strings.c
    trunk/funcs/func_timeout.c
    trunk/funcs/func_uri.c
    trunk/include/asterisk.h
    trunk/include/asterisk/file.h
    trunk/include/asterisk/module.h
    trunk/include/asterisk/translate.h
    trunk/loader.c
    trunk/pbx/pbx_ael.c
    trunk/pbx/pbx_config.c
    trunk/pbx/pbx_dundi.c
    trunk/pbx/pbx_loopback.c
    trunk/pbx/pbx_realtime.c
    trunk/pbx/pbx_spool.c
    trunk/res/res_adsi.c
    trunk/res/res_agi.c
    trunk/res/res_clioriginate.c
    trunk/res/res_config_odbc.c
    trunk/res/res_config_pgsql.c
    trunk/res/res_convert.c
    trunk/res/res_crypto.c
    trunk/res/res_features.c
    trunk/res/res_indications.c
    trunk/res/res_monitor.c
    trunk/res/res_musiconhold.c
    trunk/res/res_odbc.c
    trunk/res/res_smdi.c
    trunk/res/res_speech.c
    trunk/translate.c

Modified: trunk/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_adsiprog.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_adsiprog.c (original)
+++ trunk/apps/app_adsiprog.c Fri Apr 14 09:08:19 2006
@@ -58,8 +58,6 @@
 static char *descrip =
 "  ADSIProg(script): This application programs an ADSI Phone with the given\n"
 "script. If nothing is specified, the default script (asterisk.adsi) is used.\n";
-
-LOCAL_USER_DECL;
 
 struct adsi_event {
 	int id;
@@ -1568,35 +1566,32 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
+
+	STANDARD_HANGUP_LOCALUSERS;
 
 	res = ast_unregister_application(app);	
 	
-	STANDARD_HANGUP_LOCALUSERS;
 
 	return res;
 }
 
-int load_module(void)
-{
+static int load_module(void *mod)
+{
+	__mod_desc = mod;
 	return ast_register_application(app, adsi_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Asterisk ADSI Programming Application";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: trunk/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_alarmreceiver.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_alarmreceiver.c (original)
+++ trunk/apps/app_alarmreceiver.c Fri Apr 14 09:08:19 2006
@@ -96,8 +96,6 @@
 /* Misc variables */
 	
 static char event_file[14] = "/event-XXXXXX";
-
-LOCAL_USER_DECL;
 
 /*
 * Attempt to access a database variable and increment it,
@@ -818,7 +816,7 @@
 */
 
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -829,25 +827,21 @@
 	return res;
 }
 
-int load_module(void)
-{
+static int load_module(void *mod)
+{
+	__mod_desc = mod;
 	load_config();
 	return ast_register_application(app, alarmreceiver_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Alarm Receiver for Asterisk";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_amd.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_amd.c (original)
+++ trunk/apps/app_amd.c Fri Apr 14 09:08:19 2006
@@ -72,9 +72,6 @@
 "               MAXWORDS-<%d wordsCount>-<%d maximumNumberOfWords>\n"
 "               LONGGREETING-<%d voiceDuration>-<%d greeting>\n";
 
-
-LOCAL_USER_DECL;
-
 #define STATE_IN_WORD       1
 #define STATE_IN_SILENCE    2
 
@@ -392,38 +389,33 @@
 	return;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	STANDARD_HANGUP_LOCALUSERS;
 	return ast_unregister_application(app);
 }
 
-int load_module(void)
-{
+static int load_module(void *mod)
+{
+	__mod_desc = mod;
 	load_config();
 	return ast_register_application(app, amd_exec, synopsis, descrip);
 }
 
-int reload(void)
+static int reload(void *mod)
 {
 	load_config();
 	return 0;
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Answering Machine Detection Application";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
 
+STD_MOD(MOD_1, reload, NULL, NULL);

Modified: trunk/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_authenticate.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_authenticate.c (original)
+++ trunk/apps/app_authenticate.c Fri Apr 14 09:08:19 2006
@@ -90,8 +90,6 @@
 "         press the '#' key).\n"
 "         Defaults to 0 - no limit - wait for the user press the '#' key.\n"
 ;
-
-LOCAL_USER_DECL;
 
 static int auth_exec(struct ast_channel *chan, void *data)
 {
@@ -235,35 +233,31 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
+	STANDARD_HANGUP_LOCALUSERS;
+
 	res = ast_unregister_application(app);
 
-	STANDARD_HANGUP_LOCALUSERS;
 	
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, auth_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Authentication Application";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: trunk/apps/app_cdr.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_cdr.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_cdr.c (original)
+++ trunk/apps/app_cdr.c Fri Apr 14 09:08:19 2006
@@ -27,8 +27,6 @@
 
 #include <sys/types.h>
 #include <stdlib.h>
-
-#define STATIC_MODULE
 
 #include "asterisk.h"
 
@@ -63,7 +61,7 @@
 	return 0;
 }
 
-STATIC_MODULE int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -74,24 +72,17 @@
 	return res;
 }
 
-STATIC_MODULE int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip);
 }
 
-STATIC_MODULE const char *description(void)
+static const char *description(void)
 {
 	return "Tell Asterisk to not maintain a CDR for the current call";
 }
 
-STATIC_MODULE int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-STATIC_MODULE const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }

Modified: trunk/apps/app_chanisavail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_chanisavail.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_chanisavail.c (original)
+++ trunk/apps/app_chanisavail.c Fri Apr 14 09:08:19 2006
@@ -155,7 +155,7 @@
 	return 0;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res = 0;
 
@@ -166,24 +166,20 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
+	__mod_desc = mod;
 	return ast_register_application(app, chanavail_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Check channel availability";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_channelredirect.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_channelredirect.c (original)
+++ trunk/apps/app_channelredirect.c Fri Apr 14 09:08:19 2006
@@ -120,7 +120,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -131,26 +131,20 @@
 	return res;	
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
+	__mod_desc = mod;
 	return ast_register_application(app, asyncgoto_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Channel Redirect";
 }
 
-int usecount(void)
-{
-	int res;
-
-	STANDARD_USECOUNT(res);
-
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_chanspy.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Fri Apr 14 09:08:19 2006
@@ -554,7 +554,7 @@
 	ALL_DONE(u, res);
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -565,24 +565,20 @@
 	return res;
 }
 
-int load_module(void)
-{
+static int load_module(void *mod)
+{
+	__mod_desc = mod;
 	return ast_register_application(app, chanspy_exec, synopsis, desc);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return (char *) synopsis;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: trunk/apps/app_controlplayback.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_controlplayback.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_controlplayback.c (original)
+++ trunk/apps/app_controlplayback.c Fri Apr 14 09:08:19 2006
@@ -154,36 +154,26 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
-
 	res = ast_unregister_application(app);
-
-	STANDARD_HANGUP_LOCALUSERS;
-
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, controlplayback_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Control Playback Application";
 }
 
-int usecount(void)
-{
-	int res;
-
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: trunk/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_db.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_db.c (original)
+++ trunk/apps/app_db.c Fri Apr 14 09:08:19 2006
@@ -143,41 +143,35 @@
 	return 0;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int retval;
 
 	retval = ast_unregister_application(dt_app);
 	retval |= ast_unregister_application(d_app);
 
-	STANDARD_HANGUP_LOCALUSERS;
-
 	return retval;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	int retval;
 
+	__mod_desc = mod;
 	retval = ast_register_application(d_app, del_exec, d_synopsis, d_descrip);
 	retval |= ast_register_application(dt_app, deltree_exec, dt_synopsis, dt_descrip);
 	
 	return retval;
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Database Access Functions";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Fri Apr 14 09:08:19 2006
@@ -35,7 +35,6 @@
 #include <sys/signal.h>
 #include <netinet/in.h>
 
-#define STATIC_MODULE
 #include "asterisk.h"
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -1729,7 +1728,7 @@
 
 }
 
-STATIC_MODULE int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -1741,30 +1740,24 @@
 	return res;
 }
 
-STATIC_MODULE int load_module(void)
+static int load_module(void *mod)
 {
 	int res;
 
+	__mod_desc = mod;
 	res = ast_register_application(app, dial_exec, synopsis, descrip);
 	res |= ast_register_application(rapp, retrydial_exec, rsynopsis, rdescrip);
 	
 	return res;
 }
 
-STATIC_MODULE const char *description(void)
+static const char *description(void)
 {
 	return "Dialing Application";
 
 }
 
-STATIC_MODULE int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-STATIC_MODULE const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }

Modified: trunk/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dictate.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_dictate.c (original)
+++ trunk/apps/app_dictate.c Fri Apr 14 09:08:19 2006
@@ -46,7 +46,6 @@
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 
-static char *tdesc = "Virtual Dictation Machine";
 static char *app = "Dictate";
 static char *synopsis = "Virtual Dictation Machine";
 static char *desc = "  Dictate([<base_dir>[|<filename>]])\n"
@@ -336,36 +335,27 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
-
 	res = ast_unregister_application(app);
-	
-	STANDARD_HANGUP_LOCALUSERS;
-	
 	return res;
 }
 
-int load_module(void)
-{
+static int load_module(void *mod)
+{
+	__mod_desc = mod;
 	return ast_register_application(app, dictate_exec, synopsis, desc);
 }
 
-const char *description(void)
-{
-	return tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *description(void)
+{
+	return "Virtual Dictation Machine";
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
 
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: trunk/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_directed_pickup.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_directed_pickup.c (original)
+++ trunk/apps/app_directed_pickup.c Fri Apr 14 09:08:19 2006
@@ -42,7 +42,6 @@
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 
-static const char *tdesc = "Directed Call Pickup Application";
 static const char *app = "Pickup";
 static const char *synopsis = "Directed Call Pickup";
 static const char *descrip =
@@ -134,37 +133,29 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
 	res = ast_unregister_application(app);
 	
-	STANDARD_HANGUP_LOCALUSERS;
-
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
+	__mod_desc = mod;
 	return ast_register_application(app, pickup_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return (char *) tdesc;
+	return "Directed Call Pickup Application";
 }
 
-int usecount(void)
-{
-	int res;
-
-	STANDARD_USECOUNT(res);
-
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: trunk/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_directory.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_directory.c (original)
+++ trunk/apps/app_directory.c Fri Apr 14 09:08:19 2006
@@ -45,7 +45,6 @@
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
 
-static char *tdesc = "Extension Directory";
 static char *app = "Directory";
 
 static char *synopsis = "Provide directory of voicemail extensions";
@@ -517,35 +516,27 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
-
 	res = ast_unregister_application(app);
-
-	STANDARD_HANGUP_LOCALUSERS;
-
 	return res;
 }
 
-int load_module(void)
-{
+static int load_module(void *mod)
+{
+	__mod_desc = mod;
 	return ast_register_application(app, directory_exec, synopsis, descrip);
 }
 
-const char *description(void)
-{
-	return tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *description(void)
+{
+	return "Extension Directory";
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_disa.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_disa.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_disa.c (original)
+++ trunk/apps/app_disa.c Fri Apr 14 09:08:19 2006
@@ -48,8 +48,6 @@
 #include "asterisk/ulaw.h"
 #include "asterisk/callerid.h"
 #include "asterisk/stringfields.h"
-
-static char *tdesc = "DISA (Direct Inward System Access) Application";
 
 static char *app = "DISA";
 
@@ -376,7 +374,7 @@
 	return -1;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -387,24 +385,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, disa_exec, synopsis, descrip);
 }
 
-const char *description(void)
-{
-	return tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *description(void)
+{
+	return "DISA (Direct Inward System Access) Application";
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_dumpchan.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dumpchan.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_dumpchan.c (original)
+++ trunk/apps/app_dumpchan.c Fri Apr 14 09:08:19 2006
@@ -46,7 +46,6 @@
 #include "asterisk/lock.h"
 #include "asterisk/utils.h"
 
-static char *tdesc = "Dump Info About The Calling Channel";
 static char *app = "DumpChan";
 static char *synopsis = "Dump Info About The Calling Channel";
 static char *desc = 
@@ -157,7 +156,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -168,25 +167,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, dumpchan_exec, synopsis, desc);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return tdesc;
+	return "Dump Info About The Calling Channel";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
 
+STD_MOD1;

Modified: trunk/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_echo.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_echo.c (original)
+++ trunk/apps/app_echo.c Fri Apr 14 09:08:19 2006
@@ -95,7 +95,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -106,24 +106,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, echo_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_exec.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_exec.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_exec.c (original)
+++ trunk/apps/app_exec.c Fri Apr 14 09:08:19 2006
@@ -160,7 +160,7 @@
 	return 0;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -172,26 +172,21 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	int res = ast_register_application(app_exec, exec_exec, exec_synopsis, exec_descrip);
 	res |= ast_register_application(app_tryexec, tryexec_exec, tryexec_synopsis, tryexec_descrip);
 	return res;
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_externalivr.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_externalivr.c (original)
+++ trunk/apps/app_externalivr.c Fri Apr 14 09:08:19 2006
@@ -51,7 +51,6 @@
 #include "asterisk/app.h"
 #include "asterisk/utils.h"
 
-static const char *tdesc = "External IVR Interface Application";
 
 static const char *app = "ExternalIVR";
 
@@ -551,7 +550,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -562,26 +561,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, app_exec, synopsis, descrip);
 }
 
-const char *description(void)
-{
-	return (char *) tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-
-	STANDARD_USECOUNT(res);
-
-	return res;
-}
-
-const char *key()
+static const char *description(void)
+{
+	return "External IVR Interface Application";
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_festival.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_festival.c (original)
+++ trunk/apps/app_festival.c Fri Apr 14 09:08:19 2006
@@ -57,8 +57,6 @@
 #include "asterisk/lock.h"
 
 #define FESTIVAL_CONFIG "festival.conf"
-
-static char *tdesc = "Simple Festival Interface";
 
 static char *app = "Festival";
 
@@ -501,7 +499,7 @@
 
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -512,25 +510,20 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
-	
 	return ast_register_application(app, festival_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+	return "Simple Festival Interface";
+
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_flash.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_flash.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_flash.c (original)
+++ trunk/apps/app_flash.c Fri Apr 14 09:08:19 2006
@@ -49,8 +49,6 @@
 #include "asterisk/translate.h"
 #include "asterisk/image.h"
 #include "asterisk/options.h"
-
-static char *tdesc = "Flash zap trunk application";
 
 static char *app = "Flash";
 
@@ -107,7 +105,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -118,24 +116,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, flash_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return tdesc;
+	return "Flash zap trunk application";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_forkcdr.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_forkcdr.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_forkcdr.c (original)
+++ trunk/apps/app_forkcdr.c Fri Apr 14 09:08:19 2006
@@ -42,7 +42,6 @@
 #include "asterisk/cdr.h"
 #include "asterisk/module.h"
 
-static char *tdesc = "Fork The CDR into 2 separate entities.";
 static char *app = "ForkCDR";
 static char *synopsis = 
 "Forks the Call Data Record";
@@ -98,7 +97,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -109,24 +108,19 @@
 	return res;	
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, forkcdr_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return tdesc;
+	return "Fork The CDR into 2 separate entities.";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_getcpeid.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_getcpeid.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_getcpeid.c (original)
+++ trunk/apps/app_getcpeid.c Fri Apr 14 09:08:19 2006
@@ -42,8 +42,6 @@
 #include "asterisk/module.h"
 #include "asterisk/adsi.h"
 #include "asterisk/options.h"
-
-static char *tdesc = "Get ADSI CPE ID";
 
 static char *app = "GetCPEID";
 
@@ -133,7 +131,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -144,24 +142,19 @@
 	return res;	
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, cpeid_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return tdesc;
+	return "Get ADSI CPE ID";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_hasnewvoicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_hasnewvoicemail.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_hasnewvoicemail.c (original)
+++ trunk/apps/app_hasnewvoicemail.c Fri Apr 14 09:08:19 2006
@@ -53,7 +53,6 @@
 #include "asterisk/app.h"
 #include "asterisk/options.h"
 
-static char *tdesc = "Indicator for whether a voice mailbox has messages in a given folder.";
 static char *app_hasvoicemail = "HasVoicemail";
 static char *hasvoicemail_synopsis = "Conditionally branches to priority + 101 with the right options set";
 static char *hasvoicemail_descrip =
@@ -219,7 +218,7 @@
 	.read = acf_vmcount_exec,
 };
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 	
@@ -232,7 +231,7 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	int res;
 
@@ -243,19 +242,14 @@
 	return res;
 }
 
-const char *description(void)
-{
-	return tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *description(void)
+{
+	return "Indicator for whether a voice mailbox has messages in a given folder.";
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_ices.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_ices.c (original)
+++ trunk/apps/app_ices.c Fri Apr 14 09:08:19 2006
@@ -49,8 +49,6 @@
 
 #define ICES "/usr/bin/ices"
 #define LOCAL_ICES "/usr/local/bin/ices"
-
-static char *tdesc = "Encode and Stream via icecast and ices";
 
 static char *app = "ICES";
 
@@ -191,7 +189,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -202,24 +200,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, ices_exec, synopsis, descrip);
 }
 
-const char *description(void)
-{
-	return tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *description(void)
+{
+	return "Encode and Stream via icecast and ices";
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_image.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_image.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_image.c (original)
+++ trunk/apps/app_image.c Fri Apr 14 09:08:19 2006
@@ -112,7 +112,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -123,24 +123,19 @@
 	return res; 
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, sendimage_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_ivrdemo.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_ivrdemo.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_ivrdemo.c (original)
+++ trunk/apps/app_ivrdemo.c Fri Apr 14 09:08:19 2006
@@ -110,7 +110,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 	
@@ -121,24 +121,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, skel_exec, tdesc, synopsis);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_lookupblacklist.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_lookupblacklist.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_lookupblacklist.c (original)
+++ trunk/apps/app_lookupblacklist.c Fri Apr 14 09:08:19 2006
@@ -107,7 +107,7 @@
 	return 0;
 }
 
-int unload_module (void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -118,24 +118,19 @@
 	return res;	
 }
 
-int load_module (void)
+static int load_module(void *mod)
 {
 	return ast_register_application (app, lookupblacklist_exec, synopsis,descrip);
 }
 
-const char *description (void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount (void)
-{
-	int res;
-	STANDARD_USECOUNT (res);
-	return res;
-}
-
-const char *key ()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_lookupcidname.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_lookupcidname.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_lookupcidname.c (original)
+++ trunk/apps/app_lookupcidname.c Fri Apr 14 09:08:19 2006
@@ -80,8 +80,7 @@
   return 0;
 }
 
-int
-unload_module (void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -92,27 +91,19 @@
 	return res;
 }
 
-int
-load_module (void)
+static int load_module(void *mod)
 {
-  return ast_register_application (app, lookupcidname_exec, synopsis,
-				   descrip);
+	return ast_register_application (app, lookupcidname_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-  return tdesc;
+	return tdesc;
 }
 
-int
-usecount (void)
+static const char *key(void)
 {
-  int res;
-  STANDARD_USECOUNT (res);
-  return res;
+	return ASTERISK_GPL_KEY;
 }
 
-const char *key()
-{
-  return ASTERISK_GPL_KEY;
-}
+STD_MOD1;

Modified: trunk/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_macro.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_macro.c (original)
+++ trunk/apps/app_macro.c Fri Apr 14 09:08:19 2006
@@ -343,7 +343,7 @@
 	return MACRO_EXIT_RESULT;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -356,7 +356,7 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	int res;
 
@@ -367,19 +367,14 @@
 	return res;
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?rev=20003&r1=20002&r2=20003&view=diff
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Fri Apr 14 09:08:19 2006
@@ -60,7 +60,6 @@
 #include "asterisk/translate.h"
 #include "asterisk/ulaw.h"
 
-static const char *tdesc = "MeetMe conference bridge";
 
 static const char *app = "MeetMe";
 static const char *app2 = "MeetMeCount";
@@ -2425,7 +2424,7 @@
 	ast_config_destroy(cfg);
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 	
@@ -2440,7 +2439,7 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	int res;
 
@@ -2455,29 +2454,21 @@
 	return res;
 }
 
-int reload(void)
+static int reload(void *mod)
 {
 	load_config();
 
 	return 0;
 }
 
-const char *description(void)
-{
-	return (char *) tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-

[... 8107 lines stripped ...]


More information about the asterisk-commits mailing list