[asterisk-commits] branch group/autoconf_and_menuselect r20258 - in /team/group/autoconf_and_men...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 14 21:14:37 MST 2006


Author: russell
Date: Fri Apr 14 23:13:49 2006
New Revision: 20258

URL: http://svn.digium.com/view/asterisk?rev=20258&view=rev
Log:
Merged revisions 20003,20035-20036,20038,20075-20076,20104,20132,20138,20165-20170,20196-20197,20223-20225 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r20003 | rizzo | 2006-04-14 10:08:19 -0400 (Fri, 14 Apr 2006) | 23 lines

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!


................
r20035 | kpfleming | 2006-04-14 13:01:07 -0400 (Fri, 14 Apr 2006) | 10 lines

Merged revisions 20034 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r20034 | kpfleming | 2006-04-14 12:00:32 -0500 (Fri, 14 Apr 2006) | 2 lines

update text to match actual prompts being distributed (thanks to Kinsey in the support department for reviewing all the prompts!)

........

................
r20036 | rizzo | 2006-04-14 13:19:57 -0400 (Fri, 14 Apr 2006) | 3 lines

fix a mostly harmless error introduced by svn merge.


................
r20038 | kpfleming | 2006-04-14 13:25:31 -0400 (Fri, 14 Apr 2006) | 10 lines

Merged revisions 20037 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r20037 | kpfleming | 2006-04-14 12:21:09 -0500 (Fri, 14 Apr 2006) | 2 lines

uncomment files that actually do exist (oops)

........

................
r20075 | tilghman | 2006-04-14 14:44:24 -0400 (Fri, 14 Apr 2006) | 2 lines

Compatibility fixes for loader changes

................
r20076 | rizzo | 2006-04-14 14:45:08 -0400 (Fri, 14 Apr 2006) | 3 lines

fix another svn merge bug


................
r20104 | rizzo | 2006-04-14 15:35:37 -0400 (Fri, 14 Apr 2006) | 4 lines

partial fix of the module API to use the new method.
Still not complete as we need to take care of the usecount stuff.


................
r20132 | rizzo | 2006-04-14 16:47:06 -0400 (Fri, 14 Apr 2006) | 3 lines

code cleanup (for loop normalization, remove useless casts and parentheses)


................
r20138 | rizzo | 2006-04-14 17:00:59 -0400 (Fri, 14 Apr 2006) | 3 lines

constify a couple of function arguments


................
r20165 | rizzo | 2006-04-14 18:02:19 -0400 (Fri, 14 Apr 2006) | 3 lines

constification and code simplifications


................
r20166 | rizzo | 2006-04-14 18:17:27 -0400 (Fri, 14 Apr 2006) | 3 lines

normalize cli completion code


................
r20167 | rizzo | 2006-04-14 18:22:13 -0400 (Fri, 14 Apr 2006) | 3 lines

use ast_strdup instead of strdup


................
r20168 | rizzo | 2006-04-14 18:32:13 -0400 (Fri, 14 Apr 2006) | 3 lines

code simplifications


................
r20169 | rizzo | 2006-04-14 18:48:05 -0400 (Fri, 14 Apr 2006) | 3 lines

misc. code cleanup


................
r20170 | rizzo | 2006-04-14 18:55:58 -0400 (Fri, 14 Apr 2006) | 3 lines

remove some unnecessary braces


................
r20196 | rizzo | 2006-04-14 19:20:29 -0400 (Fri, 14 Apr 2006) | 8 lines

- remove some unnecessary casts and braces;      
- add braces around a nested 'if'
- use S_OR and '?' to remove some duplicated function calls;
- replace nested 'if' with &&
- move out a common term in a sequence of 'if'
- add a comment on a potentially dangerous string manipulation


................
r20197 | rizzo | 2006-04-14 19:30:18 -0400 (Fri, 14 Apr 2006) | 7 lines

- use '?' instead of if statements for assignment;
- fix indentation in a few places
- use a variable to store the 'other' channel, thus removing
  the need for some duplicated code;
- use '=' instead of memcpy to copy struct sockaddr_in


................
r20223 | rizzo | 2006-04-14 20:05:08 -0400 (Fri, 14 Apr 2006) | 10 lines

