100    if (one->
value < two->value)
 
  102    else if (one->
value == two->value)
 
 
  108#define ERROR_NOARG (-1) 
  109#define ERROR_NOMEM (-2) 
  110#define ERROR_USAGE (-3) 
  114    char *strings, *ptrkey, *ptrvalue;
 
  115    int count=1, count2, element_count=0;
 
  125    for (ptrkey = strings; *ptrkey; ptrkey++) {
 
  136    while ((ptrkey = 
strsep(&strings, 
","))) {
 
  137        ptrvalue = strchr(ptrkey, 
':');
 
  151    for (count2 = 0; count2 < count; count2++) {
 
  152        int blen = strlen(buffer);
 
  153        if (element_count++) {
 
  154            strncat(buffer + blen, 
",", buflen - blen - 1);
 
 
  165    char *parse, ds[2], *var_expr;
 
  166    size_t delim_consumed;
 
  185    snprintf(var_expr, strlen(
args.varname) + 4, 
"${%s}", 
args.varname);
 
  198        int out_field_count = 0;
 
  201            char *next_range = 
strsep(&(
args.field), 
"&");
 
  202            int start_field, stop_field;
 
  205            if (sscanf(next_range, 
"%30d-%30d", &start_field, &stop_field) == 2) {
 
  207            } 
else if (sscanf(next_range, 
"-%30d", &stop_field) == 1) {
 
  210            } 
else if ((sscanf(next_range, 
"%30d%1c", &start_field, &trashchar) == 2) && (trashchar == 
'-')) {
 
  212                stop_field = INT_MAX;
 
  213            } 
else if (sscanf(next_range, 
"%30d", &start_field) == 1) {
 
  215                stop_field = start_field;
 
  223            while (curfieldptr != 
NULL && curfieldnum < start_field) {
 
  229            if (curfieldnum > start_field) {
 
  234            while (curfieldptr != 
NULL && curfieldnum <= stop_field) {
 
  235                char *field_value = 
strsep(&curfieldptr, ds);
 
 
  273        ast_log(
LOG_ERROR, 
"Syntax: CUT(<varname>,<char-delim>,<range-spec>) - missing argument!\n");
 
 
  298        ast_log(
LOG_ERROR, 
"Syntax: CUT(<varname>,<char-delim>,<range-spec>) - missing argument!\n");
 
 
char * strsep(char **str, const char *delims)
Asterisk main include file. File version handling, generic pbx functions.
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_strdupa(s)
duplicate a string in memory from the stack
General Asterisk PBX channel definitions.
Generic File Format Support. Should be included by clients of the file handling routines....
static int sort_internal(struct ast_channel *chan, char *data, char *buffer, size_t buflen)
static int acf_sort_exec(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static struct ast_custom_function acf_cut
static struct ast_custom_function acf_sort
static int acf_cut_exec(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int sort_subroutine(const void *arg1, const void *arg2)
static int acf_cut_exec2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
static int load_module(void)
static int unload_module(void)
static int cut_internal(struct ast_channel *chan, char *data, struct ast_str **buf, ssize_t buflen)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
int ast_get_encoded_char(const char *stream, char *result, size_t *consumed)
Decode an encoded control or extended ASCII character.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Core PBX routines and definitions.
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
#define ast_custom_function_register(acf)
Register a custom function.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
size_t attribute_pure ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
char *attribute_pure ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Main Channel structure associated with a channel.
Data structure associated with a custom dialplan function.
Support for dynamic strings.