[svn-commits] branch group/new_loader_completion r23928 - in /team/group/new_loader_complet...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon May 1 05:44:32 MST 2006


Author: kpfleming
Date: Mon May  1 07:44:31 2006
New Revision: 23928

URL: http://svn.digium.com/view/asterisk?rev=23928&view=rev
Log:
update a bunch more modules that weren't building by default on this system
make sure that prep_moduledeps looks into .cc files as well as .c files
const-ify the CDR driver registration functions

Modified:
    team/group/new_loader_completion/build_tools/prep_moduledeps
    team/group/new_loader_completion/cdr.c
    team/group/new_loader_completion/cdr/cdr_csv.c
    team/group/new_loader_completion/cdr/cdr_custom.c
    team/group/new_loader_completion/cdr/cdr_odbc.c
    team/group/new_loader_completion/cdr/cdr_pgsql.c
    team/group/new_loader_completion/cdr/cdr_sqlite.c
    team/group/new_loader_completion/cdr/cdr_tds.c
    team/group/new_loader_completion/channels/chan_nbs.c
    team/group/new_loader_completion/channels/chan_oss.c
    team/group/new_loader_completion/formats/format_ogg_vorbis.c
    team/group/new_loader_completion/funcs/func_base64.c
    team/group/new_loader_completion/funcs/func_callerid.c
    team/group/new_loader_completion/funcs/func_cdr.c
    team/group/new_loader_completion/funcs/func_channel.c
    team/group/new_loader_completion/funcs/func_curl.c
    team/group/new_loader_completion/funcs/func_cut.c
    team/group/new_loader_completion/funcs/func_db.c
    team/group/new_loader_completion/funcs/func_enum.c
    team/group/new_loader_completion/funcs/func_env.c
    team/group/new_loader_completion/funcs/func_groupcount.c
    team/group/new_loader_completion/funcs/func_language.c
    team/group/new_loader_completion/funcs/func_logic.c
    team/group/new_loader_completion/funcs/func_math.c
    team/group/new_loader_completion/funcs/func_md5.c
    team/group/new_loader_completion/funcs/func_moh.c
    team/group/new_loader_completion/funcs/func_odbc.c
    team/group/new_loader_completion/funcs/func_rand.c
    team/group/new_loader_completion/funcs/func_sha1.c
    team/group/new_loader_completion/funcs/func_strings.c
    team/group/new_loader_completion/funcs/func_timeout.c
    team/group/new_loader_completion/funcs/func_uri.c
    team/group/new_loader_completion/include/asterisk/cdr.h

Modified: team/group/new_loader_completion/build_tools/prep_moduledeps
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/build_tools/prep_moduledeps?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/build_tools/prep_moduledeps (original)
+++ team/group/new_loader_completion/build_tools/prep_moduledeps Mon May  1 07:44:31 2006
@@ -9,10 +9,23 @@
 	echo -e "\t<category name=\"MENUSELECT_${catsuffix}\" displayname=\"${displayname}\">"
 	for file in ${dir}/${prefix}*.c
 	do
