MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / str_strcasecmp

Function str_strcasecmp

ut.h:1297–1330  ·  view source on GitHub ↗

* case-insensitive compare two str's */

Source from the content-addressed store, hash-verified

1295 * case-insensitive compare two str's
1296 */
1297static inline int str_strcasecmp(const str *stra, const str *strb)
1298{
1299 int i;
1300 int alen;
1301 int blen;
1302 int minlen;
1303
1304 if(stra==NULL || strb==NULL || stra->s ==NULL || strb->s==NULL
1305 || stra->len<0 || strb->len<0)
1306 {
1307#ifdef EXTRA_DEBUG
1308 LM_DBG("bad parameters\n");
1309#endif
1310 return -2;
1311 }
1312 alen = stra->len;
1313 blen = strb->len;
1314 minlen = (alen < blen ? alen : blen);
1315
1316 for (i = 0; i < minlen; i++) {
1317 const char a = tolower(stra->s[i]);
1318 const char b = tolower(strb->s[i]);
1319 if (a < b)
1320 return -1;
1321 if (a > b)
1322 return 1;
1323 }
1324 if (alen < blen)
1325 return -1;
1326 else if (alen > blen)
1327 return 1;
1328 else
1329 return 0;
1330}
1331
1332#define start_expire_timer(begin,threshold) \
1333 do { \

Callers 15

fixup_branch_keepFunction · 0.85
fixup_blacklistFunction · 0.85
comp_s2sFunction · 0.85
get_stat_series_profileFunction · 0.85
reg_stat_series_profileFunction · 0.85
sca_mi_release_lineFunction · 0.85
authorizeFunction · 0.85
msrp_uri_cmpFunction · 0.85
b2b_sdp_parse_bye_modeFunction · 0.85
aaa_is_user_fixupFunction · 0.85
pv_parse_isup_param_nameFunction · 0.85
add_isup_part_cmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected