[asterisk-commits] tilghman: branch tilghman/str_substitution r185942 - in /team/tilghman/str_su...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Apr 1 15:37:02 CDT 2009
Author: tilghman
Date: Wed Apr 1 15:36:44 2009
New Revision: 185942
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=185942
Log:
Some more changes to address Russell's review
Modified:
team/tilghman/str_substitution/apps/app_minivm.c
team/tilghman/str_substitution/apps/app_voicemail.c
team/tilghman/str_substitution/include/asterisk/ast_expr.h
team/tilghman/str_substitution/main/ast_expr2f.c
Modified: team/tilghman/str_substitution/apps/app_minivm.c
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/apps/app_minivm.c?view=diff&rev=185942&r1=185941&r2=185942
==============================================================================
--- team/tilghman/str_substitution/apps/app_minivm.c (original)
+++ team/tilghman/str_substitution/apps/app_minivm.c Wed Apr 1 15:36:44 2009
@@ -1035,7 +1035,7 @@
* line, used to ensure proper field wrapping.
* \retval The encoded string.
*/
-static char *ast_str_encode_mime(struct ast_str **end, int maxlen, const char *charset, const char *start, size_t preamble, size_t postamble)
+static const char *ast_str_encode_mime(struct ast_str **end, ssize_t maxlen, const char *charset, const char *start, size_t preamble, size_t postamble)
{
struct ast_str *tmp = ast_str_alloca(80);
int first_section = 1;
@@ -1077,7 +1077,7 @@
*
* \return The destination string with quotes wrapped on it (the to field).
*/
-static char *ast_str_quote(struct ast_str **buf, int maxlen, const char *from)
+static const char *ast_str_quote(struct ast_str **buf, ssize_t maxlen, const char *from)
{
const char *ptr;
Modified: team/tilghman/str_substitution/apps/app_voicemail.c
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/apps/app_voicemail.c?view=diff&rev=185942&r1=185941&r2=185942
==============================================================================
--- team/tilghman/str_substitution/apps/app_voicemail.c (original)
+++ team/tilghman/str_substitution/apps/app_voicemail.c Wed Apr 1 15:36:44 2009
@@ -3879,7 +3879,7 @@
*
* \return The destination string with quotes wrapped on it (the to field).
*/
-static char *ast_str_quote(struct ast_str **buf, int maxlen, const char *from)
+static const char *ast_str_quote(struct ast_str **buf, ssize_t maxlen, const char *from)
{
const char *ptr;
@@ -3951,7 +3951,7 @@
* line, used to ensure proper field wrapping.
* \retval The encoded string.
*/
-static char *ast_str_encode_mime(struct ast_str **end, int maxlen, const char *start, size_t preamble, size_t postamble)
+static const char *ast_str_encode_mime(struct ast_str **end, ssize_t maxlen, const char *start, size_t preamble, size_t postamble)
{
struct ast_str *tmp = ast_str_alloca(80);
int first_section = 1;
Modified: team/tilghman/str_substitution/include/asterisk/ast_expr.h
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/include/asterisk/ast_expr.h?view=diff&rev=185942&r1=185941&r2=185942
==============================================================================
--- team/tilghman/str_substitution/include/asterisk/ast_expr.h (original)
+++ team/tilghman/str_substitution/include/asterisk/ast_expr.h Wed Apr 1 15:36:44 2009
@@ -31,8 +31,23 @@
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);
-int ast_str_expr(struct ast_str **str, int maxlen, struct ast_channel *chan, char *expr);
+
+/*!\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)
}
Modified: team/tilghman/str_substitution/main/ast_expr2f.c
URL: http://svn.digium.com/svn-view/asterisk/team/tilghman/str_substitution/main/ast_expr2f.c?view=diff&rev=185942&r1=185941&r2=185942
==============================================================================
--- team/tilghman/str_substitution/main/ast_expr2f.c (original)
+++ team/tilghman/str_substitution/main/ast_expr2f.c Wed Apr 1 15:36:44 2009
@@ -2425,7 +2425,7 @@
}
#if !defined(STANDALONE)
-int ast_str_expr(struct ast_str **str, int maxlen, struct ast_channel *chan, char *expr)
+int ast_str_expr(struct ast_str **str, ssize_t maxlen, struct ast_channel *chan, char *expr)
{
struct parse_io io = { .string = expr, .chan = chan };
More information about the asterisk-commits
mailing list