From 8b0c007ad990aa27d9868da49215fd1076ac77cc Mon Sep 17 00:00:00 2001 From: kpfleming 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: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_read.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'apps/app_read.c') diff --git a/apps/app_read.c b/apps/app_read.c index f9c1f486f..262bbbbd2 100644 --- a/apps/app_read.c +++ b/apps/app_read.c @@ -57,8 +57,6 @@ AST_APP_OPTIONS(read_app_options, { AST_APP_OPTION('n', OPT_NOANSWER), }); -static char *tdesc = "Read Variable Application"; - static char *app = "Read"; static char *synopsis = "Read a variable"; @@ -82,14 +80,13 @@ static char *descrip = " timeout -- if greater than 0, that value will override the default timeout.\n\n" "Read should disconnect if the function fails or errors out.\n"; -LOCAL_USER_DECL; #define ast_next_data(instr,ptr,delim) if((ptr=strchr(instr,delim))) { *(ptr) = '\0' ; ptr++;} static int read_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; char tmp[256]; int maxdigits=255; int tries = 1; @@ -113,7 +110,7 @@ static int read_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); argcopy = ast_strdupa(data); @@ -149,7 +146,7 @@ static int read_exec(struct ast_channel *chan, void *data) } if (ast_strlen_zero(arglist.variable)) { ast_log(LOG_WARNING, "Invalid! Usage: Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } ts=NULL; @@ -162,7 +159,7 @@ static int read_exec(struct ast_channel *chan, void *data) if (ast_test_flag(&flags,OPT_SKIP)) { /* At the user's option, skip if the line is not up */ pbx_builtin_setvar_helper(chan, arglist.variable, "\0"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } else if (!ast_test_flag(&flags,OPT_NOANSWER)) { /* Otherwise answer unless we're supposed to read while on-hook */ @@ -214,34 +211,24 @@ static int read_exec(struct ast_channel *chan, void *data) } } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, read_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, "Read Variable Application"); -- cgit v1.2.3