add regex api func

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6193 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-11-09 15:26:32 +00:00
parent 9871dc0c0d
commit 2372dcddd6
4 changed files with 78 additions and 1 deletions

View File

@@ -223,6 +223,26 @@ SWITCH_DECLARE(switch_bool_t) switch_is_lan_addr(const char *ip)
}
SWITCH_DECLARE(char *) switch_replace_char(char *str, char from, char to, switch_bool_t dup)
{
char *p;
if (dup) {
p = strdup(str);
assert(p);
} else {
p = str;
}
for(;p && *p; p++) {
if (*p == from) {
*p = to;
}
}
return p;
}
SWITCH_DECLARE(char *) switch_strip_spaces(const char *str)
{
const char *sp = str;