MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / tokcmp

Function tokcmp

util/segstring.c:276–290  ·  view source on GitHub ↗

TOKEN COMPARE - DOES CASE INSENSITIVE COMPARE OF TOKEN TO WHOLE TARGET C STRING*/

Source from the content-addressed store, hash-verified

274/* TOKEN COMPARE - DOES CASE INSENSITIVE COMPARE OF TOKEN TO
275 WHOLE TARGET C STRING*/
276int tokcmp(const char *tok, int ltok, const char *targ)
277{
278 int rc;
279 if (ltok == 0) {
280 if (targ[0] == 0)
281 return 0; /*match, both no data*/
282 return -1; /*no match, if target has data*/
283 }
284 rc = strncasecmp(tok, targ, ltok);
285 if (rc != 0)
286 return rc;
287 if (targ[ltok] != 0)
288 return -1; /*target is greater*/
289 return 0;
290}
291
292/* TOKEN COMPARE - DOES CASE INSENSITIVE COMPARE OF TOKEN TO
293 TARGET C STRING. PARTIAL MATCH OF C STRING OK.*/

Callers 15

bdb_process_user_commandFunction · 0.85
lock_infoFunction · 0.85
bdb_lc_cache_trapFunction · 0.85
net_cmdFunction · 0.85
thdpool_process_messageFunction · 0.85
logmsg_process_messageFunction · 0.85
logmsg_level_updateFunction · 0.85
segscanFunction · 0.85
segscanxFunction · 0.85
change_switchFunction · 0.85
deferred_do_commandsFunction · 0.85
lrl_ifFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected