blobmsg: add support for double This adds support for double floating point type to make it more JSON compatible. For type checking it also adds a stub BLOB_ATTR_DOUBLE type. If necessary, the accessor functions for blob can be added later Signed-off-by: André Gaul <andre@gaul.io> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Fix various memory management issues Consistently handle allocation failures. Some functions are changed to return bool or int instead of void to allow returning an error. Also fix a buffer size miscalculation in lua/uloop and use _exit() instead of exit() on errors after forking. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
blobmsg: remove unneeded assignment in blobmsg_alloc_string_buffer(). data_dest should already be assigned by blobmsg_new() if the return value is not NULL. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
blob: improve out-of-memory handling Signed-off-by: Chen Bin <ewolfok@126.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: add blobmsg_check_array, which returns the size of the array Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: make length variables unsigned Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: remove unnecessary initialization Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: allow data/length iterator/accessor functions to work on non-blobmsg elements This primarily helps with simplifying the ubus APIs. blobmsg header presence is indicated by the BLOB_ATTR_EXTENDED bit in the id_len field. This changes the format ABI, but not the API. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blob: add a magic offset to nesting cookies to ensure that NULL is never returned as a normal value Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: implement blobmsg_printf and blobmsg_vprintf Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: add blobmsg_realloc_string_buffer() Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: fix blobmsg_parse_array, drop name field requirement Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: allow BLOBMSG_TYPE_UNSPEC attributes, treat them as null for JSON conversion Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: add blobmsg_parse_array() Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: remove the unnecessary name argument from blobmsg_check_attr_list, infer it from the list type
blobmsg: add blobmsg_check_attr_list() to validate element types of arrays and tables
switch blobmsg over to permissive license
fix more instances of uninitialized padding bytes
blobmsg: fill padding between name and data
make the blobmsg format endian agnostic (stick to big-endian)