aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_logic.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-01 21:10:07 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-01 21:10:07 +0000
commitb1f91b97d2085cc845d0f57bd9907de50c995105 (patch)
tree9c836ac808552d20be6bd2baa3a3c29f642eda53 /funcs/func_logic.c
parentc5d084051f21e943fcbcc347fc80b166885f298d (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: http://svn.digium.com/svn/asterisk/trunk@153365 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_logic.c')
-rw-r--r--funcs/func_logic.c92
1 files changed, 77 insertions, 15 deletions
diff --git a/funcs/func_logic.c b/funcs/func_logic.c
index 7fca070aa..ef644f43f 100644
--- a/funcs/func_logic.c
+++ b/funcs/func_logic.c
@@ -34,6 +34,83 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/utils.h"
#include "asterisk/app.h"
+/*** DOCUMENTATION
+ <function name="ISNULL" language="en_US">
+ <synopsis>
+ Check if a value is NULL.
+ </synopsis>
+ <syntax>
+ <parameter name="data" required="true" />
+ </syntax>
+ <description>
+ <para>Returns <literal>1</literal> if NULL or <literal>0</literal> otherwise.</para>
+ </description>
+ </function>
+ <function name="SET" language="en_US">
+ <synopsis>
+ SET assigns a value to a channel variable.
+ </synopsis>
+ <syntax argsep="=">
+ <parameter name="varname" required="true" />
+ <parameter name="value" />
+ </syntax>
+ <description>
+ </description>
+ </function>
+ <function name="EXISTS" language="en_US">
+ <synopsis>
+ Test the existence of a value.
+ </synopsis>
+ <syntax>
+ <parameter name="data" required="true" />
+ </syntax>
+ <description>
+ <para>Returns <literal>1</literal> if exists, <literal>0</literal> otherwise.</para>
+ </description>
+ </function>
+ <function name="IF" language="en_US">
+ <synopsis>
+ Check for an expresion.
+ </synopsis>
+ <syntax argsep="?">
+ <parameter name="expresion" required="true" />
+ <parameter name="retvalue" argsep=":" required="true">
+ <argument name="true" />
+ <argument name="false" />
+ </parameter>
+ </syntax>
+ <description>
+ <para>Returns the data following <literal>?</literal> if true, else the data following <literal>:</literal></para>
+ </description>
+ </function>
+ <function name="IFTIME" language="en_US">
+ <synopsis>
+ Temporal Conditional.
+ </synopsis>
+ <syntax argsep="?">
+ <parameter name="timespec" required="true" />
+ <parameter name="retvalue" required="true" argsep=":">
+ <argument name="true" />
+ <argument name="false" />
+ </parameter>
+ </syntax>
+ <description>
+ <para>Returns the data following <literal>?</literal> if true, else the data following <literal>:</literal></para>
+ </description>
+ </function>
+ <function name="IMPORT" language="en_US">
+ <synopsis>
+ Retrieve the value of a variable from another channel.
+ </synopsis>
+ <syntax>
+ <parameter name="channel" required="true" />
+ <parameter name="variable" required="true" />
+ </syntax>
+ <description>
+ </description>
+ </function>
+ ***/
+
static int isnull(struct ast_channel *chan, const char *cmd, char *data,
char *buf, size_t len)
{
@@ -168,46 +245,31 @@ static int acf_import(struct ast_channel *chan, const char *cmd, char *data, cha
static struct ast_custom_function isnull_function = {
.name = "ISNULL",
- .synopsis = "NULL Test: Returns 1 if NULL or 0 otherwise",
- .syntax = "ISNULL(<data>)",
.read = isnull,
};
static struct ast_custom_function set_function = {
.name = "SET",
- .synopsis = "SET assigns a value to a channel variable",
- .syntax = "SET(<varname>=[<value>])",
.read = set,
};
static struct ast_custom_function exists_function = {
.name = "EXISTS",
- .synopsis = "Existence Test: Returns 1 if exists, 0 otherwise",
- .syntax = "EXISTS(<data>)",
.read = exists,
};
static struct ast_custom_function if_function = {
.name = "IF",
- .synopsis =
- "Conditional: Returns the data following '?' if true, else the data following ':'",
- .syntax = "IF(<expr>?[<true>][:<false>])",
.read = acf_if,
};
static struct ast_custom_function if_time_function = {
.name = "IFTIME",
- .synopsis =
- "Temporal Conditional: Returns the data following '?' if true, else the data following ':'",
- .syntax = "IFTIME(<timespec>?[<true>][:<false>])",
.read = iftime,
};
static struct ast_custom_function import_function = {
.name = "IMPORT",
- .synopsis =
- "Retrieve the value of a variable from another channel\n",
- .syntax = "IMPORT(channel,variable)",
.read = acf_import,
};