diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-11-01 21:10:07 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-11-01 21:10:07 +0000 |
commit | 5b168ee34babe562be856ec8f1dd14c0abd7c1a5 (patch) | |
tree | 9c836ac808552d20be6bd2baa3a3c29f642eda53 /funcs/func_math.c | |
parent | 1fef0f63bbbde9530837995c8790b839f73b74e7 (diff) |
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
Diffstat (limited to 'funcs/func_math.c')
-rw-r--r-- | funcs/func_math.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/funcs/func_math.c b/funcs/func_math.c index 3517b16ed..627cf860a 100644 --- a/funcs/func_math.c +++ b/funcs/func_math.c @@ -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 }; |