-		fname=${file##${dir}/}
-		echo -e "\t\t<member name=\"${fname%%.c}.so\">"
-		awk -f build_tools/get_moduledeps ${file}
-		echo -e "\t\t</member>"
+	    if [ ! -f ${file} ]; then
+		continue
+	    fi
+	    fname=${file##${dir}/}
+	    echo -e "\t\t<member name=\"${fname%%.c}.so\">"
+	    awk -f build_tools/get_moduledeps ${file}
+	    echo -e "\t\t</member>"
+	done
+	for file in ${dir}/${prefix}*.cc
+	do
+	    if [ ! -f ${file} ]; then
+		continue
+	    fi
+	    fname=${file##${dir}/}
+	    echo -e "\t\t<member name=\"${fname%%.cc}.so\">"
+	    awk -f build_tools/get_moduledeps ${file}
+	    echo -e "\t\t</member>"
 	done
 	echo -e "\t</category>"
 }

Modified: team/group/new_loader_completion/cdr.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cdr.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/cdr.c (original)
+++ team/group/new_loader_completion/cdr.c Mon May  1 07:44:31 2006
@@ -106,7 +106,7 @@
 /*! Register a CDR driver. Each registered CDR driver generates a CDR 
 	\return 0 on success, -1 on failure 
 */
-int ast_cdr_register(char *name, char *desc, ast_cdrbe be)
+int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be)
 {
 	struct ast_cdr_beitem *i;
 
@@ -144,7 +144,7 @@
 }
 
 /*! unregister a CDR driver */
-void ast_cdr_unregister(char *name)
+void ast_cdr_unregister(const char *name)
 {
 	struct ast_cdr_beitem *i = NULL;
 

Modified: team/group/new_loader_completion/cdr/cdr_csv.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cdr/cdr_csv.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/cdr/cdr_csv.c (original)
+++ team/group/new_loader_completion/cdr/cdr_csv.c Mon May  1 07:44:31 2006
@@ -323,7 +323,7 @@
 	
 	load_config();
 
-	res = ast_cdr_register(name, "Comma Separated Values CDR Backend", csv_log);
+	res = ast_cdr_register(name, ast_module_info.description, csv_log);
 	if (res) {
 		ast_log(LOG_ERROR, "Unable to register CSV CDR handling\n");
 		if (mf)

Modified: team/group/new_loader_completion/cdr/cdr_custom.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cdr/cdr_custom.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/cdr/cdr_custom.c (original)
+++ team/group/new_loader_completion/cdr/cdr_custom.c Mon May  1 07:44:31 2006
@@ -148,7 +148,7 @@
 	int res = 0;
 
 	if (!load_config(0)) {
-		res = ast_cdr_register(name, "Customizable Comma Separated Values CDR Backend", custom_log);
+		res = ast_cdr_register(name, ast_module_info.description, custom_log);
 		if (res)
 			ast_log(LOG_ERROR, "Unable to register custom CDR handling\n");
 		if (mf)

Modified: team/group/new_loader_completion/cdr/cdr_odbc.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cdr/cdr_odbc.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/cdr/cdr_odbc.c (original)
+++ team/group/new_loader_completion/cdr/cdr_odbc.c Mon May  1 07:44:31 2006
@@ -64,7 +64,6 @@
 
 #define DATE_FORMAT "%Y-%m-%d %T"
 
-static char *desc = "ODBC CDR Backend";
 static char *name = "ODBC";
 static char *config = "cdr_odbc.conf";
 static char *dsn = NULL, *username = NULL, *password = NULL, *table = NULL;
@@ -207,11 +206,6 @@
 	return 0;
 }
 
-static const char *description(void)
-{
-	return desc;
-}
-
 static int odbc_unload_module(void)
 {
 	ast_mutex_lock(&odbc_lock);
@@ -365,7 +359,7 @@
 			ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: Unable to connect to datasource: %s\n", dsn);
 		}
 	}
-	res = ast_cdr_register(name, desc, odbc_log);
+	res = ast_cdr_register(name, ast_module_info.description, odbc_log);
 	if (res) {
 		ast_log(LOG_ERROR, "cdr_odbc: Unable to register ODBC CDR handling\n");
 	}
@@ -452,25 +446,24 @@
 	return 0;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return odbc_load_module();
 }
 
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return odbc_unload_module();
 }
 
-static int reload(void *mod)
+static int reload(void)
 {
 	odbc_unload_module();
 	return odbc_load_module();
 }
 
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "ODBC CDR Backend",
+		.load = load_module,
+		.unload = unload_module,
+		.reload = reload,
+	       );

