aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_cut.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-21 02:11:39 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-21 02:11:39 +0000
commit8b0c007ad990aa27d9868da49215fd1076ac77cc (patch)
tree270b9c46c1e644483d6d2a35b509f43218ba3252 /funcs/func_cut.c
parenta42edc84034f91932a3e12d503e07f76a6eb498a (diff)
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
Diffstat (limited to 'funcs/func_cut.c')
-rw-r--r--funcs/func_cut.c35
1 files changed, 12 insertions, 23 deletions
diff --git a/funcs/func_cut.c b/funcs/func_cut.c
index 3df16de18..a8b8c8152 100644
--- a/funcs/func_cut.c
+++ b/funcs/func_cut.c
@@ -44,9 +44,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
/* Maximum length of any variable */
#define MAXRESULT 1024
-
-LOCAL_USER_DECL;
-
struct sortable_keys {
char *key;
float value;
@@ -213,10 +210,10 @@ static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size
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:
@@ -231,7 +228,8 @@ static int acf_sort_exec(struct ast_channel *chan, char *cmd, char *data, char *
default:
ast_log(LOG_ERROR, "Unknown internal error\n");
}
- LOCAL_USER_REMOVE(u);
+
+ ast_module_user_remove(u);
return ret;
}
@@ -239,9 +237,9 @@ static int acf_sort_exec(struct ast_channel *chan, char *cmd, char *data, char *
static int acf_cut_exec(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
{
int ret = -1;
- struct localuser *u;
+ struct ast_module_user *u;
- LOCAL_USER_ADD(u);
+ u = ast_module_user_add(chan);
switch (cut_internal(chan, data, buf, len)) {
case ERROR_NOARG:
@@ -259,7 +257,8 @@ static int acf_cut_exec(struct ast_channel *chan, char *cmd, char *data, char *b
default:
ast_log(LOG_ERROR, "Unknown internal error\n");
}
- LOCAL_USER_REMOVE(u);
+
+ ast_module_user_remove(u);
return ret;
}
@@ -288,19 +287,19 @@ struct ast_custom_function acf_cut = {
.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;
@@ -310,14 +309,4 @@ static int load_module(void *mod)
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");