mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 09:58:17 +00:00
add local vars with []
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6609 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user