Modified: team/group/new_loader_completion/cdr/cdr_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cdr/cdr_pgsql.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/cdr/cdr_pgsql.c (original)
+++ team/group/new_loader_completion/cdr/cdr_pgsql.c Mon May  1 07:44:31 2006
@@ -60,7 +60,6 @@
 
 #define DATE_FORMAT "%Y-%m-%d %T"
 
-static char *desc = "PostgreSQL CDR Backend";
 static char *name = "pgsql";
 static char *config = "cdr_pgsql.conf";
 static char *pghostname = NULL, *pgdbname = NULL, *pgdbuser = NULL, *pgpassword = NULL, *pgdbsock = NULL, *pgdbport = NULL, *table = NULL;
@@ -180,11 +179,6 @@
 	return 0;
 }
 
-static const char *description(void)
-{
-	return desc;
-}
-
 static int my_unload_module(void)
 { 
 	if (conn)
@@ -309,7 +303,7 @@
 		connected = 0;
 	}
 
-	res = ast_cdr_register(name, desc, pgsql_log);
+	res = ast_cdr_register(name, ast_module_info.description, pgsql_log);
 	if (res) {
 		ast_log(LOG_ERROR, "Unable to register PGSQL CDR handling\n");
 	}
@@ -330,25 +324,24 @@
 	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)
+static int reload(void)
 {
 	my_unload_module();
 	return my_load_module();
 }
 
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "PostgreSQL CDR Backend",
+		.load = load_module,
+		.unload = unload_module,
+		.reload = reload,
+	       );

Modified: team/group/new_loader_completion/cdr/cdr_sqlite.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cdr/cdr_sqlite.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/cdr/cdr_sqlite.c (original)
+++ team/group/new_loader_completion/cdr/cdr_sqlite.c Mon May  1 07:44:31 2006
@@ -58,7 +58,6 @@
 /* When you change the DATE_FORMAT, be sure to change the CHAR(19) below to something else */
 #define DATE_FORMAT "%Y-%m-%d %T"
 
-static char *desc = "SQLite CDR Backend";
 static char *name = "sqlite";
 static sqlite* db = NULL;
 
@@ -167,13 +166,7 @@
 	return res;
 }
 
-
-static const char *description(void)
-{
-	return desc;
-}
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	if (db)
 		sqlite_close(db);
@@ -181,7 +174,7 @@
 	return 0;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	char *zErr;
 	char fn[PATH_MAX];
@@ -209,7 +202,7 @@
 		/* TODO: here we should probably create an index */
 	}
 	
-	res = ast_cdr_register(name, desc, sqlite_log);
+	res = ast_cdr_register(name, ast_module_info.description, sqlite_log);
 	if (res) {
 		ast_log(LOG_ERROR, "Unable to register SQLite CDR handling\n");
 		return -1;
@@ -222,14 +215,4 @@
 	return -1;
 }
 
-static int reload(void *mod)
-{
-	return 0;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "SQLite CDR Backend");

Modified: team/group/new_loader_completion/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/cdr/cdr_tds.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/cdr/cdr_tds.c (original)
+++ team/group/new_loader_completion/cdr/cdr_tds.c Mon May  1 07:44:31 2006
@@ -88,7 +88,6 @@
 
 #define DATE_FORMAT "%Y/%m/%d %T"
 
-static char *desc = "MSSQL CDR Backend";
 static char *name = "mssql";
 static char *config = "cdr_tds.conf";
 
@@ -297,11 +296,6 @@
 	}
 }
 
-static const char *description(void)
-{
-	return desc;
-}
-
 static int mssql_disconnect(void)
 {
 	if (tds) {
@@ -494,7 +488,7 @@
 	mssql_connect();
 
 	/* Register MSSQL CDR handler */
-	res = ast_cdr_register(name, desc, tds_log);
+	res = ast_cdr_register(name, ast_module_info.description, tds_log);
 	if (res)
 	{
 		ast_log(LOG_ERROR, "Unable to register MSSQL CDR handling\n");
@@ -503,25 +497,24 @@
 	return res;
 }
 
-static int reload(void *mod)
+static int reload(void)
 {
 	tds_unload_module();
 	return tds_load_module();
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return tds_load_module();
 }
 
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return tds_unload_module();
 }
 
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_0, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "MSSQL CDR Backend",
+		.load = load_module,
+		.unload = unload_module,
+		.reload = reload,
+	       );

