summaryrefslogtreecommitdiff
path: root/include/asterisk/ast_expr.h
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2009-04-29 18:53:01 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2009-04-29 18:53:01 +0000
commita866a7590085a1f635ca92459c3917e5cded257a (patch)
tree972bdf8f96c18f1b9667469307af69385f4a75f3 /include/asterisk/ast_expr.h
parent0ea83eab4811c8519e4e04bf4c59b1744cf1efc9 (diff)
Merge str_substitution branch.
This branch adds additional methods to dialplan functions, whereby the result buffers are now dynamic buffers, which can be expanded to the size of any result. No longer are variable substitutions limited to 4095 bytes of data. In addition, the common case of needing buffers much smaller than that will enable substitution to only take up the amount of memory actually needed. The existing variable substitution routines are still available, but users of those API calls should transition to using the dynamic-buffer APIs. Reviewboard: http://reviewboard.digium.com/r/174/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/ast_expr.h')
-rw-r--r--include/asterisk/ast_expr.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/asterisk/ast_expr.h b/include/asterisk/ast_expr.h
index a89b7b9a1..2dcb71f63 100644
--- a/include/asterisk/ast_expr.h
+++ b/include/asterisk/ast_expr.h
@@ -31,8 +31,24 @@
extern "C" {
#endif
+/*!\brief Evaluate the given expression
+ * \param expr An expression
+ * \param buf Result buffer
+ * \param length Size of the result buffer, in bytes
+ * \param chan Channel to use for evaluating included dialplan functions, if any
+ * \return Length of the result string, in bytes
+ */
int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan);
+/*!\brief Evaluate the given expression
+ * \param str Dynamic result buffer
+ * \param maxlen <0 if the size of the buffer should remain constant, >0 if the size of the buffer should expand to that many bytes, maximum, or 0 for unlimited expansion of the result buffer
+ * \param chan Channel to use for evaluating included dialplan functions, if any
+ * \param expr An expression
+ * \return Length of the result string, in bytes
+ */
+int ast_str_expr(struct ast_str **str, ssize_t maxlen, struct ast_channel *chan, char *expr);
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif