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

Function md_json_setsa

modules/md/md_json.c:911–941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

909}
910
911apr_status_t md_json_setsa(apr_array_header_t *a, md_json_t *json, ...)
912{
913 json_t *nj, *j;
914 va_list ap;
915 int i;
916
917 va_start(ap, json);
918 j = jselect(json, ap);
919 va_end(ap);
920
921 if (!j || !json_is_array(j)) {
922 const char *key;
923
924 va_start(ap, json);
925 j = jselect_parent(&key, 1, json, ap);
926 va_end(ap);
927
928 if (!key || !j || !json_is_object(j)) {
929 return APR_EINVAL;
930 }
931 nj = json_array();
932 json_object_set_new(j, key, nj);
933 j = nj;
934 }
935
936 json_array_clear(j);
937 for (i = 0; i < a->nelts; ++i) {
938 json_array_append_new(j, json_string(APR_ARRAY_IDX(a, i, const char*)));
939 }
940 return APR_SUCCESS;
941}
942
943/**************************************************************************************************/
944/* formatting, parsing */

Callers 4

md_acme_acct_to_jsonFunction · 0.85
on_init_acct_newFunction · 0.85
md_acme_order_to_jsonFunction · 0.85
md_to_jsonFunction · 0.85

Calls 2

jselectFunction · 0.85
jselect_parentFunction · 0.85

Tested by

no test coverage detected