Modified: team/group/new_loader_completion/channels/chan_nbs.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_nbs.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_nbs.c (original)
+++ team/group/new_loader_completion/channels/chan_nbs.c Mon May  1 07:44:31 2006
@@ -54,15 +54,10 @@
 #include "asterisk/options.h"
 #include "asterisk/utils.h"
 
-static const char desc[] = "Network Broadcast Sound Support";
 static const char tdesc[] = "Network Broadcast Sound Driver";
-
-static int usecnt =0;
 
 /* Only linear is allowed */
 static int prefformat = AST_FORMAT_SLINEAR;
-
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 static char context[AST_MAX_EXTENSION] = "default";
 static char type[] = "NBS";
@@ -75,6 +70,7 @@
 	char app[16];					/* Our app */
 	char stream[80];				/* Our stream */
 	struct ast_frame fr;			/* "null" frame */
+	struct ast_module_user *u;		/*! for holding a reference to this module */
 };
 
 static struct ast_channel *nbs_request(const char *type, int format, void *data, int *cause);
@@ -125,6 +121,7 @@
 {
 	if (p->nbs)
 		nbs_delstream(p->nbs);
+	ast_module_user_remove(p->u);
 	free(p);
 }
 
@@ -134,6 +131,7 @@
 	int flags = 0;
 	char stream[256] = "";
 	char *opts;
+
 	strncpy(stream, data, sizeof(stream) - 1);
 	if ((opts = strchr(stream, ':'))) {
 		*opts = '\0';
@@ -252,10 +250,7 @@
 		strncpy(tmp->exten, "s",  sizeof(tmp->exten) - 1);
 		ast_string_field_set(tmp, language, "");
 		i->owner = tmp;
-		ast_mutex_lock(&usecnt_lock);
-		usecnt++;
-		ast_mutex_unlock(&usecnt_lock);
-		ast_update_use_count();
+		i->u = ast_module_user_add(tmp);
 		if (state != AST_STATE_DOWN) {
 			if (ast_pbx_start(tmp)) {
 				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
@@ -296,12 +291,12 @@
 	return 0;
 }
 
-int unload_module(void)
+static int unload_module(void)
 {
 	return __unload_module();
 }
 
-int load_module(void)
+static int load_module(void)
 {
 	/* Make sure we can register our channel type */
 	if (ast_channel_register(&nbs_tech)) {
@@ -312,18 +307,4 @@
 	return 0;
 }
 
-int usecount(void)
-{
-	return usecnt;
-}
-
-const char *description(void)
-{
-	return (char *) desc;
-}
-
-const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Network Broadcast Sound Support");

Modified: team/group/new_loader_completion/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/channels/chan_oss.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/channels/chan_oss.c (original)
+++ team/group/new_loader_completion/channels/chan_oss.c Mon May  1 07:44:31 2006
@@ -1466,7 +1466,7 @@
 	return NULL;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	int i;
 	struct ast_config *cfg;
@@ -1501,7 +1501,7 @@
 }
 
 
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	struct chan_oss_pvt *o;
 
@@ -1525,16 +1525,4 @@
 	return 0;
 }
 
-static const char *description(void)
-{
-	return (char *)oss_tech.description;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
-
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "OSS Console Channel Driver");

Modified: team/group/new_loader_completion/formats/format_ogg_vorbis.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/formats/format_ogg_vorbis.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/formats/format_ogg_vorbis.c (original)
+++ team/group/new_loader_completion/formats/format_ogg_vorbis.c Mon May  1 07:44:31 2006
@@ -542,28 +542,17 @@
 	.close = ogg_vorbis_close,
 	.buf_size = BUF_SIZE + AST_FRIENDLY_OFFSET,
 	.desc_size = sizeof(struct vorbis_desc),
-	.module = &mod_data, /* XXX */
 };
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_format_register(&vorbis_f);
 }
 
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return ast_format_unregister(vorbis_f.name);
 }
 
