[Freeswitch-trunk] [commit] r6609 - in freeswitch/trunk/src: . include
Freeswitch SVN
anthm at freeswitch.org
Mon Dec 10 16:58:40 EST 2007
Author: anthm
Date: Mon Dec 10 16:58:40 2007
New Revision: 6609
Modified:
freeswitch/trunk/src/include/switch_utils.h
freeswitch/trunk/src/switch_utils.c
Log:
add local vars with []
Modified: freeswitch/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/trunk/src/include/switch_utils.h (original)
+++ freeswitch/trunk/src/include/switch_utils.h Mon Dec 10 16:58:40 2007
@@ -341,6 +341,7 @@
SWITCH_DECLARE(size_t) switch_url_encode(const char *url, char *buf, size_t len);
SWITCH_DECLARE(char *) switch_url_decode(char *s);
SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *from, const char *headers, const char *body, const char *file);
+SWITCH_DECLARE(char *) switch_find_end_paren(const char *s, char open, char close);
/* malloc or DIE macros */
#ifdef NDEBUG
Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c (original)
+++ freeswitch/trunk/src/switch_utils.c Mon Dec 10 16:58:40 2007
@@ -36,6 +36,33 @@
#include "private/switch_core_pvt.h"
+SWITCH_DECLARE(char *) switch_find_end_paren(const char *s, char open, char close)
+{
+ const char *e = NULL;
+ int depth = 0;
+
+ while (s && *s && *s == ' ') {
+ s++;
+ }
+
+ if (*s == open) {
+ depth++;
+ for (e = s + 1; e && *e; e++) {
+ if (*e == open) {
+ depth++;
+ } else if (*e == close) {
+ depth--;
+ if (!depth) {
+ break;
+ }
+ }
+ }
+ }
+
+ return (char *)e;
+}
+
+
SWITCH_DECLARE(switch_size_t) switch_fd_read_line(int fd, char *buf, switch_size_t len)
{
char c, *p;
More information about the Freeswitch-trunk
mailing list