mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-12 20:27:19 +00:00
[core] add switch_filecmp
This commit is contained in:
parent
761d5310fd
commit
f74e2a962c
@ -1280,6 +1280,31 @@ static inline switch_bool_t switch_is_file_path(const char *file)
|
|||||||
return r ? SWITCH_TRUE : SWITCH_FALSE;
|
return r ? SWITCH_TRUE : SWITCH_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int switch_filecmp(const char *a, const char *b)
|
||||||
|
{
|
||||||
|
const char *e;
|
||||||
|
|
||||||
|
if (zstr(a) || zstr(b)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
while(*a == '{') {
|
||||||
|
if ((e = switch_find_end_paren(a, '{', '}'))) {
|
||||||
|
a = e + 1;
|
||||||
|
while(*a == ' ') a++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while(*b == '{') {
|
||||||
|
if ((e = switch_find_end_paren(b, '{', '}'))) {
|
||||||
|
b = e + 1;
|
||||||
|
while(*b == ' ') b++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return strcmp(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline const char *switch_parse_audio_col(switch_audio_col_t col)
|
static inline const char *switch_parse_audio_col(switch_audio_col_t col)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user