-static const char *description(void)
-{
-	return "OGG/Vorbis audio";
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD1;
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "OGG/Vorbis audio");
+

Modified: team/group/new_loader_completion/funcs/func_base64.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_base64.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_base64.c (original)
+++ team/group/new_loader_completion/funcs/func_base64.c Mon May  1 07:44:31 2006
@@ -78,27 +78,16 @@
 	.read = base64_decode,
 };
 
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return ast_custom_function_unregister(&base64_encode_function) |
 		ast_custom_function_unregister(&base64_decode_function);
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_custom_function_register(&base64_encode_function) |
 		ast_custom_function_register(&base64_decode_function);
 }
 
-static const char *description(void)
-{
-	return "base64 encode/decode dialplan functions";
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "base64 encode/decode dialplan functions");

Modified: team/group/new_loader_completion/funcs/func_callerid.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_callerid.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_callerid.c (original)
+++ team/group/new_loader_completion/funcs/func_callerid.c Mon May  1 07:44:31 2006
@@ -142,26 +142,14 @@
 	.write = callerid_write,
 };
 
-static char *tdesc = "Caller ID related dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return ast_custom_function_unregister(&callerid_function);
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_custom_function_register(&callerid_function);
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Caller ID related dialplan function");

Modified: team/group/new_loader_completion/funcs/func_cdr.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_cdr.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_cdr.c (original)
+++ team/group/new_loader_completion/funcs/func_cdr.c Mon May  1 07:44:31 2006
@@ -122,26 +122,14 @@
 "  integral values.\n",
 };
 
-static char *tdesc = "CDR dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return ast_custom_function_unregister(&cdr_function);
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_custom_function_register(&cdr_function);
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "CDR dialplan function");

Modified: team/group/new_loader_completion/funcs/func_channel.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_channel.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_channel.c (original)
+++ team/group/new_loader_completion/funcs/func_channel.c Mon May  1 07:44:31 2006
@@ -136,26 +136,14 @@
 	.write = func_channel_write,
 };
 
-static char *tdesc = "Channel information dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return ast_custom_function_unregister(&channel_function);
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_custom_function_register(&channel_function);
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Channel information dialplan function");

Modified: team/group/new_loader_completion/funcs/func_curl.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_curl.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_curl.c (original)
+++ team/group/new_loader_completion/funcs/func_curl.c Mon May  1 07:44:31 2006
@@ -51,10 +51,6 @@
 #include "asterisk/module.h"
 #include "asterisk/app.h"
 #include "asterisk/utils.h"
-
-static char *tdesc = "Load external URL";
-
-LOCAL_USER_DECL;
 
 struct MemoryStruct {
 	char *memory;
@@ -113,7 +109,7 @@
 
 static int acf_curl_exec(struct ast_channel *chan, char *cmd, char *info, char *buf, size_t len)
 {
-	struct localuser *u;
+	struct ast_module_user *u;
 	struct MemoryStruct chunk = { NULL, 0 };
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(url);
@@ -127,7 +123,7 @@
 		return -1;
 	}
 
-	LOCAL_USER_ADD(u);
+	u = ast_module_user_add(chan);
 
 	AST_STANDARD_APP_ARGS(args, info);	
 	
@@ -144,7 +140,7 @@
 		ast_log(LOG_ERROR, "Cannot allocate curl structure\n");
 	}
 
-	LOCAL_USER_REMOVE(u);
+	ast_module_user_remove(u);
 
 	return 0;
 }
