aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/strings.h
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-20 20:20:04 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-20 20:20:04 +0000
commitcc20111b727a69579dd9e58e05fca9deb75687f7 (patch)
tree028d8f36127b8aefd66e997f6e27e207a85f1e15 /include/asterisk/strings.h
parent59d6c7a704380c45bef9313de86f6b2620e80366 (diff)
- move the string join() function to utils.c since it is used in both cli.c and res_agi.c
- reimplement ast_join to be of linear effieciency instead of quadratic - remove some useless checks for "if (e)" - reorder checks for strings starting with '_' to avoid a useless call to ast_join() - check array bounds when parsing arguments to AGI (issue #5868) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7556 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/strings.h')
-rw-r--r--include/asterisk/strings.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index 13ecb3a5f..1a827e625 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -165,6 +165,7 @@ void ast_copy_string(char *dst, const char *src, size_t size),
}
)
+
/*!
\brief Build a string in a buffer, designed to be called repeatedly
@@ -210,6 +211,18 @@ int ast_true(const char *val);
*/
int ast_false(const char *val);
+/*
+ \brief Join an array of strings into a single string.
+ \param s the resulting string buffer
+ \param len the length of the result buffer, s
+ \param w an array of strings to join
+
+ This function will join all of the strings in the array 'w' into a single
+ string. It will also place a space in the result buffer in between each
+ string from 'w'.
+*/
+void ast_join(char *s, size_t len, char * const w[]);
+
/* The realloca lets us ast_restrdupa(), but you can't mix any other ast_strdup calls! */
struct ast_realloca {