mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
Merge changes from team/group/appdocsxml
This commit introduces the first phase of an effort to manage documentation of the interfaces in Asterisk in an XML format. Currently, a new format is available for applications and dialplan functions. A good number of conversions to the new format are also included. For more information, see the following message to asterisk-dev: http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -34,6 +34,49 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/app.h"
|
||||
|
||||
/*** DOCUMENTATION
|
||||
<function name="SORT" language="en_US">
|
||||
<synopsis>
|
||||
Sorts a list of key/vals into a list of keys, based upon the vals.
|
||||
</synopsis>
|
||||
<syntax>
|
||||
<parameter name="keyval" required="true" argsep=":">
|
||||
<argument name="key1" required="true" />
|
||||
<argument name="val1" required="true" />
|
||||
</parameter>
|
||||
<parameter name="keyvaln" multiple="true" argsep=":">
|
||||
<argument name="key2" required="true" />
|
||||
<argument name="val2" required="true" />
|
||||
</parameter>
|
||||
</syntax>
|
||||
<description>
|
||||
<para>Takes a comma-separated list of keys and values, each separated by a colon, and returns a
|
||||
comma-separated list of the keys, sorted by their values. Values will be evaluated as
|
||||
floating-point numbers.</para>
|
||||
</description>
|
||||
</function>
|
||||
<function name="CUT" language="en_US">
|
||||
<synopsis>
|
||||
Slices and dices strings, based upon a named delimiter.
|
||||
</synopsis>
|
||||
<syntax>
|
||||
<parameter name="varname" required="true">
|
||||
<para>Variable you want cut</para>
|
||||
</parameter>
|
||||
<parameter name="char-delim" required="true">
|
||||
<para>Delimiter, defaults to <literal>-</literal></para>
|
||||
</parameter>
|
||||
<parameter name="range-spec" required="true">
|
||||
<para>Number of the field you want (1-based offset), may also be specified as a range (with <literal>-</literal>)
|
||||
or group of ranges and fields (with <literal>&</literal>)</para>
|
||||
</parameter>
|
||||
</syntax>
|
||||
<description>
|
||||
<para>Cut out information from a string (<replaceable>varname</replaceable>), based upon a named delimiter.</para>
|
||||
</description>
|
||||
</function>
|
||||
***/
|
||||
|
||||
/* Maximum length of any variable */
|
||||
#define MAXRESULT 1024
|
||||
|
||||
@@ -255,25 +298,11 @@ static int acf_cut_exec(struct ast_channel *chan, const char *cmd, char *data, c
|
||||
|
||||
struct ast_custom_function acf_sort = {
|
||||
.name = "SORT",
|
||||
.synopsis = "Sorts a list of key/vals into a list of keys, based upon the vals",
|
||||
.syntax = "SORT(key1:val1[...][,keyN:valN])",
|
||||
.desc =
|
||||
"Takes a comma-separated list of keys and values, each separated by a colon, and returns a\n"
|
||||
"comma-separated list of the keys, sorted by their values. Values will be evaluated as\n"
|
||||
"floating-point numbers.\n",
|
||||
.read = acf_sort_exec,
|
||||
};
|
||||
|
||||
struct ast_custom_function acf_cut = {
|
||||
.name = "CUT",
|
||||
.synopsis = "Slices and dices strings, based upon a named delimiter.",
|
||||
.syntax = "CUT(<varname>,<char-delim>,<range-spec>)",
|
||||
.desc =
|
||||
" varname - variable you want cut\n"
|
||||
" char-delim - defaults to '-'\n"
|
||||
" range-spec - 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",
|
||||
.read = acf_cut_exec,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user