@@ -159,18 +155,18 @@
 	.read = acf_curl_exec,
 };
 
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	int res;
 
 	res = ast_custom_function_unregister(&acf_curl);
 
-	STANDARD_HANGUP_LOCALUSERS;
+	ast_module_user_hangup_all();
 	
 	return res;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	int res;
 
@@ -179,15 +175,5 @@
 	return res;
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Load external URL");
 
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
-

Modified: team/group/new_loader_completion/funcs/func_cut.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_cut.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_cut.c (original)
+++ team/group/new_loader_completion/funcs/func_cut.c Mon May  1 07:44:31 2006
@@ -43,9 +43,6 @@
 
 /* Maximum length of any variable */
 #define MAXRESULT	1024
-
-
-LOCAL_USER_DECL;
 
 struct sortable_keys {
 	char *key;
@@ -217,10 +214,10 @@
 
 static int acf_sort_exec(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
 {
-	struct localuser *u;
+	struct ast_module_user *u;
 	int ret = -1;
 
-	LOCAL_USER_ADD(u);
+	u = ast_module_user_add(chan);
 
 	switch (sort_internal(chan, data, buf, len)) {
 	case ERROR_NOARG:
@@ -235,7 +232,8 @@
 	default:
 		ast_log(LOG_ERROR, "Unknown internal error\n");
 	}
-	LOCAL_USER_REMOVE(u);
+
+	ast_module_user_remove(u);
 
 	return ret;
 }
@@ -243,9 +241,9 @@
 static int acf_cut_exec(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
 {
 	int ret = -1;
-	struct localuser *u;
-
-	LOCAL_USER_ADD(u);
+	struct ast_module_user *u;
+
+	u = ast_module_user_add(chan);
 
 	switch (cut_internal(chan, data, buf, len)) {
 	case ERROR_NOARG:
@@ -263,7 +261,8 @@
 	default:
 		ast_log(LOG_ERROR, "Unknown internal error\n");
 	}
-	LOCAL_USER_REMOVE(u);
+
+	ast_module_user_remove(u);
 
 	return ret;
 }
@@ -292,19 +291,19 @@
 	.read = acf_cut_exec,
 };
 
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	int res = 0;
 
 	res |= ast_custom_function_unregister(&acf_cut);
 	res |= ast_custom_function_unregister(&acf_sort);
 
-	STANDARD_HANGUP_LOCALUSERS;
+	ast_module_user_hangup_all();
 
 	return res;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	int res = 0;
 
@@ -314,14 +313,4 @@
 	return res;
 }
 
-static const char *description(void)
-{
-	return "Cut out information from a string";
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Cut out information from a string");

Modified: team/group/new_loader_completion/funcs/func_db.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_db.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_db.c (original)
+++ team/group/new_loader_completion/funcs/func_db.c Mon May  1 07:44:31 2006
@@ -159,9 +159,7 @@
 	.read = function_db_exists,
 };
 
-static char *tdesc = "Database (astdb) related dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	int res = 0;
 
@@ -171,7 +169,7 @@
 	return res;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	int res = 0;
 
@@ -181,14 +179,4 @@
 	return res;
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Database (astdb) related dialplan functions");

Modified: team/group/new_loader_completion/funcs/func_enum.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_enum.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_enum.c (original)
+++ team/group/new_loader_completion/funcs/func_enum.c Mon May  1 07:44:31 2006
@@ -50,8 +50,6 @@
 
  static char *synopsis = "Syntax: ENUMLOOKUP(number[|Method-type[|options[|record#[|zone-suffix]]]])\n";
 
-LOCAL_USER_DECL;
-
 static int function_enum(struct ast_channel *chan, char *cmd, char *data,
 			 char *buf, size_t len)
 {
@@ -65,7 +63,7 @@
 	int res = 0;
 	char tech[80];
 	char dest[256] = "", tmp[2] = "", num[AST_MAX_EXTENSION] = "";
-	struct localuser *u;
+	struct ast_module_user *u;
 	char *s, *p;
 
 	buf[0] = '\0';
@@ -82,7 +80,7 @@
 		return -1;
 	}
 
-	LOCAL_USER_ADD(u);
+	u = ast_module_user_add(chan);
 
 	ast_copy_string(tech, args.tech ? args.tech : "sip", sizeof(tech));
 
@@ -110,7 +108,7 @@
 	else
 		ast_copy_string(buf, dest, len);
 
-	LOCAL_USER_REMOVE(u);
+	ast_module_user_remove(u);
 
 	return 0;
 }
