mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 04:31:50 +00:00
add hashing to event header lookup
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10227 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -295,6 +295,40 @@ static inline char *switch_safe_strdup(const char *it)
|
||||
}
|
||||
|
||||
|
||||
static inline char *switch_lc_strdup(const char *it)
|
||||
{
|
||||
char *dup;
|
||||
char *p;
|
||||
|
||||
if (it) {
|
||||
dup = strdup(it);
|
||||
for(p = dup; p && *p; p++) {
|
||||
*p = tolower(*p);
|
||||
}
|
||||
return dup;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static inline char *switch_uc_strdup(const char *it)
|
||||
{
|
||||
char *dup;
|
||||
char *p;
|
||||
|
||||
if (it) {
|
||||
dup = strdup(it);
|
||||
for(p = dup; p && *p; p++) {
|
||||
*p = toupper(*p);
|
||||
}
|
||||
return dup;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Test if one string is inside another with extra case checking
|
||||
\param s the inner string
|
||||
|
||||
Reference in New Issue
Block a user