mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +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:
@@ -39,6 +39,35 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/app.h"
|
||||
#include "asterisk/config.h"
|
||||
|
||||
/*** DOCUMENTATION
|
||||
<function name="MATH" language="en_US">
|
||||
<synopsis>
|
||||
Performs Mathematical Functions.
|
||||
</synopsis>
|
||||
<syntax>
|
||||
<parameter name="expression" required="true">
|
||||
<para>Is of the form:
|
||||
<replaceable>number1</replaceable><replaceable>op</replaceable><replaceable>number2</replaceable>
|
||||
where the possible values for <replaceable>op</replaceable>
|
||||
are:</para>
|
||||
<para>+,-,/,*,%,<<,>>,^,AND,OR,XOR,<,%gt;,>=,<=,== (and behave as their C equivalents)</para>
|
||||
</parameter>
|
||||
<parameter name="type">
|
||||
<para>Wanted type of result:</para>
|
||||
<para>f, float - float(default)</para>
|
||||
<para>i, int - integer</para>
|
||||
<para>h, hex - hex</para>
|
||||
<para>c, char - char</para>
|
||||
</parameter>
|
||||
</syntax>
|
||||
<description>
|
||||
<para>Performs mathematicas functions based on two parameters and a operator, the returned
|
||||
value type is <replaceable>type</replaceable></para>
|
||||
<para>Example: Set(i=${MATH(123%16,int)}) - sets var i=11</para>
|
||||
</description>
|
||||
</function>
|
||||
***/
|
||||
|
||||
enum TypeOfFunctions {
|
||||
ADDFUNCTION,
|
||||
DIVIDEFUNCTION,
|
||||
@@ -306,17 +335,6 @@ static int math(struct ast_channel *chan, const char *cmd, char *parse,
|
||||
|
||||
static struct ast_custom_function math_function = {
|
||||
.name = "MATH",
|
||||
.synopsis = "Performs Mathematical Functions",
|
||||
.syntax = "MATH(<number1><op><number2>[,<type_of_result>])",
|
||||
.desc = "Perform calculation on number1 to number2. Valid ops are: \n"
|
||||
" +,-,/,*,%,<<,>>,^,AND,OR,XOR,<,>,>=,<=,==\n"
|
||||
"and behave as their C equivalents.\n"
|
||||
"<type_of_result> - wanted type of result:\n"
|
||||
" f, float - float(default)\n"
|
||||
" i, int - integer,\n"
|
||||
" h, hex - hex,\n"
|
||||
" c, char - char\n"
|
||||
"Example: Set(i=${MATH(123%16,int)}) - sets var i=11",
|
||||
.read = math
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user