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

Function md_json_is

modules/md/md_json.c:294–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292/* type things */
293
294int md_json_is(const md_json_type_t jtype, md_json_t *json, ...)
295{
296 json_t *j;
297 va_list ap;
298
299 va_start(ap, json);
300 j = jselect(json, ap);
301 va_end(ap);
302 switch (jtype) {
303 case MD_JSON_TYPE_OBJECT: return (j && json_is_object(j));
304 case MD_JSON_TYPE_ARRAY: return (j && json_is_array(j));
305 case MD_JSON_TYPE_STRING: return (j && json_is_string(j));
306 case MD_JSON_TYPE_REAL: return (j && json_is_real(j));
307 case MD_JSON_TYPE_INT: return (j && json_is_integer(j));
308 case MD_JSON_TYPE_BOOL: return (j && (json_is_true(j) || json_is_false(j)));
309 case MD_JSON_TYPE_NULL: return (j == NULL);
310 }
311 return 0;
312}
313
314static const char *md_json_type_name(const md_json_t *json)
315{

Callers 2

md_pkeys_spec_from_jsonFunction · 0.85
add_json_valFunction · 0.85

Calls 1

jselectFunction · 0.85

Tested by

no test coverage detected