@@ -137,7 +135,7 @@
 	char tech[80];
 	char txt[256] = "";
 	char dest[80];
-	struct localuser *u;
+	struct ast_module_user *u;
 
 	buf[0] = '\0';
 
@@ -147,7 +145,7 @@
 		return -1;
 	}
 
-	LOCAL_USER_ADD(u);
+	u = ast_module_user_add(chan);
 
 	res = ast_get_txt(chan, data, dest, sizeof(dest), tech, sizeof(tech), txt,
 			  sizeof(txt));
@@ -155,7 +153,7 @@
 	if (!ast_strlen_zero(txt))
 		ast_copy_string(buf, txt, len);
 
-	LOCAL_USER_REMOVE(u);
+	ast_module_user_remove(u);
 
 	return 0;
 }
@@ -171,21 +169,19 @@
 	.read = function_txtcidname,
 };
 
-static char *tdesc = "ENUM related dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	int res = 0;
 
 	res |= ast_custom_function_unregister(&enum_function);
 	res |= ast_custom_function_unregister(&txtcidname_function);
 
-	STANDARD_HANGUP_LOCALUSERS;
+	ast_module_user_hangup_all();
 
 	return res;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	int res = 0;
 
@@ -195,15 +191,4 @@
 	return res;
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "ENUM related dialplan functions");

Modified: team/group/new_loader_completion/funcs/func_env.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_env.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_env.c (original)
+++ team/group/new_loader_completion/funcs/func_env.c Mon May  1 07:44:31 2006
@@ -135,10 +135,7 @@
 		"  M - Returns the epoch at which the file was last modified\n",
 };
 
-
-static char *tdesc = "Environment/filesystem dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	int res = 0;
 
@@ -148,7 +145,7 @@
 	return res;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	int res = 0;
 
@@ -158,15 +155,4 @@
 	return res;
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Environment/filesystem dialplan functions");

Modified: team/group/new_loader_completion/funcs/func_groupcount.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_groupcount.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_groupcount.c (original)
+++ team/group/new_loader_completion/funcs/func_groupcount.c Mon May  1 07:44:31 2006
@@ -195,9 +195,7 @@
 	.write = NULL,
 };
 
-static char *tdesc = "Channel group dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	int res = 0;
 
@@ -209,7 +207,7 @@
 	return res;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	int res = 0;
 
@@ -221,14 +219,4 @@
 	return res;
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Channel group dialplan functions");

Modified: team/group/new_loader_completion/funcs/func_language.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_language.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_language.c (original)
+++ team/group/new_loader_completion/funcs/func_language.c Mon May  1 07:44:31 2006
@@ -76,26 +76,14 @@
 	.write = language_write,
 };
 
-static char *tdesc = "Channel language dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return ast_custom_function_unregister(&language_function);
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_custom_function_register(&language_function);
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Channel language dialplan function");

Modified: team/group/new_loader_completion/funcs/func_logic.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_logic.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_logic.c (original)
+++ team/group/new_loader_completion/funcs/func_logic.c Mon May  1 07:44:31 2006
@@ -174,9 +174,7 @@
 	.read = iftime,
 };
 
-static char *tdesc = "Logical dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	int res = 0;
 
