Commit graph

514 commits

Author SHA1 Message Date
Felix Fietkau
e386259632 libubox: make uloop_fd::flags generic
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-06-18 12:05:09 +02:00
Felix Fietkau
cd5238b500 uloop: fix edge trigger handling on mac os x
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-06-18 11:02:20 +02:00
Felix Fietkau
ae40b66130 uloop: rework event processing, fix use-after-free issues
Recursive calls to uloop_run() need to process already fetched events
first, before running kqueue/epoll to get more.

The state of cur_fd/cur_nfds and the event list needs to be maintained
properly to prevent accidental running of events pointing at deleted
uloop_fd structs.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-06-11 12:55:21 +02:00
Felix Fietkau
e5032709b2 utils: add bitfield inline ops
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-06-10 13:37:14 +02:00
Felix Fietkau
2851ce7edb ustream: only report stream eof once via state_change callback
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-05-31 11:18:26 +02:00
Felix Fietkau
70e7c09bcb ustream: only report a write error once via state_change callback
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-05-31 11:17:02 +02:00
Felix Fietkau
54a0b49326 blobmsg_json: add blobmsg_add_json_from_file
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-05-29 12:14:48 +02:00
Felix Fietkau
c4b79e4b54 runqueue: move completion handler from runqueue_process to runqueue_task to make it more generic
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-05-09 01:27:45 +02:00
Felix Fietkau
92fdad5448 runqueue: fix include path
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-05-09 01:15:05 +02:00
Felix Fietkau
cb6c1718e7 runqueue: add a simple task queueing/completion tracking implementation
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-05-09 01:10:00 +02:00
Felix Fietkau
3ceb819690 ustream-example: fix container_of type errors
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-05-09 01:06:55 +02:00
Helmut Schaa
ecee1a3bea libubox: Allow to build against libjson-c > 0.9
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
2013-05-07 15:53:36 +02:00
Felix Fietkau
dcf93f3322 safe_list: add safe_list_empty()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-04-15 15:53:57 +02:00
Felix Fietkau
ee3e7a6f9f safe_list: fix typo
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-04-15 15:39:09 +02:00
Felix Fietkau
009b4d574e list.h: implement type safety for container_of()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-18 05:55:00 +01:00
Felix Fietkau
cdb9f71971 avl: fix type handling in container_of uses
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-18 05:53:44 +01:00
Felix Fietkau
7c11f6e913 safe_list: add a new linked list variant
Use this linked list implementation as a replacement for list.h if you
want to allow deleting arbitrary list entries from within one or more
recursive iterator calling context

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-18 05:47:53 +01:00
Felix Fietkau
00a833c5b6 jshn: add support for the double datatype
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-17 00:50:03 +01:00
Thomas Gstädtner
49e6e062b8 add pkgconfig support for json-c
this includes a fallback for legacy support
2013-03-05 10:44:48 +01:00
Felix Fietkau
b2010c706c json_script: do not rely on global includes for other libubox header files
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-02 16:21:11 +01:00
Felix Fietkau
38ea521911 add json_script, a minimalistic JSON based script interpreter
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-28 21:50:55 +01:00
Felix Fietkau
af2f52a37b 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
bd47d85d38 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
fcd5ba8fbd 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
d01922625d utils: add little-endian swap helpers
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-13 12:35:19 +01:00
Felix Fietkau
e5a40544ec 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
5ad190fccf 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
4ab499899c blobmsg: add blobmsg_realloc_string_buffer()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-10 20:43:51 +01:00
Felix Fietkau
b786f85267 blob: add blob_buf_grow()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-10 20:43:33 +01:00
Felix Fietkau
9a3519536b blobmsg_json: prefer to link against libjson-c over libjson (the new library name in git versions of json-c)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-10 15:32:45 +01:00
Felix Fietkau
95fde87029 ustream: another fix for ustream_read_buf_full() with split read buffers
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-31 18:10:52 +01:00
Felix Fietkau
f83b6548c7 ustream-fd: do not loop back into the callback from ustream_fd_set_uloop
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-31 17:08:40 +01:00
Felix Fietkau
bc6a230b50 ustream: set the right EOF flag
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-31 17:02:49 +01:00
Felix Fietkau
766ff98050 uloop: remove file descriptors if neither read nor write notification is requested
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-31 16:43:08 +01:00
Felix Fietkau
f24b6294c2 ustream-fd: only use read() == 0 as eof indication, and issue a state change notification when that happens
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-30 17:48:55 +01:00
Felix Fietkau
e72b65c899 ustream: fix ustream_read_buf_full() for multiple read buffers
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-30 16:52:32 +01:00
Felix Fietkau
0bc317aa4d blobmsg_json: fix buffer growing on blobmsg json formatting 2013-01-29 23:07:10 +01:00
Jo-Philipp Wich
8b0d933154 uloop: rename uloop_timeout_pending() to uloop_timeout_remaining() 2013-01-23 19:33:12 +01:00
Jo-Philipp Wich
77984bd24d uloop: add uloop_timeout_pending() function to determine the remaining time of an active timeout 2013-01-23 19:32:45 +01:00
Felix Fietkau
e009fd8c82 build: remove install prefix override
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-23 15:22:29 +01:00
Felix Fietkau
8a89e7f388 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
f15ceb8ced ustream-fd: retry partial writes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-22 10:09:55 +01:00
Luka Perkov
220958b7d9 rename internal variables in json_get_type
Signed-off-by: Luka Perkov <luka@openwrt.org>
2013-01-17 13:34:55 +01:00
Felix Fietkau
c360ec576c blobmsg: add blobmsg_get_string
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 15:29:14 +01:00
Felix Fietkau
f5245f9887 add license headers for usock
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 15:27:38 +01:00
Felix Fietkau
432b93f633 list_compat.h: add copyright info
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:49:16 +01:00
Felix Fietkau
569bc29c5a uloop: replace copyright info (code has been completely rewritten over time), relicense to ISC
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:47:51 +01:00
Felix Fietkau
0ab17bcb3a jshn: add copyright info
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13 09:45:59 +01:00
Felix Fietkau
1ec5b85848 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
4b5f278195 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