MCPcopy Create free account
hub / github.com/apache/httpd / jselect_add

Function jselect_add

modules/md/md_json.c:165–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165static apr_status_t jselect_add(json_t *val, md_json_t *json, va_list ap)
166{
167 const char *key;
168 json_t *j, *aj;
169
170 j = jselect_parent(&key, 1, json, ap);
171
172 if (!j || !json_is_object(j)) {
173 return APR_EINVAL;
174 }
175
176 aj = json_object_get(j, key);
177 if (!aj) {
178 aj = json_array();
179 json_object_set_new(j, key, aj);
180 }
181
182 if (!json_is_array(aj)) {
183 return APR_EINVAL;
184 }
185
186 json_array_append(aj, val);
187 return APR_SUCCESS;
188}
189
190static apr_status_t jselect_insert(json_t *val, size_t index, md_json_t *json, va_list ap)
191{

Callers 1

md_json_addjFunction · 0.85

Calls 1

jselect_parentFunction · 0.85

Tested by

no test coverage detected