[asterisk-commits] seanbright: branch 1.6.0 r221963 - /branches/1.6.0/funcs/func_strings.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Oct 2 08:04:31 CDT 2009
Author: seanbright
Date: Fri Oct 2 08:04:24 2009
New Revision: 221963
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=221963
Log:
Revert XML docs that ended up in the 1.6.0 and 1.6.1 branches during a merge.
Modified:
branches/1.6.0/funcs/func_strings.c
Modified: branches/1.6.0/funcs/func_strings.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.0/funcs/func_strings.c?view=diff&rev=221963&r1=221962&r2=221963
==============================================================================
--- branches/1.6.0/funcs/func_strings.c (original)
+++ branches/1.6.0/funcs/func_strings.c Fri Oct 2 08:04:24 2009
@@ -38,326 +38,6 @@
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/localtime.h"
-
-AST_THREADSTORAGE(result_buf);
-
-/*** DOCUMENTATION
- <function name="FIELDQTY" language="en_US">
- <synopsis>
- Count the fields with an arbitrary delimiter
- </synopsis>
- <syntax>
- <parameter name="varname" required="true" />
- <parameter name="delim" required="true" />
- </syntax>
- <description>
- <para>The delimiter may be specified as a special or extended ASCII character, by encoding it. The characters
- <literal>\n</literal>, <literal>\r</literal>, and <literal>\t</literal> are all recognized as the newline,
- carriage return, and tab characters, respectively. Also, octal and hexadecimal specifications are recognized
- by the patterns <literal>\0nnn</literal> and <literal>\xHH</literal>, respectively. For example, if you wanted
- to encode a comma as the delimiter, you could use either <literal>\054</literal> or <literal>\x2C</literal>.</para>
- <para>Example: If ${example} contains <literal>ex-amp-le</literal>, then ${FIELDQTY(example,-)} returns 3.</para>
- </description>
- </function>
- <function name="LISTFILTER" language="en_US">
- <synopsis>Remove an item from a list, by name.</synopsis>
- <syntax>
- <parameter name="varname" required="true" />
- <parameter name="delim" required="true" default="," />
- <parameter name="value" required="true" />
- </syntax>
- <description>
- <para>Remove <replaceable>value</replaceable> from the list contained in the <replaceable>varname</replaceable>
- variable, where the list delimiter is specified by the <replaceable>delim</replaceable> parameter. This is
- very useful for removing a single channel name from a list of channels, for example.</para>
- </description>
- </function>
- <function name="FILTER" language="en_US">
- <synopsis>
- Filter the string to include only the allowed characters
- </synopsis>
- <syntax>
- <parameter name="allowed-chars" required="true" />
- <parameter name="string" required="true" />
- </syntax>
- <description>
- <para>Permits all characters listed in <replaceable>allowed-chars</replaceable>,
- filtering all others outs. In addition to literally listing the characters,
- you may also use ranges of characters (delimited by a <literal>-</literal></para>
- <para>Hexadecimal characters started with a <literal>\x</literal>(i.e. \x20)</para>
- <para>Octal characters started with a <literal>\0</literal> (i.e. \040)</para>
- <para>Also <literal>\t</literal>,<literal>\n</literal> and <literal>\r</literal> are recognized.</para>
- <note><para>If you want the <literal>-</literal> character it needs to be prefixed with a
- <literal>\</literal></para></note>
- </description>
- </function>
- <function name="REGEX" language="en_US">
- <synopsis>
- Check string against a regular expression.
- </synopsis>
- <syntax argsep=" ">
- <parameter name=""regular expression"" required="true" />
- <parameter name="string" required="true" />
- </syntax>
- <description>
- <para>Return <literal>1</literal> on regular expression match or <literal>0</literal> otherwise</para>
- <para>Please note that the space following the double quotes separating the
- regex from the data is optional and if present, is skipped. If a space is
- desired at the beginning of the data, then put two spaces there; the second
- will not be skipped.</para>
- </description>
- </function>
- <application name="ClearHash" language="en_US">
- <synopsis>
- Clear the keys from a specified hashname.
- </synopsis>
- <syntax>
- <parameter name="hashname" required="true" />
- </syntax>
- <description>
- <para>Clears all keys out of the specified <replaceable>hashname</replaceable>.</para>
- </description>
- </application>
- <function name="HASH" language="en_US">
- <synopsis>
- Implementation of a dialplan associative array
- </synopsis>
- <syntax>
- <parameter name="hashname" required="true" />
- <parameter name="hashkey" />
- </syntax>
- <description>
- <para>In two arguments mode, gets and sets values to corresponding keys within
- a named associative array. The single-argument mode will only work when assigned
- to from a function defined by func_odbc</para>
- </description>
- </function>
- <function name="HASHKEYS" language="en_US">
- <synopsis>
- Retrieve the keys of the HASH() function.
- </synopsis>
- <syntax>
- <parameter name="hashname" required="true" />
- </syntax>
- <description>
- <para>Returns a comma-delimited list of the current keys of the associative array
- defined by the HASH() function. Note that if you iterate over the keys of
- the result, adding keys during iteration will cause the result of the HASHKEYS()
- function to change.</para>
- </description>
- </function>
- <function name="KEYPADHASH" language="en_US">
- <synopsis>
- Hash the letters in string into equivalent keypad numbers.
- </synopsis>
- <syntax>
- <parameter name="string" required="true" />
- </syntax>
- <description>
- <para>Example: ${KEYPADHASH(Les)} returns "537"</para>
- </description>
- </function>
- <function name="ARRAY" language="en_US">
- <synopsis>
- Allows setting multiple variables at once.
- </synopsis>
- <syntax>
- <parameter name="var1" required="true" />
- <parameter name="var2" required="false" multiple="true" />
- <parameter name="varN" required="false" />
- </syntax>
- <description>
- <para>The comma-delimited list passed as a value to which the function is set will
- be interpreted as a set of values to which the comma-delimited list of
- variable names in the argument should be set.</para>
- <para>Example: Set(ARRAY(var1,var2)=1,2) will set var1 to 1 and var2 to 2</para>
- </description>
- </function>
- <function name="STRPTIME" language="en_US">
- <synopsis>
- Returns the epoch of the arbitrary date/time string structured as described by the format.
- </synopsis>
- <syntax>
- <parameter name="datetime" required="true" />
- <parameter name="timezone" required="true" />
- <parameter name="format" required="true" />
- </syntax>
- <description>
- <para>This is useful for converting a date into <literal>EPOCH</literal> time,
- possibly to pass to an application like SayUnixTime or to calculate the difference
- between the two date strings</para>
- <para>Example: ${STRPTIME(2006-03-01 07:30:35,America/Chicago,%Y-%m-%d %H:%M:%S)} returns 1141219835</para>
- </description>
- </function>
- <function name="STRFTIME" language="en_US">
- <synopsis>
- Returns the current date/time in the specified format.
- </synopsis>
- <syntax>
- <parameter name="epoch" />
- <parameter name="timezone" />
- <parameter name="format" />
- </syntax>
- <description>
- <para>STRFTIME supports all of the same formats as the underlying C function
- <emphasis>strftime(3)</emphasis>.
- It also supports the following format: <literal>%[n]q</literal> - fractions of a second,
- with leading zeros.</para>
- <para>Example: <literal>%3q</literal> will give milliseconds and <literal>%1q</literal>
- will give tenths of a second. The default is set at milliseconds (n=3).
- The common case is to use it in combination with %S, as in <literal>%S.%3q</literal>.</para>
- </description>
- <see-also>
- <ref type="manpage">strftime(3)</ref>
- </see-also>
- </function>
- <function name="EVAL" language="en_US">
- <synopsis>
- Evaluate stored variables
- </synopsis>
- <syntax>
- <parameter name="variable" required="true" />
- </syntax>
- <description>
- <para>Using EVAL basically causes a string to be evaluated twice.
- When a variable or expression is in the dialplan, it will be
- evaluated at runtime. However, if the results of the evaluation
- is in fact another variable or expression, using EVAL will have it
- evaluated a second time.</para>
- <para>Example: If the <variable>MYVAR</variable> contains
- <variable>OTHERVAR</variable>, then the result of ${EVAL(
- <variable>MYVAR</variable>)} in the dialplan will be the
- contents of <variable>OTHERVAR</variable>. Normally just
- putting <variable>MYVAR</variable> in the dialplan the result
- would be <variable>OTHERVAR</variable>.</para>
- </description>
- </function>
- <function name="TOUPPER" language="en_US">
- <synopsis>
- Convert string to all uppercase letters.
- </synopsis>
- <syntax>
- <parameter name="string" required="true" />
- </syntax>
- <description>
- <para>Example: ${TOUPPER(Example)} returns "EXAMPLE"</para>
- </description>
- </function>
- <function name="TOLOWER" language="en_US">
- <synopsis>
- Convert string to all lowercase letters.
- </synopsis>
- <syntax>
- <parameter name="string" required="true" />
- </syntax>
- <description>
- <para>Example: ${TOLOWER(Example)} returns "example"</para>
- </description>
- </function>
- <function name="LEN" language="en_US">
- <synopsis>
- Return the length of the string given.
- </synopsis>
- <syntax>
- <parameter name="string" required="true" />
- </syntax>
- <description>
- <para>Example: ${LEN(example)} returns 7</para>
- </description>
- </function>
- <function name="QUOTE" language="en_US">
- <synopsis>
- Quotes a given string, escaping embedded quotes as necessary
- </synopsis>
- <syntax>
- <parameter name="string" required="true" />
- </syntax>
- <description>
- <para>Example: ${QUOTE(ab"c"de)} will return "abcde"</para>
- </description>
- </function>
- <function name="CSV_QUOTE" language="en_US">
- <synopsis>
- Quotes a given string for use in a CSV file, escaping embedded quotes as necessary
- </synopsis>
- <syntax>
- <parameter name="string" required="true" />
- </syntax>
- <description>
- <para>Example: ${CSV_QUOTE("a,b" 123)} will return """a,b"" 123"</para>
- </description>
- </function>
- <function name="SHIFT" language="en_US">
- <synopsis>
- Removes and returns the first item off of a variable containing delimited text
- </synopsis>
- <syntax>
- <parameter name="varname" required="true" />
- <parameter name="delimiter" required="false" default="," />
- </syntax>
- <description>
- <para>Example:</para>
- <para>exten => s,1,Set(array=one,two,three)</para>
- <para>exten => s,n,While($["${SET(var=${SHIFT(array)})}" != ""])</para>
- <para>exten => s,n,NoOp(var is ${var})</para>
- <para>exten => s,n,EndWhile</para>
- <para>This would iterate over each value in array, left to right, and
- would result in NoOp(var is one), NoOp(var is two), and
- NoOp(var is three) being executed.
- </para>
- </description>
- </function>
- <function name="POP" language="en_US">
- <synopsis>
- Removes and returns the last item off of a variable containing delimited text
- </synopsis>
- <syntax>
- <parameter name="varname" required="true" />
- <parameter name="delimiter" required="false" default="," />
- </syntax>
- <description>
- <para>Example:</para>
- <para>exten => s,1,Set(array=one,two,three)</para>
- <para>exten => s,n,While($["${SET(var=${POP(array)})}" != ""])</para>
- <para>exten => s,n,NoOp(var is ${var})</para>
- <para>exten => s,n,EndWhile</para>
- <para>This would iterate over each value in array, right to left, and
- would result in NoOp(var is three), NoOp(var is two), and
- NoOp(var is one) being executed.
- </para>
- </description>
- </function>
- <function name="PUSH" language="en_US">
- <synopsis>
- Appends one or more values to the end of a variable containing delimited text
- </synopsis>
- <syntax>
- <parameter name="varname" required="true" />
- <parameter name="delimiter" required="false" default="," />
- </syntax>
- <description>
- <para>Example: Set(PUSH(array)=one,two,three) would append one,
- two, and three to the end of the values stored in the variable
- "array".
- </para>
- </description>
- </function>
- <function name="UNSHIFT" language="en_US">
- <synopsis>
- Inserts one or more values to the beginning of a variable containing delimited text
- </synopsis>
- <syntax>
- <parameter name="varname" required="true" />
- <parameter name="delimiter" required="false" default="," />
- </syntax>
- <description>
- <para>Example: Set(UNSHIFT(array)=one,two,three) would insert one,
- two, and three before the values stored in the variable
- "array".
- </para>
- </description>
- </function>
- ***/
static int function_fieldqty(struct ast_channel *chan, const char *cmd,
char *parse, char *buf, size_t len)
More information about the asterisk-commits
mailing list