uci_unload(ctx, p); }if(uci_load(ctx, config, &p))return;structuci_element *e;structblob_attr *config =NULL; uci_foreach_element(&p->sectons, e) {structuci_section *s =uci_to_section(e); blob_buf_init(&b,0); uci_to_blob(&b, s, &policy_attr_list); config=blob_memdup(...
boolblobmsg_add_object(structblob_buf*b,structjson_object*obj); boolblobmsg_add_json_element(structblob_buf*b,constchar*name,structjson_object*obj); boolblobmsg_add_json_from_string(structblob_buf*b,constchar*str); boolblobmsg_add_json_from_file(structblob_buf*b,constchar*file); ...
bool blobmsg_add_object(struct blob_buf *b, json_object *obj) { json_object_object_foreach(obj, key, val) { if (!blobmsg_add_json_element(b, key, val)) return false; } return true; } static bool blobmsg_add_array(struct blob_buf *b, struct array_list *a) { in...
*/ #ifndef __BLOBMSG_JSON_H #define __BLOBMSG_JSON_H #ifdef JSONC #include <json.h> #else #include <json/json.h> #endif #include <stdbool.h> #include "blobmsg.h" bool blobmsg_add_object(struct blob_buf *b, json_object *obj); bool blobmsg_add_json_element(struct blob_buf *b,...