From 0a27d8bfe5fa36d8cb600b5b520f9b5c7fbf0ed6 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Mon, 21 Aug 2006 02:11:39 +0000 Subject: merge new_loader_completion branch, including (at least): - restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_exec.c | 46 +++++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) (limited to 'apps/app_exec.c') diff --git a/apps/app_exec.c b/apps/app_exec.c index d0c2591df..0aafac343 100644 --- a/apps/app_exec.c +++ b/apps/app_exec.c @@ -45,8 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") /* Maximum length of any variable */ #define MAXRESULT 1024 -static char *tdesc = "Executes dialplan applications"; - /*! Note * * The key difference between these two apps is exit status. In a @@ -90,16 +88,14 @@ static char *execif_descrip = "If is true, but is not found, then the application\n" "will return a non-zero value.\n"; -LOCAL_USER_DECL; - static int exec_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; char *s, *appname, *endargs, args[MAXRESULT] = ""; struct ast_app *app; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Check and parse arguments */ if (data) { @@ -122,18 +118,18 @@ static int exec_exec(struct ast_channel *chan, void *data) } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } static int tryexec_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; char *s, *appname, *endargs, args[MAXRESULT] = ""; struct ast_app *app; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Check and parse arguments */ if (data) { @@ -157,19 +153,20 @@ static int tryexec_exec(struct ast_channel *chan, void *data) } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int execif_exec(struct ast_channel *chan, void *data) { - int res=0; - struct localuser *u; +static int execif_exec(struct ast_channel *chan, void *data) +{ + int res = 0; + struct ast_module_user *u; char *myapp = NULL; char *mydata = NULL; char *expr = NULL; struct ast_app *app = NULL; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); expr = ast_strdupa(data); @@ -195,11 +192,12 @@ static int execif_exec(struct ast_channel *chan, void *data) { res = -1; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); + return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -207,12 +205,12 @@ static int unload_module(void *mod) res |= ast_unregister_application(app_tryexec); res |= ast_unregister_application(app_execif); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { 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); @@ -220,14 +218,4 @@ static int load_module(void *mod) return res; } -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, "Executes dialplan applications"); -- cgit v1.2.3