MCPcopy Create free account
hub / github.com/MariaDB/server / json_norm_object_append_key_value

Function json_norm_object_append_key_value

strings/json_normalize.c:238–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236
237
238static int
239json_norm_object_append_key_value(struct json_norm_object *obj,
240 DYNAMIC_STRING *key,
241 struct json_norm_value *val)
242{
243 struct json_norm_kv pair;
244 int err= json_norm_string_init(&pair.key, key->str, key->length);
245
246 if (err)
247 return 1;
248
249 pair.value= *val;
250
251 err|= insert_dynamic(&obj->kv_pairs, &pair);
252 if (err)
253 {
254 json_norm_string_free(&pair.key);
255 return 1;
256 }
257
258 return 0;
259}
260
261
262static struct json_norm_kv*

Callers 1

Calls 3

json_norm_string_initFunction · 0.85
insert_dynamicFunction · 0.85
json_norm_string_freeFunction · 0.85

Tested by

no test coverage detected