Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-16utils.h: add fallthrough macroFelix Fietkau
This can be used to silence clang warnings about unannotated fall-through Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-13utils: introduce mkdir_pDaniel Golle
Add new utility function mkdir_p(char *path, mode_t mode) to replace the partially buggy implementations found accross fstools and procd. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2018-06-07utils: add const_* byteswapping functionsFelix Fietkau
Some gcc versions have issues with the __builtin_choose_expr construct which attempts to automatically use the const versions of those functions. Make it possible to explicitly use const_* versions to avoid that. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-04-12utils: fix build error with g++Felix Fietkau
g++ does not support __builtin_choose_expr, so we can't support byte swapping as constant expression there. Reported-by: Cleynhens Stijn <Stijn.Cleynhens@technicolor.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-04-07switch from typeof to the more portable __typeof__Felix Fietkau
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-04-07utils: ensure that byte-order conversion functions evaluate the argument ↵Felix Fietkau
only once Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-03-21utils: use constant byte-order conversionFelix Fietkau
Simplifies portability and ensures that cpu_to_* can be used in const declarations. If the architecture has special instructions, the compiler should be able to detect the pattern and use them. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-09-29utils: nuke bitfield functions and macrosStijn Tintel
The bitfield functions and macros were committed without explaining their purpose in the commit message. As they are only used in uci, and conflict with similar functions added in hostapd, breaking our hostapd ubus patch, nuke them from libubox and add them in uci instead. If we need them anywhere else in the future we can add it to libubox again, but preferably prefixed with ubox_. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-01-20utils: fix build on Mac OS X 10.12Felix Fietkau
clock_gettime and CLOCK_MONOTONIC are supported now Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-12-29utils: add helper functions useful for allocating a ring bufferFelix Fietkau
This creates a mapping with twice the size of the allocated memory. The second half of that mapping points at the same memory as the first half. This is useful for ring buffers, because any read starting in the first half can overflow into the second half as long as the read size is smaller than the size of the memory area. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2015-05-08add a base64 implementation (based on FreeBSD code)Felix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2015-01-21utils: use clock_get_time() for clock_gettime() on Apple.Yousong Zhou
It turns out that mach_absolute_time() is not monotonic at all. While at it, convert the CLOCK_REALTIME implementation to using clock_get_time() as well. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2014-04-30utils: add a bitfield size macroFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-03-18utils: add __constructor and __hidden definesFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-10-24utils.h: fix name collisions in __u_bswap16 with using "val" both inside the ↵Felix Fietkau
macro and as argument Reported-by: Markus Stenberg <markus.stenberg@iki.fi> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-06-10utils: add bitfield inline opsFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-15utils: make le16 endian conversion functions work with arguments that have ↵Felix Fietkau
side effects Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-15utils.h: make 16-bit little endian conversion robust against pointer ↵Felix Fietkau
subtraction arguments Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-13utils: add little-endian swap helpersFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-12utils: prefer using gccs builtin swapping functions which support constant ↵Felix Fietkau
folding Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-02-12utils: move endian swap helpers and __packed definition to utils.hFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-06uloop: add a clock_gettime() implementation for mac os xFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-01utils: add BUILD_BUG_ON (similar to the one in the linux kernel)Felix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-31utils: make it unnecessary to specify the last NULL argument for calloc_aFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-31utils: move ARRAY_SIZE from uloop to utils.hFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2012-12-31add utils.c, containing a calloc-like function to allocate multiple chunks ↵Felix Fietkau
with different sizes in one block and return pointers Signed-off-by: Felix Fietkau <nbd@openwrt.org>