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>
blob/blobmsg: add explicit typecasts for attribute iterators Fixes C++ compatibility. Reported in https://forum.lede-project.org/t/blobmsg-for-each-attr-from-c/389 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: accept NULL attr in blobmsg_get_string() Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: add a helper function to reset the name of a blobmsg attribute 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>
blob/blobmsg: Perform explicit casts from void* to avoid compilation errors when using libubox from C++. Signed-off by: Jacob Siverskog <jacob@teenageengineering.com>
blobmsg: make length variables unsigned 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>
blobmsg: add blobmsg_len() for consistency (similar to blob_len) Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blob/blobmsg: add null pointer checks to the *_for_each_attr functions, fix formatting 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>
blob/blobmsg: use 32 bit load/store for 64 bit access, unaligned attributes cause data corruption on ARM Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg: add blobmsg_get_string 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
add blobmsg_add_blob() to copy over an existing blobmsg attribute