MCPcopy Create free account
hub / github.com/corosync/corosync / icmap_item_eq

Function icmap_item_eq

exec/icmap.c:364–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364static int icmap_item_eq(const struct icmap_item *item, const void *value, size_t value_len, icmap_value_types_t type)
365{
366 size_t ptr_len;
367
368 if (item->type != type) {
369 return (0);
370 }
371
372 if (item->type == ICMAP_VALUETYPE_STRING) {
373 ptr_len = strlen((const char *)value);
374 if (ptr_len > value_len) {
375 ptr_len = value_len;
376 }
377 ptr_len++;
378 } else {
379 ptr_len = value_len;
380 }
381
382 if (item->value_len == ptr_len) {
383 return (memcmp(item->value, value, value_len) == 0);
384 };
385
386 return (0);
387}
388
389int icmap_key_value_eq(
390 const icmap_map_t map1,

Callers 2

icmap_key_value_eqFunction · 0.85
icmap_set_rFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected