aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_cut.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-07 15:36:55 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-07 15:36:55 +0000
commit70ab5bd04809f7842fbb7de5f928520fe152048c (patch)
treee5dc40ad9425950e8cb0338dd3f260705381898a /apps/app_cut.c
parent2188d03a9df95ef9a50ebbc67b6a4dcaadc70312 (diff)
This is the first round of removing applications that were marked as deprecated
in the 1.2 release. They are being removed from the trunk and will not be in the next major release. The following is a list of the applications that are being removed in this commit: Curl, Cut, Sort, DBPut, DBGet, ENUMLookup, Eval GetGroupCount, SetGroup, CheckGroup, GetGroupMatchCount MD5, MD5Check, Math, SetCIDName, SetCIDNum, SetRDNIS, SetCallerID TXTCIDName, AbsoluteTimeout, DigitTimeout, ResponseTimeout, SetAccount SetLanguage, SetVar (renamed to Set) These changes also include moving the "group show channels" cli command from app_groupcount.c to cli.c. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7379 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_cut.c')
-rw-r--r--apps/app_cut.c128
1 files changed, 0 insertions, 128 deletions
diff --git a/apps/app_cut.c b/apps/app_cut.c
index b6b457ab7..6922fc313 100644
--- a/apps/app_cut.c
+++ b/apps/app_cut.c
@@ -43,31 +43,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *tdesc = "Cut out information from a string";
-static char *app_cut = "Cut";
-
-static char *cut_synopsis = "Splits a variable's contents using the specified delimiter";
-
-static char *cut_descrip =
-" Cut(newvar=varname,delimiter,fieldspec): This applicaiton will split the\n"
-"contents of a variable based on the given delimeter and store the result in\n"
-"a new variable.\n"
-"Parameters:\n"
-" newvar - new variable created from result string\n"
-" varname - variable you want cut\n"
-" delimiter - defaults to '-'\n"
-" fieldspec - number of the field you want (1-based offset)\n"
-" may also be specified as a range (with -)\n"
-" or group of ranges and fields (with &)\n"
-"This application has been deprecated in favor of the CUT function.\n";
-
-static char *app_sort = "Sort";
-static char *app_sort_synopsis = "Sorts a list of keywords and values";
-static char *app_sort_descrip =
-" Sort(newvar=key1:val1[,key2:val2[[...],keyN:valN]]): This application will\n"
-"sort the list provided in ascending order. The result will be stored in the\n"
-"specified variable name.\n"
-" This applicaiton has been deprecated in favor of the SORT function.\n";
-
STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
@@ -258,105 +233,6 @@ static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size
return 0;
}
-static int sort_exec(struct ast_channel *chan, void *data)
-{
- int res=0;
- struct localuser *u;
- char *varname, *strings, result[512] = "";
- static int dep_warning=0;
-
- if (!dep_warning) {
- ast_log(LOG_WARNING, "The application Sort is deprecated. Please use the SORT() function instead.\n");
- dep_warning=1;
- }
-
- if (!data) {
- ast_log(LOG_ERROR, "Sort() requires an argument\n");
- return 0;
- }
-
- LOCAL_USER_ADD(u);
-
- strings = ast_strdupa((char *)data);
- if (!strings) {
- ast_log(LOG_ERROR, "Out of memory\n");
- LOCAL_USER_REMOVE(u);
- return 0;
- }
-
- varname = strsep(&strings, "=");
- switch (sort_internal(chan, strings, result, sizeof(result))) {
- case ERROR_NOARG:
- ast_log(LOG_ERROR, "Sort() requires an argument\n");
- res = 0;
- break;
- case ERROR_NOMEM:
- ast_log(LOG_ERROR, "Out of memory\n");
- res = -1;
- break;
- case 0:
- pbx_builtin_setvar_helper(chan, varname, result);
- res = 0;
- break;
- default:
- ast_log(LOG_ERROR, "Unknown internal error\n");
- res = -1;
- }
- LOCAL_USER_REMOVE(u);
- return res;
-}
-
-static int cut_exec(struct ast_channel *chan, void *data)
-{
- int res=0;
- struct localuser *u;
- char *s, *newvar=NULL, result[512];
- static int dep_warning = 0;
-
- LOCAL_USER_ADD(u);
-
- if (!dep_warning) {
- ast_log(LOG_WARNING, "The application Cut is deprecated. Please use the CUT() function instead.\n");
- dep_warning=1;
- }
-
- /* Check and parse arguments */
- if (data) {
- s = ast_strdupa((char *)data);
- if (s) {
- newvar = strsep(&s, "=");
- } else {
- ast_log(LOG_ERROR, "Out of memory\n");
- LOCAL_USER_REMOVE(u);
- return -1;
- }
- }
-
- switch (cut_internal(chan, s, result, sizeof(result))) {
- case ERROR_NOARG:
- ast_log(LOG_ERROR, "Cut() requires an argument\n");
- res = 0;
- break;
- case ERROR_NOMEM:
- ast_log(LOG_ERROR, "Out of memory\n");
- res = -1;
- break;
- case ERROR_USAGE:
- ast_log(LOG_ERROR, "Usage: %s\n", cut_synopsis);
- res = 0;
- break;
- case 0:
- pbx_builtin_setvar_helper(chan, newvar, result);
- res = 0;
- break;
- default:
- ast_log(LOG_ERROR, "Unknown internal error\n");
- res = -1;
- }
- LOCAL_USER_REMOVE(u);
- return res;
-}
-
static char *acf_sort_exec(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
{
struct localuser *u;
@@ -434,8 +310,6 @@ int unload_module(void)
res = ast_custom_function_unregister(&acf_cut);
res |= ast_custom_function_unregister(&acf_sort);
- res |= ast_unregister_application(app_sort);
- res |= ast_unregister_application(app_cut);
STANDARD_HANGUP_LOCALUSERS;
@@ -448,8 +322,6 @@ int load_module(void)
res = ast_custom_function_register(&acf_cut);
res |= ast_custom_function_register(&acf_sort);
- res |= ast_register_application(app_sort, sort_exec, app_sort_synopsis, app_sort_descrip);
- res |= ast_register_application(app_cut, cut_exec, cut_synopsis, cut_descrip);
return res;
}