[Asterisk-cvs] asterisk/include/asterisk utils.h,1.30,1.31

kpfleming at lists.digium.com kpfleming at lists.digium.com
Fri May 20 12:25:20 CDT 2005


Update of /usr/cvsroot/asterisk/include/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv20216/include/asterisk

Modified Files:
	utils.h 
Log Message:
make IF dialplan function handle quoted strings properly (bug #4322, with API mods)


Index: utils.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/utils.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- utils.h	15 May 2005 22:33:02 -0000	1.30
+++ utils.h	20 May 2005 16:30:13 -0000	1.31
@@ -130,7 +130,43 @@
 	char buf[1024];
 };
 
-extern char *ast_strip(char *buf);
+/*!
+  \brief Strip leading/trailing whitespace from a string.
+  \param s The string to be stripped (will be modified).
+  \return The stripped string.
+
+  This functions strips all leading and trailing whitespace
+  characters from the input string, and returns a pointer to
+  the resulting string. The string is modified in place.
+*/
+char *ast_strip(char *s);
+
+/*!
+  \brief Strip leading/trailing whitespace and quotes from a string.
+  \param s The string to be stripped (will be modified).
+  \param beg_quotes The list of possible beginning quote characters.
+  \param end_quotes The list of matching ending quote characters.
+  \return The stripped string.
+
+  This functions strips all leading and trailing whitespace
+  characters from the input string, and returns a pointer to
+  the resulting string. The string is modified in place.
+
+  It can also remove beginning and ending quote (or quote-like)
+  characters, in matching pairs. If the first character of the
+  string matches any character in beg_quotes, and the last
+  character of the string is the matching character in
+  end_quotes, then they are removed from the string.
+
+  Examples:
+  \code
+  ast_strip_quoted(buf, "\"", "\"");
+  ast_strip_quoted(buf, "'", "'");
+  ast_strip_quoted(buf, "[{(", "]})");
+  \endcode
+ */
+char *ast_strip_quoted(char *s, const char *beg_quotes, const char *end_quotes);
+
 extern struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp);
 /* ast_md5_hash: Produces MD5 hash based on input string */
 extern void ast_md5_hash(char *output, char *input);




More information about the svn-commits mailing list