| 456 | return s->value; |
| 457 | } |
| 458 | int 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 | } |
| 466 | int cson_object_unset(cson_object *obj, char const *key) |
| 467 | { |
| 468 | return cson_object_set(obj, key, NULL); |