Felix Fietkau
d4e33e7c40
list_compat.h: remove list_entity compat define
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-03-20 22:55:45 +01:00
Felix Fietkau
eccb7b541d
utils: add __constructor and __hidden defines
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-03-18 14:04:06 +01:00
Felix Fietkau
7d5d10ec95
blobmsg_json: unconditionally use blobmsg data/len accessor functions
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-03-12 20:18:12 +01:00
Felix Fietkau
b1d523601a
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>
2014-03-12 20:18:12 +01:00
Jo-Philipp Wich
62c872c5e7
blobmsg_json: do not emit any whitespace when formatting without indentation
2013-11-27 18:56:04 +00:00
Felix Fietkau
02d0cc86f5
utils.h: fix name collisions in __u_bswap16 with using "val" both inside the macro and as argument
...
Reported-by: Markus Stenberg <markus.stenberg@iki.fi>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-10-24 11:33:23 +02:00
Felix Fietkau
3b131e86a1
blobmsg: add blobmsg_len() for consistency (similar to blob_len)
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-10-20 13:19:51 +02:00
Felix Fietkau
7b397d40bb
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>
2013-10-16 01:22:02 +02:00
Felix Fietkau
bf9e09783f
blobmsg_json: allow signed output of integers
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-10-04 16:55:45 +02:00
Felix Fietkau
e36789caf6
blob: add blob_put_raw() for copying one or more blob attributes into the buffer directly
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-10-04 16:55:45 +02:00
Felix Fietkau
43ca2938da
blob/blobmsg: add null pointer checks to the *_for_each_attr functions, fix formatting
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-07-29 14:44:11 +02:00
Felix Fietkau
b8b7cac8cd
blobmsg_json: do not corrupt UTF-8 strings
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-06-21 17:19:37 +02:00
Felix Fietkau
5d4b4655d6
blobmsg_json: fix \u escaping for control characters
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-06-21 17:06:34 +02:00
Felix Fietkau
a9eaf28174
utils: add bitfield inline ops
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-06-10 13:37:14 +02:00
Felix Fietkau
b0415dc5b0
blobmsg_json: add blobmsg_add_json_from_file
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-05-29 12:14:48 +02:00
Thomas Gstädtner
db2ba3d769
add pkgconfig support for json-c
...
this includes a fallback for legacy support
2013-03-05 10:44:48 +01:00
Felix Fietkau
26ec9f6ec4
blobmsg: implement blobmsg_printf and blobmsg_vprintf
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-17 16:42:12 +01:00
Felix Fietkau
d705de0250
utils: make le16 endian conversion functions work with arguments that have side effects
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-14 23:39:57 +01:00
Felix Fietkau
682e909819
utils.h: make 16-bit little endian conversion robust against pointer subtraction arguments
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-14 22:02:56 +01:00
Felix Fietkau
6eafe8e5fc
utils: add little-endian swap helpers
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-13 12:35:19 +01:00
Felix Fietkau
ed30207be0
utils: prefer using gccs builtin swapping functions which support constant folding
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-11 22:08:07 +01:00
Felix Fietkau
a61bc26a34
utils: move endian swap helpers and __packed definition to utils.h
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-11 21:46:41 +01:00
Felix Fietkau
1bfb299cbd
blobmsg: add blobmsg_realloc_string_buffer()
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-10 20:43:51 +01:00
Felix Fietkau
27d3551150
blob: add blob_buf_grow()
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-10 20:43:33 +01:00
Felix Fietkau
0585f91c4e
blobmsg_json: fix buffer growing on blobmsg json formatting
2013-01-29 23:07:10 +01:00
Felix Fietkau
412b300935
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>
2013-01-23 02:41:20 +01:00
Felix Fietkau
a5794deb7c
blobmsg: add blobmsg_get_string
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 15:29:14 +01:00
Felix Fietkau
42df438866
list_compat.h: add copyright info
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:49:16 +01:00
Felix Fietkau
1cd37b0860
blobmsg: fix blobmsg_parse_array, drop name field requirement
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:07:32 +01:00
Felix Fietkau
a0562bff3c
blobmsg: allow BLOBMSG_TYPE_UNSPEC attributes, treat them as null for JSON conversion
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:02:51 +01:00
Felix Fietkau
c395304fe5
blobmsg: add blobmsg_parse_array()
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-08 02:05:03 +01:00
Felix Fietkau
bfdf3923c5
uloop: add a clock_gettime() implementation for mac os x
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-06 02:42:58 +01:00
Felix Fietkau
c247bd6c53
blobmsg_json: export blobmsg_add_object
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-06 02:15:48 +01:00
Felix Fietkau
d675f84c1b
utils: add BUILD_BUG_ON (similar to the one in the linux kernel)
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-01 16:10:44 +01:00
Felix Fietkau
1c52d2b0f3
utils: make it unnecessary to specify the last NULL argument for calloc_a
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-31 15:40:12 +01:00
Felix Fietkau
ead6099e0e
utils: move ARRAY_SIZE from uloop to utils.h
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-31 15:24:27 +01:00
Felix Fietkau
b36b07bdd5
add utils.c, containing a calloc-like function to allocate multiple chunks with different sizes in one block and return pointers
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-31 15:24:26 +01:00
Felix Fietkau
0c408bb982
blob.h: fix endian check
...
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-02 17:49:12 +01:00
Felix Fietkau
6cba6caa29
add a cmake file for the examples and add the binaries to .gitignore
2012-10-21 23:01:30 +02:00
Felix Fietkau
9b0460ab9c
blobmsg: remove the unnecessary name argument from blobmsg_check_attr_list, infer it from the list type
2012-06-24 21:11:06 +02:00
Felix Fietkau
d3edff8434
blobmsg: add blobmsg_check_attr_list() to validate element types of arrays and tables
2012-06-24 21:07:47 +02:00
Felix Fietkau
7099131386
blob: add blob_memdup()
2012-06-01 20:54:20 +02:00
Felix Fietkau
53a8ac24dc
remove uapi.h, afacis nothing uses it
2012-05-26 18:04:34 +02:00
Felix Fietkau
6ae097aef9
switch blobmsg_json over to permissive license
2012-05-26 18:03:08 +02:00
Felix Fietkau
286a94910d
switch blobmsg over to permissive license
2012-05-26 18:02:30 +02:00
Felix Fietkau
1ef5e5b618
add blobmsg_add_blob() to copy over an existing blobmsg attribute
2012-05-08 15:59:19 +02:00
Felix Fietkau
f86133b987
blobmsg: add missing endian conversions
2011-11-17 00:47:54 +01:00
Felix Fietkau
b9a4fefcd4
blobmsg_json: print int16 elements in blobmsg_format_element (patch by Luka Perkov)
2011-11-17 00:40:37 +01:00
Felix Fietkau
1c0c4699bc
blob: switch to ISC license, switch blob_{get,put}_int* to _u*, add wrappers
2011-11-10 09:05:33 +01:00
Felix Fietkau
811d3e3c05
make casts from void * explicit to avoid C++ warnings (patch by Arthur Davis)
2011-10-27 10:16:56 +02:00