- normalize for() loops to navigate through variables,
  removing replicated var = var->next;
- remove a potential infinite loop and document the problem
- remove useless checks and document why
- mark XXX a possible bug (to be investigated)
- use ast_strlen_zero() instead of expanding it inline
- fix indentation in one place   
- replace a nested 'if' with '&&'


................
r20224 | rizzo | 2006-04-14 20:36:05 -0400 (Fri, 14 Apr 2006) | 7 lines

- use '=' to copy struct sockaddr_in
- localize a variable
- replace three replicas of the same code with a much simpler construct
  removing replicated var = var->next;
- use '?' instead of 'if' for an assignment


................
r20225 | rizzo | 2006-04-14 20:53:04 -0400 (Fri, 14 Apr 2006) | 6 lines

applied two of the 3 chunks in #6907, and a similar one
(replace nested 'if' with '&&')
I cannot make sense of the first chunk of the proposed patch,
i think the original is correct.


................

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

Propchange: team/group/autoconf_and_menuselect/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/autoconf_and_menuselect/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/group/autoconf_and_menuselect/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Apr 14 23:13:49 2006
@@ -1,1 +1,1 @@
-/trunk:1-19976
+/trunk:1-20257

Modified: team/group/autoconf_and_menuselect/app.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/app.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/app.c (original)
+++ team/group/autoconf_and_menuselect/app.c Fri Apr 14 23:13:49 2006
@@ -739,19 +739,13 @@
 	for (x=0;x<fmtcnt;x++) {
 		if (!others[x])
 			break;
-		if (res > 0) {
-			if (totalsilence)
-				ast_stream_rewind(others[x], totalsilence-200);
-			else
-				ast_stream_rewind(others[x], 200);
-		}
+		if (res > 0)
+			ast_stream_rewind(others[x], totalsilence ? totalsilence-200 : 200);
 		ast_truncstream(others[x]);
 		ast_closestream(others[x]);
 	}
-	if (rfmt) {
-		if (ast_set_read_format(chan, rfmt)) {
-			ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
-		}
+	if (rfmt && ast_set_read_format(chan, rfmt)) {
+		ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
 	}
 	if (outmsg > 1) {
 		/* Let them know recording is stopped */
@@ -982,17 +976,13 @@
 			ast_filedelete(prependfile, sfmt[x]);
 		}
 	}
-	if (rfmt) {
-		if (ast_set_read_format(chan, rfmt)) {
-			ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
-		}
-	}
-	if (outmsg) {
-		if (outmsg > 1) {
-			/* Let them know it worked */
-			ast_streamfile(chan, "auth-thankyou", chan->language);
-			ast_waitstream(chan, "");
-		}
+	if (rfmt && ast_set_read_format(chan, rfmt)) {
+		ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
+	}
+	if (outmsg > 1) {
+		/* Let them know it worked */
+		ast_streamfile(chan, "auth-thankyou", chan->language);
+		ast_waitstream(chan, "");
 	}	
 	return res;
 }

Modified: team/group/autoconf_and_menuselect/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_adsiprog.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_adsiprog.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_adsiprog.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_alarmreceiver.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_alarmreceiver.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_alarmreceiver.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_amd.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_amd.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_amd.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_authenticate.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_authenticate.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_authenticate.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_cdr.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_cdr.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_cdr.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_cdr.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_chanisavail.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_chanisavail.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_chanisavail.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_chanisavail.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_channelredirect.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_channelredirect.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_channelredirect.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_chanspy.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_chanspy.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_chanspy.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_controlplayback.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_controlplayback.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_controlplayback.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_controlplayback.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_db.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_db.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_db.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_dial.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_dial.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_dial.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_dictate.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_dictate.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_dictate.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_directed_pickup.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_directed_pickup.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_directed_pickup.c Fri Apr 14 23:13:49 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: team/group/autoconf_and_menuselect/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_directory.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_directory.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_directory.c Fri Apr 14 23:13:49 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";
@@ -177,16 +176,14 @@
 		/* If Option 'e' was specified, also read the extension number with the name */
 		if (readext) {
 			res = ast_streamfile(chan, "vm-extension", chan->language);
-			if (!res) {
+			if (!res)
 				res = ast_waitstream(chan, AST_DIGIT_ANY);
-			}
 			res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
 		}
 	} else if (ast_fileexists(fn2, NULL, chan->language) > 0) {
 		res = ast_streamfile(chan, fn2, chan->language);
-		if (!res) {
+		if (!res)
 			res = ast_waitstream(chan, AST_DIGIT_ANY);
-		}
 		ast_stopstream(chan);
 		/* If Option 'e' was specified, also read the extension number with the name */
 		if (readext) {
@@ -201,23 +198,19 @@
 					AST_DIGIT_ANY, chan->language);
 		if (!ast_strlen_zero(name) && readext) {
 			res = ast_streamfile(chan, "vm-extension", chan->language);
-			if (!res) {
+			if (!res)
 				res = ast_waitstream(chan, AST_DIGIT_ANY);
-			}
 			res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
 		}
 	}
 
 	while (loop) {
-		if (!res) {
+		if (!res)
 			res = ast_streamfile(chan, "dir-instr", chan->language);
-		}
-		if (!res) {
+		if (!res)
 			res = ast_waitstream(chan, AST_DIGIT_ANY);
-		}
-		if (!res) {
+		if (!res)
 			res = ast_waitfordigit(chan, 3000);
-		}
 		ast_stopstream(chan);
 	
 		if (res > -1) {
@@ -295,8 +288,8 @@
 		ast_category_append(cfg, cat);
 	}
 
-	mailbox = ast_category_browse(rtdata, NULL);
-	while (mailbox) {
+	mailbox = NULL;
+	while ( (mailbox = ast_category_browse(rtdata, mailbox)) ) {
 		fullname = ast_variable_retrieve(rtdata, mailbox, "fullname");
 		hidefromdir = ast_variable_retrieve(rtdata, mailbox, "hidefromdir");
 		snprintf(tmp, sizeof(tmp), "no-password,%s,hidefromdir=%s",
@@ -307,7 +300,6 @@
 			ast_variable_append(cat, var);
 		else
 			ast_log(LOG_WARNING, "Out of memory adding mailbox '%s'\n", mailbox);
-		mailbox = ast_category_browse(rtdata, mailbox);
 	}
 	ast_config_destroy(rtdata);
 
@@ -421,10 +413,7 @@
 		}
 
 		if (lastuserchoice != '1') {
-			if (found) 
-				res = ast_streamfile(chan, "dir-nomore", chan->language);
-			else
-				res = ast_streamfile(chan, "dir-nomatch", chan->language);
+			res = ast_streamfile(chan, found ? "dir-nomore" : "dir-nomatch", chan->language);
 			if (!res)
 				res = 1;
 			return res;
@@ -482,12 +471,8 @@
 	dirintro = ast_variable_retrieve(cfg, args.vmcontext, "directoryintro");
 	if (ast_strlen_zero(dirintro))
 		dirintro = ast_variable_retrieve(cfg, "general", "directoryintro");
-	if (ast_strlen_zero(dirintro)) {
-		if (last)
-			dirintro = "dir-intro";	
-		else
-			dirintro = "dir-intro-fn";
-	}
+	if (ast_strlen_zero(dirintro))
+		dirintro = last ? "dir-intro" : "dir-intro-fn";
 
 	if (chan->_state != AST_STATE_UP) 
 		res = ast_answer(chan);
@@ -505,9 +490,8 @@
 			if (res > 0) {
 				res = ast_waitstream(chan, AST_DIGIT_ANY);
 				ast_stopstream(chan);
-				if (res >= 0) {
+				if (res >= 0)
 					continue;
-				}
 			}
 		}
 		break;
@@ -517,35 +501,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: team/group/autoconf_and_menuselect/apps/app_disa.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/apps/app_disa.c?rev=20258&r1=20257&r2=20258&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/apps/app_disa.c (original)
+++ team/group/autoconf_and_menuselect/apps/app_disa.c Fri Apr 14 23:13:49 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)
+{

[... 10566 lines stripped ...]


More information about the asterisk-commits mailing list