@@ -189,7 +187,7 @@
 	return res;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	int res = 0;
 
@@ -202,14 +200,4 @@
 	return res;
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Logical dialplan functions");

Modified: team/group/new_loader_completion/funcs/func_math.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_math.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_math.c (original)
+++ team/group/new_loader_completion/funcs/func_math.c Mon May  1 07:44:31 2006
@@ -247,27 +247,14 @@
 	.read = math
 };
 
-static char *tdesc = "Mathematical dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return ast_custom_function_unregister(&math_function);
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_custom_function_register(&math_function);
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
-
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Mathematical dialplan function");

Modified: team/group/new_loader_completion/funcs/func_md5.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_md5.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_md5.c (original)
+++ team/group/new_loader_completion/funcs/func_md5.c Mon May  1 07:44:31 2006
@@ -104,28 +104,16 @@
 	.read = checkmd5,
 };
 
-static char *tdesc = "MD5 digest dialplan functions";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return ast_custom_function_unregister(&md5_function) |
 		ast_custom_function_unregister(&checkmd5_function);
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_custom_function_register(&md5_function) |
 		ast_custom_function_register(&checkmd5_function);
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MD5 digest dialplan functions");

Modified: team/group/new_loader_completion/funcs/func_moh.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_moh.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_moh.c (original)
+++ team/group/new_loader_completion/funcs/func_moh.c Mon May  1 07:44:31 2006
@@ -72,26 +72,14 @@
 	.write = moh_write,
 };
 
-static char *tdesc = "Music-on-hold dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return ast_custom_function_unregister(&moh_function);
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_custom_function_register(&moh_function);
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Music-on-hold dialplan function");

Modified: team/group/new_loader_completion/funcs/func_odbc.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_odbc.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_odbc.c (original)
+++ team/group/new_loader_completion/funcs/func_odbc.c Mon May  1 07:44:31 2006
@@ -47,8 +47,6 @@
 #include "asterisk/module.h"
 #include "asterisk/config.h"
 #include "asterisk/res_odbc.h"
-
-static char *tdesc = "ODBC lookups";
 
 static char *config = "func_odbc.conf";
 
@@ -650,27 +648,21 @@
 	return res;
 }
 
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return odbc_unload_module();
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return odbc_load_module();
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
 /* XXX need to revise usecount - set if query_lock is set */
 
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
-
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "ODBC lookups",
+		.load = load_module,
+		.unload = unload_module,
+		.reload = reload,
+	       );
+

Modified: team/group/new_loader_completion/funcs/func_rand.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_rand.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_rand.c (original)
+++ team/group/new_loader_completion/funcs/func_rand.c Mon May  1 07:44:31 2006
@@ -91,30 +91,16 @@
 	.read = acf_rand_exec,
 };
 
-
-static char *tdesc = "Random number dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	ast_custom_function_unregister(&acf_rand);
 
 	return 0;
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_custom_function_register(&acf_rand);
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Random number dialplan function");

Modified: team/group/new_loader_completion/funcs/func_sha1.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_sha1.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================
--- team/group/new_loader_completion/funcs/func_sha1.c (original)
+++ team/group/new_loader_completion/funcs/func_sha1.c Mon May  1 07:44:31 2006
@@ -69,26 +69,14 @@
 		" which is known as his hash\n",
 };
 
-static char *tdesc = "SHA-1 computation dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
 	return ast_custom_function_unregister(&sha1_function);
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
 	return ast_custom_function_register(&sha1_function);
 }
 
-static const char *description(void)
-{
-	return tdesc;
-}
-
-static const char *key(void)
-{
-	return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "SHA-1 computation dialplan function");

Modified: team/group/new_loader_completion/funcs/func_strings.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/funcs/func_strings.c?rev=23928&r1=23927&r2=23928&view=diff
==============================================================================

[... 136 lines stripped ...]


More information about the svn-commits mailing list