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

Function cson_object_set

cson/cson.c:458–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456 return s->value;
457}
458int cson_object_set(cson_object *obj, char const *key, cson_value *v)
459{
460 size_t key_len = strlen(key) + 3;
461 struct cson_key *cson_key = malloc(sizeof(struct cson_key) + key_len);
462 sprintf(cson_key->buf, "$.%s", key);
463 LIST_INSERT_HEAD(&obj->key_list, cson_key, entry);
464 return cson__set(obj->value, cson_key->buf, v);
465}
466int cson_object_unset(cson_object *obj, char const *key)
467{
468 return cson_object_set(obj, key, NULL);

Callers 15

bdb_set_table_parameterFunction · 0.85
test_aFunction · 0.85
test_bFunction · 0.85
test_hFunction · 0.85
test_mFunction · 0.85
test_oFunction · 0.85
cson_object_unsetFunction · 0.85
eventlog_append_valueFunction · 0.85
eventlog_tablesFunction · 0.85
eventlog_perfdataFunction · 0.85
eventlog_contextFunction · 0.85
eventlog_pathFunction · 0.85

Calls 2

mallocFunction · 0.85
cson__setFunction · 0.85

Tested by 5

test_aFunction · 0.68
test_bFunction · 0.68
test_hFunction · 0.68
test_mFunction · 0.68
test_oFunction · 0.68