--- format_mp3/format_mp3.c (svn) +++ format_mp3/format_mp3.c (working copy) @@ -14,6 +14,7 @@ * This program is free software, distributed under the terms of * the GNU General Public License */ +#define AST_MODULE "format_mp3" #include @@ -65,7 +66,6 @@ }; static char *name = "mp3"; -static char *desc = "MP3 format [Any rate but 8000hz mono optimal]"; #define BLOCKSIZE 160 #define OUTSCALE 4096 @@ -319,30 +319,17 @@ .getcomment = mp3_getcomment, .buf_size = MP3_BUFLEN + AST_FRIENDLY_OFFSET, .desc_size = sizeof(struct mp3_private), - .module = &mod_data, }; - -static int load_module(void *mod) +static int load_module(void) { InitMP3Constants(); return ast_format_register(&mp3_f); } -static int unload_module(void *mod) +static int unload_module(void) { return ast_format_unregister(name); } -static const char *description(void) -{ - return desc; -} - - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MP3 format [Any rate but 8000hz mono optimal]"); --- cdr_addon_mysql.c (svn) +++ cdr_addon_mysql.c (working copy) @@ -18,6 +18,7 @@ * the GNU General Public License. * */ +#define AST_MODULE "cdr_addon_mysql" #include @@ -114,7 +115,7 @@ { struct tm tm; struct timeval tv; - struct localuser *u; + struct ast_module_user *u; char *userfielddata = NULL; char sqlcmd[2048], timestr[128]; char *clid=NULL, *dcontext=NULL, *channel=NULL, *dstchannel=NULL, *lastapp=NULL, *lastdata=NULL; @@ -237,11 +238,6 @@ return 0; } -static const char *description(void) -{ - return desc; -} - static int my_unload_module(void) { ast_cli_unregister(&cdr_mysql_status_cli); @@ -456,31 +452,14 @@ return res; } -static int load_module(void *mod) +static int load_module(void) { return my_load_module(); } -static int unload_module(void *mod) +static int unload_module(void) { return my_unload_module(); } -static int reload(void *mod) -{ - int ret; - - ast_mutex_lock(&mysql_lock); - my_unload_module(); - ret = my_load_module(); - ast_mutex_unlock(&mysql_lock); - - return ret; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_0, reload, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MySQL CDR Backend"); --- res_config_mysql.c (svn) +++ res_config_mysql.c (working copy) @@ -37,6 +37,7 @@ * v1.2 - (11-DD-04) - Added reload. Updated load and unload. * Code beautification (doc/CODING-GUIDELINES) */ +#define AST_MODULE "res_config_mysql" #include @@ -56,8 +57,6 @@ #include #include -static char *res_config_mysql_desc = "MySQL RealTime Configuration Driver"; - AST_MUTEX_DEFINE_STATIC(mysql_lock); #define RES_CONFIG_MYSQL_CONF "res_mysql.conf" MYSQL mysql; @@ -74,7 +73,7 @@ static int mysql_reconnect(const char *database); static int realtime_mysql_status(int fd, int argc, char **argv); -LOCAL_USER_DECL; +; static char cli_realtime_mysql_status_usage[] = "Usage: realtime mysql status\n" @@ -467,7 +466,7 @@ .update_func = update_mysql }; -static int load_module(void *mod) +static int load_module(void) { parse_config(); @@ -489,7 +488,7 @@ return 0; } -static int unload_module(void *mod) +static int unload_module(void) { /* Aquire control before doing anything to the module itself. */ ast_mutex_lock(&mysql_lock); @@ -501,7 +500,7 @@ ast_verbose("MySQL RealTime unloaded.\n"); } - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); /* Unlock so something else can destroy the lock. */ ast_mutex_unlock(&mysql_lock); @@ -509,7 +508,7 @@ return 0; } -static int reload(void *mod) +static int reload(void) { /* Aquire control before doing anything to the module itself. */ ast_mutex_lock(&mysql_lock); @@ -595,16 +594,6 @@ return 1; } -static const char *description (void) -{ - return res_config_mysql_desc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - static int mysql_reconnect(const char *database) { char my_database[50]; @@ -701,4 +690,4 @@ } } -STD_MOD(MOD_0, reload, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MySQL RealTime Configuration Driver"); --- app_addon_sql_mysql.c (svn) +++ app_addon_sql_mysql.c (working copy) @@ -11,6 +11,7 @@ * This program is free software, distributed under the terms of * the GNU General Public License */ +#define AST_MODULE "app_addon_sql_mysql" #include @@ -35,8 +36,6 @@ #define EXTRA_LOG 0 -static char *tdesc = "Simple Mysql Interface"; - static char *app = "MYSQL"; static char *synopsis = "Do several mySQLy things"; @@ -75,7 +74,7 @@ exten => s,9,MYSQL(Disconnect ${connid}) */ -LOCAL_USER_DECL; +; AST_MUTEX_DEFINE_STATIC(_mysql_mutex); @@ -374,7 +373,7 @@ static int MYSQL_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; int result; char sresult[10]; @@ -387,7 +386,7 @@ return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); result=0; ast_mutex_lock(&_mysql_mutex); @@ -409,33 +408,23 @@ ast_mutex_unlock(&_mysql_mutex); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); snprintf(sresult, sizeof(sresult), "%d", result); pbx_builtin_setvar_helper(chan, "MYSQL_STATUS", sresult); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return ast_unregister_application(app); } -static int load_module(void *mod) +static int load_module(void) { struct MYSQLidshead *headp = &_mysql_ids_head; AST_LIST_HEAD_INIT(headp); return ast_register_application(app, MYSQL_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Simple Mysql Interface"); --- res_sqlite3/res_sqlite.c (svn) +++ res_sqlite3/res_sqlite.c (working copy) @@ -163,13 +163,13 @@ -STANDARD_LOCAL_USER; -LOCAL_USER_DECL; +; + static int app_callback(void *pArg, int argc, char **argv, char **columnNames){ int x=0; struct ast_channel *chan = pArg; @@ -184,7 +184,7 @@ static int sqlite_execapp(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; char *errmsg; sqlite3 *db; char *filename=NULL; @@ -222,7 +222,7 @@ if (!db) return -1; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Do our thing here */ @@ -241,7 +241,7 @@ } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); sqlite3_close(db); return res; } --- app_saycountpl.c (svn) +++ app_saycountpl.c (working copy) @@ -6,6 +6,7 @@ * Copyright (C) 2004, Andy Powell & TAAN Softworks Corp. * */ +#define AST_MODULE "ast_saycountpl" #include @@ -20,9 +21,6 @@ #include #include - -static char *tdesc = "Say polish counting words"; - static char *app = "SayCountPL"; static char *synopsis = "Say the counting word the fits to a number"; @@ -32,7 +30,7 @@ "decide based on grammar rules which one to use with the number you pass to it.\n\n" "Example: saycountpl(zloty,zlote,zlotych,122) will give: zlote\n"; -LOCAL_USER_DECL; +; static int saywords(struct ast_channel *chan, char *word1, char *word2, char *word5, int num) { @@ -73,14 +71,14 @@ int inum; - struct localuser *u; + struct ast_module_user *u; if (!data) { ast_log(LOG_WARNING, "You didn't pass any arguments - I need 4 arguments, word-1,word-2,word-5,number\n"); return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Do our shit here */ s = ast_strdupa((void *) data); @@ -94,13 +92,13 @@ if (!word1 || !word2 || !word5 || !num) { ast_log(LOG_WARNING, "Saycountpl requires the arguments word-1|word-2|word-3|number\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } if (sscanf(num, "%d", &inum) != 1) { ast_log(LOG_WARNING, "'%s' is not a valid number\n", num); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -110,32 +108,19 @@ - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return ast_unregister_application(app); } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, sayword_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key() -{ - return ASTERISK_GPL_KEY; -} - - -/* Get down on it... get down on it... */ - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Say polish counting words"); --- asterisk-ooh323c/src/chan_h323.c (svn) +++ asterisk-ooh323c/src/chan_h323.c (working copy) @@ -13,8 +13,8 @@ * maintain this copyright notice. * *****************************************************************************/ +#define AST_MODULE "chan_ooh323" - #include "chan_h323.h" @@ -35,7 +35,6 @@ #define H323_DISABLEGK (1<<7) /* Channel description */ -static const char desc[] = "Objective Systems H323 Channel"; static const char type[] = "OOH323"; static const char tdesc[] = "Objective Systems H323 Channel Driver"; static const char config[] = "ooh323.conf"; @@ -3172,20 +3171,9 @@ return 0; } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -static const char *description(void) -{ - return (char*)desc; -} - - void ast_ooh323c_exit() { ooGkClientDestroy(); } -STD_MOD(MOD_0, reload, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Objective Systems H323 Channel");