From 8c76958b84e24e995d4ea16613bf525ca84727a1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 18 Aug 2024 09:41:45 +0200 Subject: Add @since for definitions added in version 1.0 and 1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libsimple-arg.h | 38 ++++++++++++++++++- libsimple.h | 6 +++ libsimple/aligned_alloc.h | 16 ++++++++ libsimple/aligned_allocz.h | 18 +++++++++ libsimple/aligned_memdup.h | 8 ++++ libsimple/array.h | 27 +++++++++++++ libsimple/calloc.h | 16 ++++++++ libsimple/definitions.h | 28 +++++++++++++- libsimple/env.h | 16 ++++++++ libsimple/malloc.h | 16 ++++++++ libsimple/mallocz.h | 18 +++++++++ libsimple/mem.h | 92 +++++++++++++++++++++++++++++++++++++++++++++ libsimple/memalign.h | 18 +++++++++ libsimple/memalignz.h | 18 +++++++++ libsimple/memalloc.h | 20 ++++++++++ libsimple/memdup.h | 8 ++++ libsimple/memelem.h | 34 +++++++++++++++++ libsimple/overflow.h | 64 +++++++++++++++++++++++++++++++ libsimple/posix_memalign.h | 16 ++++++++ libsimple/posix_memalignz.h | 18 +++++++++ libsimple/printf.h | 26 +++++++++++++ libsimple/pvalloc.h | 18 +++++++++ libsimple/pvallocz.h | 18 +++++++++ libsimple/realloc.h | 16 ++++++++ libsimple/str.h | 84 +++++++++++++++++++++++++++++++++++++++++ libsimple/strdup.h | 6 +++ libsimple/strn.h | 86 ++++++++++++++++++++++++++++++++++++++++++ libsimple/strndup.h | 6 +++ libsimple/time.h | 38 +++++++++++++++++++ libsimple/valloc.h | 18 +++++++++ libsimple/vallocz.h | 18 +++++++++ 31 files changed, 826 insertions(+), 3 deletions(-) diff --git a/libsimple-arg.h b/libsimple-arg.h index 1f4291c..25d4c72 100644 --- a/libsimple-arg.h +++ b/libsimple-arg.h @@ -10,6 +10,8 @@ /** * The zeroth command line argument, the name of the process, * set by the command line parsing macros + * + * @since 1.0 */ extern char *argv0; @@ -23,6 +25,8 @@ extern char *argv0; * where `.long_flag` does not end with '=' and * `.with_arg` is zero. These *cannot* have the same * `.short_flag` + * + * @since 1.0 */ struct longopt { /** @@ -83,6 +87,8 @@ struct longopt { * // print usage information for other flags * usage(); * } ARGEND; + * + * @since 1.0 */ #define ARGBEGIN ARGBEGIN2(1, 0) @@ -91,6 +97,8 @@ struct longopt { * `ARGBEGIN {} ARGEND;`, however, `argv0` * is not set to `argv[0]`, instead `argv[0]` * is handled like any other element in `argv` + * + * @since 1.0 */ #define SUBARGBEGIN ARGBEGIN2(0, 0) @@ -102,6 +110,8 @@ struct longopt { * @param KEEP_DASHDASH If and only if 0, "--" is not removed * `argv` before parsing is stopped when it * is encountered + * + * @since 1.1 */ #define ARGBEGIN2(WITH_ARGV0, KEEP_DASHDASH)\ do {\ @@ -146,6 +156,8 @@ struct longopt { * * @param LONGOPTS:struct longopt * The options, list shall end * with `NULL` as `.long_flag` + * + * @since 1.0 */ #define ARGMAPLONG(LONGOPTS)\ for (i_ = 0; (LONGOPTS)[i_].long_flag; i_++) {\ @@ -180,6 +192,8 @@ struct longopt { * } ARGEND; * * @param SYMBOL:char The symbol flags should begin with + * + * @since 1.0 */ #define ARGALT(SYMBOL)\ }\ @@ -204,7 +218,9 @@ struct longopt { switch (flag_) { /** - * Refer to `ARGBEGIN`, `SUBARGBEGIN`, and `ARGBEGIN4` + * Refer to `ARGBEGIN`, `SUBARGBEGIN`, and `ARGBEGIN2` + * + * @since 1.0 */ #define ARGEND\ }\ @@ -225,6 +241,8 @@ struct longopt { /** * `case ARGNUM` creates a switch statement case for each digit + * + * @since 1.0 */ #define ARGNUM '0': case '1': case '2': case '3': case '4':\ case '5': case '6': case '7': case '8': case '9' @@ -234,6 +252,8 @@ struct longopt { * 'a' is returned * * @return :char The option's identifying character + * + * @since 1.0 */ #define FLAG() (flag_) @@ -245,6 +265,8 @@ struct longopt { * value can also be in the next argument * * @return :char * The current command line argument + * + * @since 1.0 */ #define LFLAG() (lflag_) @@ -257,6 +279,8 @@ struct longopt { * that the option has a value * * @return :char * The option's value, never `NULL` + * + * @since 1.0 */ #define ARG() (arg_ ? (brk_ = 1, arg_) : (usage(), NULL)) @@ -273,6 +297,8 @@ struct longopt { * * @return :char * The option's value, `NULL` if * the option does not have a value + * + * @since 1.1 */ #define ARGNULL() (arg_ ? (brk_ = 1, arg_) : NULL) @@ -308,6 +334,8 @@ struct longopt { * * @return :char * The option's value include the flag * character, never `NULL` or "" + * + * @since 1.0 */ #define ARGHERE() (brk_ = 1, argv[0]) @@ -337,6 +365,8 @@ struct longopt { * must not have side-effects * @param WARG:int Whether the option takes an argument, * should not have side-effects + * + * @since 1.0 */ #define TESTLONG(FLG, WARG)\ ((WARG)\ @@ -368,6 +398,8 @@ struct longopt { * * @param ... If non-zero, the `usage` function * will be called + * + * @since 1.0 */ #define NOFLAGS(...)\ do {\ @@ -394,6 +426,8 @@ struct longopt { * This macro also defines `char *argv0` * * @param SYNOPSIS:const char * Description of the command line argument syntax + * + * @since 1.0 */ #define USAGE(SYNOPSIS)\ NUSAGE(1, SYNOPSIS) @@ -411,6 +445,8 @@ struct longopt { * * @param SYNOPSIS:const char * Description of the command line argument syntax * @parma STATUS:int The exit value for the process + * + * @since 1.0 */ #if defined(__GNUC__) || defined(__clang__) # define NUSAGE(STATUS, SYNOPSIS)\ diff --git a/libsimple.h b/libsimple.h index f2dd4b9..2c68fba 100644 --- a/libsimple.h +++ b/libsimple.h @@ -88,6 +88,8 @@ * be update to -1 if it is non-negative * @return Return value of close(3) (0 on success, * -1 on error), 0 if `*fdp < 0` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline int @@ -112,6 +114,8 @@ libsimple_close(int *__fdp) * @param list:non-void pointer The list * @param i:size_t The index of the item to remove * @param n:size_t Pointer to the number of items in the list, will be updated + * + * @since 1.0 */ #define LIBSIMPLE_UNLIST(LIST, I, NP) libsimple_unlist((LIST), (I), (NP), sizeof(*(LIST))) #ifndef UNLIST @@ -126,6 +130,8 @@ libsimple_close(int *__fdp) * @param i The index of the item to remove * @param n Pointer to the number of items in the list, will be updated * @param width The width, in bytes, of each item in the list + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline void diff --git a/libsimple/aligned_alloc.h b/libsimple/aligned_alloc.h index b2a60f1..fd81053 100644 --- a/libsimple/aligned_alloc.h +++ b/libsimple/aligned_alloc.h @@ -18,6 +18,8 @@ * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __warn_unused_result__))) static inline void *libsimple_valigned_allocn(size_t __alignment, size_t __n, va_list __ap) @@ -37,6 +39,8 @@ static inline void *libsimple_valigned_allocn(size_t __alignment, size_t __n, va * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __warn_unused_result__))) static inline void * @@ -66,6 +70,8 @@ libsimple_aligned_allocn(size_t __alignment, size_t __n, ... /*, (size_t)0 */) * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_enaligned_alloc(int __status, size_t __alignment, size_t __n) @@ -95,6 +101,8 @@ static inline void *libsimple_enaligned_alloc(int __status, size_t __alignment, * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_envaligned_allocn(int __status, size_t __alignment, size_t __n, va_list __ap) @@ -124,6 +132,8 @@ static inline void *libsimple_envaligned_allocn(int __status, size_t __alignment * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -152,6 +162,8 @@ libsimple_enaligned_allocn(int __status, size_t __alignment, size_t __n, ... /*, * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_ealigned_alloc(size_t __alignment, size_t __n) @@ -180,6 +192,8 @@ static inline void *libsimple_ealigned_alloc(size_t __alignment, size_t __n) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evaligned_allocn(size_t __alignment, size_t __n, va_list __ap) @@ -208,6 +222,8 @@ static inline void *libsimple_evaligned_allocn(size_t __alignment, size_t __n, v * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/aligned_allocz.h b/libsimple/aligned_allocz.h index 9380a50..be290d2 100644 --- a/libsimple/aligned_allocz.h +++ b/libsimple/aligned_allocz.h @@ -19,6 +19,8 @@ * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__))) void *libsimple_valigned_alloczn(int, size_t, size_t, va_list); @@ -39,6 +41,8 @@ void *libsimple_valigned_alloczn(int, size_t, size_t, va_list); * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __alloc_size__(3), __warn_unused_result__))) static inline void * @@ -72,6 +76,8 @@ libsimple_aligned_allocz(int __clear, size_t __alignment, size_t __n) * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__))) static inline void * @@ -102,6 +108,8 @@ libsimple_aligned_alloczn(int __clear, size_t __alignment, size_t __n, ... /*, ( * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __alloc_size__(4), __warn_unused_result__, __returns_nonnull__))) void *libsimple_enaligned_allocz(int, int, size_t, size_t); @@ -131,6 +139,8 @@ void *libsimple_enaligned_allocz(int, int, size_t, size_t); * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __warn_unused_result__, __returns_nonnull__))) void *libsimple_envaligned_alloczn(int, int, size_t, size_t, va_list); @@ -160,6 +170,8 @@ void *libsimple_envaligned_alloczn(int, int, size_t, size_t, va_list); * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -188,6 +200,8 @@ libsimple_enaligned_alloczn(int __status, int __clear, size_t __alignment, size_ * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_ealigned_allocz(int __clear, size_t __alignment, size_t __n) @@ -217,6 +231,8 @@ static inline void *libsimple_ealigned_allocz(int __clear, size_t __alignment, s * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evaligned_alloczn(int __clear, size_t __alignment, size_t __n, va_list __ap) @@ -246,6 +262,8 @@ static inline void *libsimple_evaligned_alloczn(int __clear, size_t __alignment, * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/aligned_memdup.h b/libsimple/aligned_memdup.h index d2fa91f..b0650a7 100644 --- a/libsimple/aligned_memdup.h +++ b/libsimple/aligned_memdup.h @@ -8,6 +8,8 @@ * @param alignment:size_t The alignment of the returned pointer * @param n:size_t The number of bytes to copy * @return :void * Duplicate of `s` with automatic storage + * + * @since 1.1 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_aligned_memdupa(s, alignment, n)\ @@ -37,6 +39,8 @@ * @param alignment The alignment of the returned pointer * @param n The number of bytes to copy * @return Duplicate of `s`, `NULL` on failure + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __alloc_size__(3), __nonnull__, __warn_unused_result__))) void *libsimple_aligned_memdup(const void *, size_t, size_t); @@ -53,6 +57,8 @@ void *libsimple_aligned_memdup(const void *, size_t, size_t); * @param alignment The alignment of the returned pointer * @param n The number of bytes to copy * @return Duplicate of `s` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(3), __alloc_size__(4), __warn_unused_result__, __returns_nonnull__))) void *libsimple_enaligned_memdup(int, const void *, size_t, size_t); @@ -68,6 +74,8 @@ void *libsimple_enaligned_memdup(int, const void *, size_t, size_t); * @param alignment The alignment of the returned pointer * @param n The number of bytes to copy * @return Duplicate of `s` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_ealigned_memdup(const void *__s, size_t __alignment, size_t __n) diff --git a/libsimple/array.h b/libsimple/array.h index 3e8eab1..2eea727 100644 --- a/libsimple/array.h +++ b/libsimple/array.h @@ -3,162 +3,189 @@ /* TODO test, doc, man */ +/* @since 1.1 */ #define libsimple_arraydupa(array, alignment, n) libsimple_aligned_memdupa(array, _Alignof(*(array)), n) #ifndef aligned_arraydupa # define aligned_arraydupa(...) libsimple_aligned_arraydupa(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arraydup(array, n) libsimple_aligned_memdup(array, _Alignof(*(array)), n) #ifndef arraydup # define arraydup(...) libsimple_arraydup(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_earraydup(array, n) libsimple_ealigned_memdup(array, _Alignof(*(array)), n) #ifndef earraydup # define earraydup(...) libsimple_earraydup(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_enarraydup(status, array, n) libsimple_enaligned_memdup(status, array, _Alignof(*(array)), n) #ifndef enarraydup # define enarraydup(...) libsimple_enarraydup(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_aligned_arraydupa(array, alignment, n) libsimple_aligned_memdupa(array, alignment, n) #ifndef aligned_arraydupa # define aligned_arraydupa(...) libsimple_aligned_arraydupa(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_aligned_arraydup(array, alignment, n) libsimple_aligned_memdup(array, alignment, n) #ifndef aligned_arraydup # define aligned_arraydup(...) libsimple_aligned_arraydup(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_ealigned_arraydup(array, alignment, n) libsimple_ealigned_memdup(array, alignment, n) #ifndef ealigned_arraydup # define ealigned_arraydup(...) libsimple_ealigned_arraydup(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_enaligned_arraydup(status, array, alignment, n) libsimple_enaligned_memdup(status, array, alignment, n) #ifndef enaligned_arraydup # define enaligned_arraydup(...) libsimple_enaligned_arraydup(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arrayelem(haystack, needle, n) libsimple_memelem(haystack, needle, sizeof *(haystack), n) #ifndef arrayelem # define arrayelem(...) libsimple_arrayelem(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_rawarrayelem(haystack, needle, n) libsimple_rawmemelem(haystack, needle, sizeof *(haystack), n) #ifndef rawarrayelem # define rawarrayelem(...) libsimple_rawarrayelem(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arrayscan(haystack, needle, n) libsimple_memelemscan(haystack, needle, sizeof *(haystack), n) #ifndef arrayscan # define arrayscan(...) libsimple_arrayscan(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arrayrelem(haystack, needle, n) libsimple_memrelem(haystack, needle, sizeof *(haystack), n) #ifndef arrayrelem # define arrayrelem(...) libsimple_arrayrelem(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_rawarrayrelem(haystack, needle, n) libsimple_rawmemrelem(haystack, needle, sizeof *(haystack), n) #ifndef rawarrayrelem # define rawarrayrelem(...) libsimple_rawarrayrelem(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arrayelem_inv(haystack, needle, n) libsimple_memelem_inv(haystack, needle, sizeof *(haystack), n) #ifndef arrayelem_inv # define arrayelem_inv(...) libsimple_arrayelem_inv(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_rawarrayelem_inv(haystack, needle, n) libsimple_rawmemelem_inv(haystack, needle, sizeof *(haystack), n) #ifndef rawarrayelem_inv # define rawarrayelem_inv(...) libsimple_rawarrayelem_inv(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arrayscan_inv(haystack, needle, n) libsimple_memelemscan_inv(haystack, needle, sizeof *(haystack), n) #ifndef arrayscan_inv # define arrayscan_inv(...) libsimple_arrayscan_inv(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arrayrelem_inv(haystack, needle, n) libsimple_memrelem_inv(haystack, needle, sizeof *(haystack), n) #ifndef arrayrelem_inv # define arrayrelem_inv(...) libsimple_arrayrelem_inv(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_rawarrayrelem_inv(haystack, needle, n) libsimple_rawmemrelem_inv(haystack, needle, sizeof *(haystack), n) #ifndef rawarrayrelem_inv # define rawarrayrelem_inv(...) libsimple_rawarrayrelem_inv(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arrayset(buf, item, n) libsimple_memsetelem(buf, item, (n) * sizeof *(buf)) #ifndef arrayset # define arrayset(...) libsimple_arrayset(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arraypset(buf, item, n) libsimple_mempsetelem(buf, item, (n) * sizeof *(buf)) #ifndef arraypset # define arraypset(...) libsimple_arraypset(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arraycpy(d, s, n) libsimple_memcpy(d, s, (n) * sizeof *(s)) #ifndef arraycpy # define arraycpy(...) libsimple_arraycpy(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arraymove(d, s, n) libsimple_memmove(d, s, (n) * sizeof *(s)) #ifndef arraymove # define arraymove(...) libsimple_arraymove(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arrayelemcpy(d, s, elem, n) libsimple_memelemcpy(d, s, elem, sizeof *(s), n) #ifndef arrayelemcpy # define arrayelemcpy(...) libsimple_arrayelemcpy(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arrayelemmove(d, s, elem, n) libsimple_memelemmove(d, s, elem, sizeof *(s), n) #ifndef arrayelemmove # define arrayelemmove(...) libsimple_arrayelemmove(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_rawarrayelemcpy(d, s, elem) libsimple_rawmemelemcpy(d, s, elem, sizeof *(s)) #ifndef rawarrayelemcpy # define rawarrayelemcpy(...) libsimple_rawarrayelemcpy(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_rawarrayelemmove(d, s, elem) libsimple_rawmemelemmove(d, s, elem, sizeof *(s)) #ifndef rawarrayelemmove # define rawarrayelemmove(...) libsimple_rawarrayelemmove(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arrayreplace(s, old, new, n) libsimple_memreplaceelem(s, old, new, sizeof *(s), n) #ifndef arrayreplace # define arrayreplace(...) libsimple_arrayreplace(__VA_ARGS__) diff --git a/libsimple/calloc.h b/libsimple/calloc.h index 7b373e9..2f1bcc6 100644 --- a/libsimple/calloc.h +++ b/libsimple/calloc.h @@ -17,6 +17,8 @@ * `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void *libsimple_vcallocn(size_t __n, va_list __ap) @@ -42,6 +44,8 @@ static inline void *libsimple_vcallocn(size_t __n, va_list __ap) * `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * @@ -72,6 +76,8 @@ libsimple_callocn(size_t __n, ... /*, (size_t)0 */) * this function is unspecified for the value 0 * @return A unique pointer with at least the size `n * m` * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(2, 3), __warn_unused_result__, __returns_nonnull__))) void *libsimple_encalloc(int, size_t, size_t); @@ -98,6 +104,8 @@ void *libsimple_encalloc(int, size_t, size_t); * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_envcallocn(int __status, size_t __n, va_list __ap) @@ -125,6 +133,8 @@ static inline void *libsimple_envcallocn(int __status, size_t __n, va_list __ap) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -154,6 +164,8 @@ libsimple_encallocn(int __status, size_t __n, ... /*, (size_t)0 */) * this function is unspecified for the value 0 * @return A unique pointer with at least the size `n * m` * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(1, 2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_ecalloc(size_t __n, size_t __m) @@ -180,6 +192,8 @@ static inline void *libsimple_ecalloc(size_t __n, size_t __m) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evcallocn(size_t __n, va_list __ap) @@ -206,6 +220,8 @@ static inline void *libsimple_evcallocn(size_t __n, va_list __ap) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/definitions.h b/libsimple/definitions.h index 67825f5..6fbc17f 100644 --- a/libsimple/definitions.h +++ b/libsimple/definitions.h @@ -112,6 +112,8 @@ /** * Defined if two's complement is used * for signed number representation + * + * @since 1.1 */ # ifndef TWOS_COMPLEMENT # define TWOS_COMPLEMENT @@ -120,6 +122,8 @@ /** * Defined if sign–magnitude is used * for signed number representation + * + * @since 1.1 */ # ifndef SIGN_MAGNITUDE # define SIGN_MAGNITUDE @@ -128,6 +132,8 @@ /** * Defined if ones' complement is used * for signed number representation + * + * @since 1.1 */ # ifndef ONES_COMPLEMENT # define ONES_COMPLEMENT @@ -141,6 +147,8 @@ * @param A One of the values * @param B The other value * @return The smallest of `A` and `B` + * + * @since 1.0 */ #ifndef MIN # define MIN(A, B) ((A) < (B) ? (A) : (B)) @@ -153,6 +161,8 @@ * @param A One of the values * @param B The other value * @return The largest of `A` and `B` + * + * @since 1.0 */ #ifndef MAX # define MAX(A, B) ((A) > (B) ? (A) : (B)) @@ -166,6 +176,8 @@ * @param B Another one of the values * @param C The last value * @return The smallest of `A`, `B`, and `C` + * + * @since 1.0 */ #ifndef MIN3 # define MIN3(A, B, C) MIN(MIN((A), (B)), (C)) @@ -179,6 +191,8 @@ * @param B Another one of the values * @param C The last value * @return The largest of `A`, `B`, and `C` + * + * @since 1.0 */ #ifndef MAX3 # define MAX3(A, B, C) MAX(MAX((A), (B)), (C)) @@ -191,6 +205,8 @@ * @param ARR The array, must not be a pointer * @return :size_t The number of elements in `ARR` (constant * expression, unless its size is dynamic) + * + * @since 1.0 */ #ifndef ELEMSOF # define ELEMSOF(ARR) (sizeof(ARR) / (sizeof(*(ARR)))) @@ -204,6 +220,8 @@ * * @param STR:const char [] The string, must be a literal * @return :size_t The value of `strlen(STR)` as a constant expression + * + * @since 1.0 */ #ifndef STRLEN # define STRLEN(STR) (sizeof(STR) - 1) @@ -225,6 +243,8 @@ * value of the type `TYPE` can be converted to without any * superfluous characters (such as explitict '+' or leading zeroes') * (constant expression) + * + * @since 1.0 */ #ifndef INTSTRLEN # define INTSTRLEN(TYPE) ((sizeof(TYPE) == 1 ? 3 : 5 * (sizeof(TYPE) / 2)) + ((TYPE)-1 < 0)) @@ -236,6 +256,8 @@ * * @param TYPE:integer type The type, must be an integer type, may be signed or unsigned * @return :TYPE The largest value that can be stored in `TYPE` (constant expression) + * + * @since 1.0 */ #ifndef TYPE_MAX # define TYPE_MAX(TYPE) ((TYPE)(((1ULL << (8 * sizeof(TYPE) - 1)) - 1) << ((TYPE)-1 > 0) | 1)) @@ -247,13 +269,15 @@ * * @param TYPE:integer type The type, must be an integer type, may be signed or unsigned * @return :TYPE The smallest value that can be stored in `TYPE` (constant expression) + * + * @since 1.0 */ #ifndef TYPE_MIN # define TYPE_MIN(TYPE) ((TYPE)((TYPE)-1 > 0 ? 0 : (TYPE)~0 < (TYPE)-1 ? (TYPE)~0 : (TYPE)(1ULL << (8 * sizeof(TYPE) - 1)))) #endif -/* --- Maximum values --- */ +/* --- Maximum values (since 1.0) --- */ #ifndef BLKCNT64_MAX # define BLKCNT64_MAX TYPE_MAX(blkcnt64_t) @@ -392,7 +416,7 @@ #endif -/* --- Minimum values --- */ +/* --- Minimum values (since 1.0) --- */ #ifndef BLKCNT64_MIN # define BLKCNT64_MIN TYPE_MIN(blkcnt64_t) diff --git a/libsimple/env.h b/libsimple/env.h index dc58276..b8ae988 100644 --- a/libsimple/env.h +++ b/libsimple/env.h @@ -6,6 +6,8 @@ * * @param var The environment variable's name * @return The environment variable's value, `NULL` if empty or not defined + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __warn_unused_result__))) static inline char * @@ -24,6 +26,8 @@ libsimple_getenv_ne(const char *__name) * * @param var The environment variable's name * @return The environment variable's value, "" if empty or not defined + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __warn_unused_result__, __returns_nonnull__))) static inline const char * @@ -49,6 +53,8 @@ libsimple_getenv_e(const char *__name) * @param fmt Format string, see vsprintf(3) * @param ap Format arguments, see vsprintf(3) * @return 0 on success, -1 on failure + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) int libsimple_vputenvf(const char *, va_list); @@ -69,6 +75,8 @@ int libsimple_vputenvf(const char *, va_list); * @param fmt Format string, see vsprintf(3) * @param ... Format arguments, see vsprintf(3) * @return 0 on success, -1 on failure + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __format__(__printf__, 1, 2)))) static inline int @@ -100,6 +108,8 @@ libsimple_putenvf(const char *__fmt, ...) * @param status The exit value for the process in case of failure * @param fmt Format string, see vsprintf(3) * @param ap Format arguments, see vsprintf(3) + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) void libsimple_envputenvf(int, const char *, va_list); @@ -124,6 +134,8 @@ void libsimple_envputenvf(int, const char *, va_list); * @param status The exit value for the process in case of failure * @param fmt Format string, see vsprintf(3) * @param ap Format arguments, see vsprintf(3) + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __format__(__printf__, 2, 3)))) static inline void @@ -154,6 +166,8 @@ libsimple_enputenvf(int __status, const char *__fmt, ...) * * @param fmt Format string, see vsprintf(3) * @param ap Format arguments, see vsprintf(3) + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline void libsimple_evputenvf(const char *__fmt, va_list __ap) @@ -178,6 +192,8 @@ static inline void libsimple_evputenvf(const char *__fmt, va_list __ap) * * @param fmt Format string, see vsprintf(3) * @param ap Format arguments, see vsprintf(3) + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __format__(__printf__, 1, 2)))) static inline void diff --git a/libsimple/malloc.h b/libsimple/malloc.h index b57f81f..4309c6d 100644 --- a/libsimple/malloc.h +++ b/libsimple/malloc.h @@ -17,6 +17,8 @@ * `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void *libsimple_vmallocn(size_t __n, va_list __ap) @@ -42,6 +44,8 @@ static inline void *libsimple_vmallocn(size_t __n, va_list __ap) * `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * @@ -70,6 +74,8 @@ libsimple_mallocn(size_t __n, ... /*, (size_t)0 */) * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) void *libsimple_enmalloc(int, size_t); @@ -96,6 +102,8 @@ void *libsimple_enmalloc(int, size_t); * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_envmallocn(int __status, size_t __n, va_list __ap) @@ -123,6 +131,8 @@ static inline void *libsimple_envmallocn(int __status, size_t __n, va_list __ap) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -150,6 +160,8 @@ libsimple_enmallocn(int __status, size_t __n, ... /*, (size_t)0 */) * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(1), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_emalloc(size_t __n) @@ -176,6 +188,8 @@ static inline void *libsimple_emalloc(size_t __n) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evmallocn(size_t __n, va_list __ap) @@ -202,6 +216,8 @@ static inline void *libsimple_evmallocn(size_t __n, va_list __ap) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/mallocz.h b/libsimple/mallocz.h index 2bbd607..6932915 100644 --- a/libsimple/mallocz.h +++ b/libsimple/mallocz.h @@ -29,6 +29,8 @@ void *libsimple_enmalloc(int, size_t); * `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) void *libsimple_vmalloczn(int, size_t, va_list); @@ -48,6 +50,8 @@ void *libsimple_vmalloczn(int, size_t, va_list); * `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(2), __warn_unused_result__))) static inline void *libsimple_mallocz(int __clear, size_t __n) @@ -74,6 +78,8 @@ static inline void *libsimple_mallocz(int __clear, size_t __n) * `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * @@ -102,6 +108,8 @@ libsimple_malloczn(int __clear, size_t __n, ... /*, (size_t)0 */) * @param n Th number of bytes to allocate * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_enmallocz(int __status, int __clear, size_t __n) @@ -131,6 +139,8 @@ static inline void *libsimple_enmallocz(int __status, int __clear, size_t __n) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) void *libsimple_envmalloczn(int, int, size_t, va_list); @@ -159,6 +169,8 @@ void *libsimple_envmalloczn(int, int, size_t, va_list); * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -186,6 +198,8 @@ libsimple_enmalloczn(int __status, int __clear, size_t __n, ... /*, (size_t)0 */ * @param n Th number of bytes to allocate * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_emallocz(int __clear, size_t __n) @@ -213,6 +227,8 @@ static inline void *libsimple_emallocz(int __clear, size_t __n) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evmalloczn(int __clear, size_t __n, va_list __ap) @@ -240,6 +256,8 @@ static inline void *libsimple_evmalloczn(int __clear, size_t __n, va_list __ap) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with the alignment `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/mem.h b/libsimple/mem.h index f4c01dc..718a99e 100644 --- a/libsimple/mem.h +++ b/libsimple/mem.h @@ -11,6 +11,8 @@ * @return `s` with a minimal offset such that `*r == c`, * where `r` is the returned pointer, `&s[n]` if * no such offset exists within [s, &s[n]) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_memscan(const void *, int, size_t); @@ -29,6 +31,8 @@ void *libsimple_memscan(const void *, int, size_t); * @return `s` with a minimal offset such that `tolower(*r) == tolower(c)`, * where `r` is the returned pointer, `NULL` if * no such offset exists within [s, &s[n]) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memcasechr(const void *, int, size_t); @@ -47,6 +51,8 @@ void *libsimple_memcasechr(const void *, int, size_t); * @return `s` with a minimal offset such that `tolower(*r) == tolower(c)`, * where `r` is the returned pointer, `&s[n]` if * no such offset exists within [s, &s[n]) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_memcasescan(const void *, int, size_t); @@ -68,6 +74,8 @@ void *libsimple_memcasescan(const void *, int, size_t); * @param c The byte value to search for * @return `s` with a miminal offset such that `*r == c`, * where `r` is the returned pointer + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemchr(const void *, int); @@ -89,6 +97,8 @@ void *libsimple_rawmemchr(const void *, int); * @param c The byte value to search for * @return `s` with a miminal offset such that `tolower(*r) == tolower(c)`, * where `r` is the returned pointer + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemcasechr(const void *, int); @@ -107,6 +117,8 @@ void *libsimple_rawmemcasechr(const void *, int); * @return `s` with a maximal offset such that `*r == c`, * where `r` is the returned pointer `NULL` if no * such offset exists within [s, &s[n]) + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memrchr(const void *, int, size_t); @@ -125,6 +137,8 @@ void *libsimple_memrchr(const void *, int, size_t); * @return `s` with a maximal offset such that `tolower(*r) == tolower(c)`, * where `r` is the returned pointer `NULL` if no * such offset exists within [s, &s[n]) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memrcasechr(const void *, int, size_t); @@ -147,6 +161,8 @@ void *libsimple_memrcasechr(const void *, int, size_t); * @param n The number of bytes in the byte array * @return `s` with a maximal offset such that `*r == c`, * where `r` is the returned pointer + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemrchr(const void *, int, size_t); @@ -169,6 +185,8 @@ void *libsimple_rawmemrchr(const void *, int, size_t); * @param n The number of bytes in the byte array * @return `s` with a maximal offset such that `tolower(*r) == tolower(c)`, * where `r` is the returned pointer + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemrcasechr(const void *, int, size_t); @@ -187,6 +205,8 @@ void *libsimple_rawmemrcasechr(const void *, int, size_t); * @return `s` with a minimal offset such that `*r != c`, * where `r` is the returned pointer, `NULL` if * no such offset exists within [s, &s[n]) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memchr_inv(const void *, int, size_t); @@ -205,6 +225,8 @@ void *libsimple_memchr_inv(const void *, int, size_t); * @return `s` with a minimal offset such that `*r != c`, * where `r` is the returned pointer, `&s[n]` if * no such offset exists within [s, &s[n]) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_memscan_inv(const void *, int, size_t); @@ -223,6 +245,8 @@ void *libsimple_memscan_inv(const void *, int, size_t); * @return `s` with a minimal offset such that `tolower(*r) != tolower(c)`, * where `r` is the returned pointer, `NULL` if * no such offset exists within [s, &s[n]) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memcasechr_inv(const void *, int, size_t); @@ -241,6 +265,8 @@ void *libsimple_memcasechr_inv(const void *, int, size_t); * @return `s` with a minimal offset such that `tolower(*r) != tolower(c)`, * where `r` is the returned pointer, `&s[n]` if * no such offset exists within [s, &s[n]) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_memcasescan_inv(const void *, int, size_t); @@ -262,6 +288,8 @@ void *libsimple_memcasescan_inv(const void *, int, size_t); * @param c The byte value to search for * @return `s` with a miminal offset such that `*r != c`, * where `r` is the returned pointer + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemchr_inv(const void *, int); @@ -283,6 +311,8 @@ void *libsimple_rawmemchr_inv(const void *, int); * @param c The byte value to search for * @return `s` with a miminal offset such that `tolower(*r) != tolower(c)`, * where `r` is the returned pointer + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemcasechr_inv(const void *, int); @@ -301,6 +331,8 @@ void *libsimple_rawmemcasechr_inv(const void *, int); * @return `s` with a maximal offset such that `*r != c`, * where `r` is the returned pointer `NULL` if no * such offset exists within [s, &s[n]) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memrchr_inv(const void *, int, size_t); @@ -319,6 +351,8 @@ void *libsimple_memrchr_inv(const void *, int, size_t); * @return `s` with a maximal offset such that `tolower(*r) != tolower(c)`, * where `r` is the returned pointer `NULL` if no * such offset exists within [s, &s[n]) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memrcasechr_inv(const void *, int, size_t); @@ -341,6 +375,8 @@ void *libsimple_memrcasechr_inv(const void *, int, size_t); * @param n The number of bytes in the byte array * @return `s` with a maximal offset such that `*r != c`, * where `r` is the returned pointer + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemrchr_inv(const void *, int, size_t); @@ -363,6 +399,8 @@ void *libsimple_rawmemrchr_inv(const void *, int, size_t); * @param n The number of bytes in the byte array * @return `s` with a maximal offset such that `tolower(*r) != tolower(c)`, * where `r` is the returned pointer + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemrcasechr_inv(const void *, int, size_t); @@ -381,6 +419,8 @@ void *libsimple_rawmemrcasechr_inv(const void *, int, size_t); * @return `haystack` with a minimal offset such that, * `!memcmp(r, needle, nneedle)` where `r` is the * returned pointer, `NULL` if no such offset exists + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memmem(const void *, size_t, const void *, size_t); @@ -399,6 +439,8 @@ void *libsimple_memmem(const void *, size_t, const void *, size_t); * @return `haystack` with a minimal offset such that, * `!memcasecmp(r, needle, nneedle)` where `r` is the * returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memcasemem(const void *, size_t, const void *, size_t); @@ -417,6 +459,8 @@ void *libsimple_memcasemem(const void *, size_t, const void *, size_t); * @return `haystack` with a maximal offset such that, * `!memcmp(r, needle, nneedle)` where `r` is the * returned pointer, `NULL` if no such offset exists + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memrmem(const void *, size_t, const void *, size_t); @@ -435,6 +479,8 @@ void *libsimple_memrmem(const void *, size_t, const void *, size_t); * @return `haystack` with a maximal offset such that, * `!memcasecmp(r, needle, nneedle)` where `r` is the * returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memrcasemem(const void *, size_t, const void *, size_t); @@ -451,6 +497,8 @@ void *libsimple_memrcasemem(const void *, size_t, const void *, size_t); * @param t The desired beginning of `s` * @param m The length of `t` * @return 1 if `s` begins with `t`, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) int libsimple_memstarts(const void *, size_t, const void *, size_t); @@ -467,6 +515,8 @@ int libsimple_memstarts(const void *, size_t, const void *, size_t); * @param t The desired beginning of `s` * @param m The length of `t` * @return 1 if `s` begins with `t`, 0 otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) int libsimple_memcasestarts(const void *, size_t, const void *, size_t); @@ -483,6 +533,8 @@ int libsimple_memcasestarts(const void *, size_t, const void *, size_t); * @param t The desired ending of `s` * @param m The length of `t` * @return 1 if `s` ends with `t`, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) int libsimple_memends(const void *, size_t, const void *, size_t); @@ -499,6 +551,8 @@ int libsimple_memends(const void *, size_t, const void *, size_t); * @param t The desired ending of `s` * @param m The length of `t` * @return 1 if `s` ends with `t`, 0 otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) int libsimple_memcaseends(const void *, size_t, const void *, size_t); @@ -514,6 +568,8 @@ int libsimple_memcaseends(const void *, size_t, const void *, size_t); * @param b The other arrays of bytes * @param n The lengths of the arrays * @return 1 if the arrays are equal, 0 otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) int libsimple_memcasecmp(const void *, const void *, size_t); @@ -529,6 +585,8 @@ int libsimple_memcasecmp(const void *, const void *, size_t); * @param b The other arrays of bytes * @param n The lengths of the arrays * @return 1 if the arrays are equal, 0 otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) static inline int libsimple_memeq(const void *__a, const void *__b, size_t __n) @@ -545,6 +603,8 @@ static inline int libsimple_memeq(const void *__a, const void *__b, size_t __n) * @param b The other arrays of bytes * @param n The lengths of the arrays * @return 1 if the arrays are equal, 0 otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) static inline int libsimple_memcaseeq(const void *__a, const void *__b, size_t __n) @@ -561,6 +621,8 @@ static inline int libsimple_memcaseeq(const void *__a, const void *__b, size_t _ * @param s The array of bytes that should be copied * @param n The number of bytes to copy * @return `&d[n]` + * + * @since 1.0 */ static inline void *libsimple_mempcpy(void *restrict __d, const void *restrict __s, size_t __n) { return &((char *)memcpy(__d, __s, __n))[__n]; } @@ -576,6 +638,8 @@ static inline void *libsimple_mempcpy(void *restrict __d, const void *restrict _ * @param s The bytes that should be moved * @param n The number of bytes to move * @return `&d[n]` + * + * @since 1.1 */ static inline void *libsimple_mempmove(void *__d, const void *__s, size_t __n) { return &((char *)memmove(__d, __s, __n))[__n]; } @@ -591,6 +655,8 @@ static inline void *libsimple_mempmove(void *__d, const void *__s, size_t __n) * @param c The byte to fill the array with * @param n The number of bytes to write to `s` * @return `&s[n]` + * + * @since 1.1 */ static inline void *libsimple_mempset(void *__s, int __c, size_t __n) { return &((char *)memset(__s, __c, __n))[__n]; } @@ -611,6 +677,8 @@ static inline void *libsimple_mempset(void *__s, int __c, size_t __n) * @param s The byte array to copy * @param c The byte that stops the copying * @return `&rawmemchr(d, c)[1]` (after copying) + * + * @since 1.1 */ static inline void * libsimple_rawmemccpy(void *restrict __d_, const void *restrict __s_, int __c_) @@ -635,6 +703,8 @@ libsimple_rawmemccpy(void *restrict __d_, const void *restrict __s_, int __c_) * @return `&rawmemchr(d, c)[1]` (after copying) if `c` can * be found within the first `n` bytes of `s` (before * copying), `NULL` otherwise + * + * @since 1.1 */ void *libsimple_memcmove(void *, const void *, int, size_t); #ifndef memcmove @@ -654,6 +724,8 @@ void *libsimple_memcmove(void *, const void *, int, size_t); * @param s The byte array to copy * @param c The byte that stops the copying * @return `&rawmemchr(d, c)[1]` (after copying) + * + * @since 1.1 */ static inline void * libsimple_rawmemcmove(void *__d_, const void *__s_, int __c_) @@ -688,6 +760,8 @@ libsimple_rawmemcmove(void *__d_, const void *__s_, int __c_) * @param new The value to replace the bytes with * @param n The length of `s` * @return `(void *)&((char *)s)[n]` + * + * @since 1.1 */ static inline void * libsimple_memreplace(void *__s_, int __old_, int __new_, size_t __n) @@ -716,6 +790,8 @@ libsimple_memreplace(void *__s_, int __old_, int __new_, size_t __n) * @param s The byte array to copy * @param n The number of bytes to copy or covert * @return `&d[n]` + * + * @since 1.1 */ void *libsimple_memptolower(void *, const void *, size_t); #ifndef memptolower @@ -735,6 +811,8 @@ void *libsimple_memptolower(void *, const void *, size_t); * @param s The byte array to copy * @param n The number of bytes to copy or covert * @return `&d[n]` + * + * @since 1.1 */ void *libsimple_memptoupper(void *, const void *, size_t); #ifndef memptoupper @@ -754,6 +832,8 @@ void *libsimple_memptoupper(void *, const void *, size_t); * @param s The byte array to copy * @param n The number of bytes to copy or covert * @return `d` + * + * @since 1.1 */ static inline void *libsimple_memtolower(void *__d, const void *__s, size_t __n) { libsimple_memptolower(__d, __s, __n); return __d; } @@ -774,6 +854,8 @@ static inline void *libsimple_memtolower(void *__d, const void *__s, size_t __n) * @param s The byte array to copy * @param n The number of bytes to copy or covert * @return `d` + * + * @since 1.1 */ static inline void *libsimple_memtoupper(void *__d, const void *__s, size_t __n) { libsimple_memptoupper(__d, __s, __n); return __d; } @@ -791,6 +873,8 @@ static inline void *libsimple_memtoupper(void *__d, const void *__s, size_t __n) * @param m The length of `b` * @return The number of bytes `a` and `b` have * in common in their beginnings + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) size_t libsimple_memeqlen(const void *, size_t, const void *, size_t); @@ -808,6 +892,8 @@ size_t libsimple_memeqlen(const void *, size_t, const void *, size_t); * @param m The length of `b` * @return The number of bytes `a` and `b` have * in common in their beginnings + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) size_t libsimple_memcaseeqlen(const void *, size_t, const void *, size_t); @@ -825,6 +911,8 @@ size_t libsimple_memcaseeqlen(const void *, size_t, const void *, size_t); * @param m The length of `b` * @return The number of bytes `a` and `b` have * in common in their ends + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) size_t libsimple_memreqlen(const void *, size_t, const void *, size_t); @@ -842,6 +930,8 @@ size_t libsimple_memreqlen(const void *, size_t, const void *, size_t); * @param m The length of `b` * @return The number of bytes `a` and `b` have * in common in their ends + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) size_t libsimple_memrcaseeqlen(const void *, size_t, const void *, size_t); @@ -858,6 +948,8 @@ size_t libsimple_memrcaseeqlen(const void *, size_t, const void *, size_t); * @param allow_modified_nul Whether Modified UTF-8 is allowed, which * allows a two-byte encoding for NUL * @return 1 if good, 0 on encoding error + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) int libsimple_memisutf8(const char *, size_t, int); diff --git a/libsimple/memalign.h b/libsimple/memalign.h index d533751..20dfebb 100644 --- a/libsimple/memalign.h +++ b/libsimple/memalign.h @@ -18,6 +18,8 @@ * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __warn_unused_result__))) static inline void *libsimple_vmemalignn(size_t __alignment, size_t __n, va_list __ap) @@ -37,6 +39,8 @@ static inline void *libsimple_vmemalignn(size_t __alignment, size_t __n, va_list * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __alloc_size__(2), __warn_unused_result__))) static inline void *libsimple_memalign(size_t __alignment, size_t __n) @@ -63,6 +67,8 @@ static inline void *libsimple_memalign(size_t __alignment, size_t __n) * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __warn_unused_result__))) static inline void * @@ -92,6 +98,8 @@ libsimple_memalignn(size_t __alignment, size_t __n, ... /*, (size_t)0 */) * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_enmemalign(int __status, size_t __alignment, size_t __n) @@ -121,6 +129,8 @@ static inline void *libsimple_enmemalign(int __status, size_t __alignment, size_ * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_envmemalignn(int __status, size_t __alignment, size_t __n, va_list __ap) @@ -150,6 +160,8 @@ static inline void *libsimple_envmemalignn(int __status, size_t __alignment, siz * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -178,6 +190,8 @@ libsimple_enmemalignn(int __status, size_t __alignment, size_t __n, ... /*, (siz * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_ememalign(size_t __alignment, size_t __n) @@ -207,6 +221,8 @@ static inline void *libsimple_ememalign(size_t __alignment, size_t __n) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evmemalignn(size_t __alignment, size_t __n, va_list __ap) @@ -235,6 +251,8 @@ static inline void *libsimple_evmemalignn(size_t __alignment, size_t __n, va_lis * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(1), __warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/memalignz.h b/libsimple/memalignz.h index 7eab805..387e568 100644 --- a/libsimple/memalignz.h +++ b/libsimple/memalignz.h @@ -19,6 +19,8 @@ * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__))) static inline void * @@ -49,6 +51,8 @@ libsimple_vmemalignzn(int __clear, size_t __alignment, size_t __n, va_list __ap) * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __alloc_size__(3), __warn_unused_result__))) static inline void * @@ -86,6 +90,8 @@ libsimple_memalignz(int __clear, size_t __alignment, size_t __n) * and alignment; `NULL` on failure * @throws EINVAL `n` is 0 or `alignment` is not a power of 2 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__))) static inline void * @@ -116,6 +122,8 @@ libsimple_memalignzn(int __clear, size_t __alignment, size_t __n, ... /*, (size_ * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __alloc_size__(4), __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -156,6 +164,8 @@ libsimple_enmemalignz(int __status, int __clear, size_t __alignment, size_t __n) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -197,6 +207,8 @@ libsimple_envmemalignzn(int __status, int __clear, size_t __alignment, size_t __ * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -226,6 +238,8 @@ libsimple_enmemalignzn(int __status, int __clear, size_t __alignment, size_t __n * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_ememalignz(int __clear, size_t __alignment, size_t __n) @@ -255,6 +269,8 @@ static inline void *libsimple_ememalignz(int __clear, size_t __alignment, size_t * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evmemalignzn(int __clear, size_t __alignment, size_t __n, va_list __ap) @@ -284,6 +300,8 @@ static inline void *libsimple_evmemalignzn(int __clear, size_t __alignment, size * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/memalloc.h b/libsimple/memalloc.h index 5b91a64..13ef889 100644 --- a/libsimple/memalloc.h +++ b/libsimple/memalloc.h @@ -1,6 +1,8 @@ /* See LICENSE file for copyright and license details. */ +/* @since 1.1 */ enum libsimple_memalloc_option { + /* @since 1.1 { */ LIBSIMPLE_MEMALLOC_END, LIBSIMPLE_MEMALLOC_ZERO_INIT, LIBSIMPLE_MEMALLOC_CONDITIONAL_ZERO_INIT, @@ -16,9 +18,12 @@ enum libsimple_memalloc_option { LIBSIMPLE_MEMALLOC_VA_PRODUCT_SIZE, LIBSIMPLE_MEMALLOC_1_VA_PRODUCT_SIZE, LIBSIMPLE_MEMALLOC_VA_LIST + /* @since 1.1 } */ }; + /* @since 1.1 */ #define libsimple_arrayalloc_option libsimple_memalloc_option +/* @since 1.1 { */ #define LIBSIMPLE_MEMALLOC_END LIBSIMPLE_MEMALLOC_END #define LIBSIMPLE_MEMALLOC_ZERO_INIT LIBSIMPLE_MEMALLOC_ZERO_INIT #define LIBSIMPLE_MEMALLOC_CONDITIONAL_ZERO_INIT LIBSIMPLE_MEMALLOC_CONDITIONAL_ZERO_INIT @@ -34,7 +39,9 @@ enum libsimple_memalloc_option { #define LIBSIMPLE_MEMALLOC_VA_PRODUCT_SIZE LIBSIMPLE_MEMALLOC_VA_PRODUCT_SIZE #define LIBSIMPLE_MEMALLOC_1_VA_PRODUCT_SIZE LIBSIMPLE_MEMALLOC_1_VA_PRODUCT_SIZE #define LIBSIMPLE_MEMALLOC_VA_LIST LIBSIMPLE_MEMALLOC_VA_LIST +/* @since 1.1 } */ +/* @since 1.1 { */ #define LIBSIMPLE_ARRAYALLOC_END LIBSIMPLE_MEMALLOC_END #define LIBSIMPLE_ARRAYALLOC_ZERO_INIT LIBSIMPLE_MEMALLOC_ZERO_INIT #define LIBSIMPLE_ARRAYALLOC_CONDITIONAL_ZERO_INIT LIBSIMPLE_MEMALLOC_CONDITIONAL_ZERO_INIT @@ -47,47 +54,58 @@ enum libsimple_memalloc_option { #define LIBSIMPLE_ARRAYALLOC_VA_PRODUCT_SIZE LIBSIMPLE_MEMALLOC_VA_PRODUCT_SIZE #define LIBSIMPLE_ARRAYALLOC_1_VA_PRODUCT_SIZE LIBSIMPLE_MEMALLOC_1_VA_PRODUCT_SIZE #define LIBSIMPLE_ARRAYALLOC_VA_LIST LIBSIMPLE_MEMALLOC_VA_LIST +/* @since 1.1 } */ +/* @since 1.1 */ #define libsimple_varrayalloc(TYPE, N, AP)\ libsimple_memalloc(N, LIBSIMPLE_MEMALLOC_ELEMENT_SIZE, sizeof(TYPE),\ LIBSIMPLE_MEMALLOC_ALIGNMENT, _Alignof(TYPE),\ LIBSIMPLE_MEMALLOC_VA_LIST, AP, LIBSIMPLE_MEMALLOC_END) +/* @since 1.1 */ #define libsimple_evarrayalloc(TYPE, N, AP)\ libsimple_ememalloc(N, LIBSIMPLE_MEMALLOC_ELEMENT_SIZE, sizeof(TYPE),\ LIBSIMPLE_MEMALLOC_ALIGNMENT, _Alignof(TYPE),\ LIBSIMPLE_MEMALLOC_VA_LIST, AP, LIBSIMPLE_MEMALLOC_END) +/* @since 1.1 */ #define libsimple_envarrayalloc(STATUS, TYPE, N, AP)\ libsimple_enmemalloc(STATUS, N, LIBSIMPLE_MEMALLOC_ELEMENT_SIZE, sizeof(TYPE),\ LIBSIMPLE_MEMALLOC_ALIGNMENT, _Alignof(TYPE),\ LIBSIMPLE_MEMALLOC_VA_LIST, AP, LIBSIMPLE_MEMALLOC_END) +/* @since 1.1 */ #define libsimple_arrayalloc(TYPE, N, ... /*, LIBSIMPLE_ARRAYALLOC_END */)\ libsimple_memalloc(N, LIBSIMPLE_MEMALLOC_ELEMENT_SIZE, sizeof(TYPE),\ LIBSIMPLE_MEMALLOC_ALIGNMENT, _Alignof(TYPE),\ __VA_ARGS__) +/* @since 1.1 */ #define libsimple_earrayalloc(TYPE, N, ... /*, LIBSIMPLE_ARRAYALLOC_END */)\ libsimple_ememalloc(N, LIBSIMPLE_MEMALLOC_ELEMENT_SIZE, sizeof(TYPE),\ LIBSIMPLE_MEMALLOC_ALIGNMENT, _Alignof(TYPE),\ __VA_ARGS__) +/* @since 1.1 */ #define libsimple_enarrayalloc(STATUS, TYPE, N, ... /*, LIBSIMPLE_ARRAYALLOC_END */)\ libsimple_enmemalloc(STATUS, N, LIBSIMPLE_MEMALLOC_ELEMENT_SIZE, sizeof(TYPE),\ LIBSIMPLE_MEMALLOC_ALIGNMENT, _Alignof(TYPE),\ __VA_ARGS__) +/* @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) void *libsimple_vmemalloc(size_t, va_list); +/* @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) void *libsimple_envmemalloc(int, size_t, va_list); +/* @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void *libsimple_evmemalloc(size_t __n, va_list __ap) { return libsimple_envmemalloc(libsimple_default_failure_exit, __n, __ap); } +/* @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * libsimple_memalloc(size_t __n, ... /*, LIBSIMPLE_MEMALLOC_END */) @@ -98,6 +116,7 @@ libsimple_memalloc(size_t __n, ... /*, LIBSIMPLE_MEMALLOC_END */) va_end(__ap); } +/* @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * libsimple_enmemalloc(int __status, size_t __n, ... /*, LIBSIMPLE_MEMALLOC_END */) @@ -108,6 +127,7 @@ libsimple_enmemalloc(int __status, size_t __n, ... /*, LIBSIMPLE_MEMALLOC_END */ va_end(__ap); } +/* @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * libsimple_ememalloc(size_t __n, ... /*, LIBSIMPLE_MEMALLOC_END */) diff --git a/libsimple/memdup.h b/libsimple/memdup.h index ce84f6b..6125a0d 100644 --- a/libsimple/memdup.h +++ b/libsimple/memdup.h @@ -7,6 +7,8 @@ * @param s:const void * The bytes to copy * @param n:size_t The number of bytes to copy * @return :void * Duplicate of `s` with automatic storage + * + * @since 1.0 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_memdupa(s, n)\ @@ -28,6 +30,8 @@ * @param s The bytes to copy * @param n The number of bytes to copy * @return Duplicate of `s`, `NULL` on failure + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_size__(2), __nonnull__, __warn_unused_result__))) void *libsimple_memdup(const void *, size_t); @@ -43,6 +47,8 @@ void *libsimple_memdup(const void *, size_t); * @param s The bytes to copy * @param n The number of bytes to copy * @return Duplicate of `s` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) void *libsimple_enmemdup(int, const void *, size_t); @@ -57,6 +63,8 @@ void *libsimple_enmemdup(int, const void *, size_t); * @param s The bytes to copy * @param n The number of bytes to copy * @return Duplicate of `s` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_ememdup(const void *__s, size_t __n) diff --git a/libsimple/memelem.h b/libsimple/memelem.h index 29570f6..10aaef1 100644 --- a/libsimple/memelem.h +++ b/libsimple/memelem.h @@ -12,6 +12,8 @@ * `!memcmp(r, needle, width)` where `r` is the returned * pointer and such that `(r - haystack) % width == 0`, * `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memelem(const void *, const void *, size_t, size_t); @@ -34,6 +36,8 @@ void *libsimple_memelem(const void *, const void *, size_t, size_t); * @return `haystack` with a minimal offset such that, * `!memcmp(r, needle, width)` where `r` is the returned * pointer and such that `(r - haystack) % width == 0` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemelem(const void *, const void *, size_t); @@ -54,6 +58,8 @@ void *libsimple_rawmemelem(const void *, const void *, size_t); * pointer and such that `(r - haystack) % width == 0`, * `(void *)&((char *)haystack)[n * width]` if no such * offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memelemscan(const void *, const void *, size_t, size_t); @@ -73,6 +79,8 @@ void *libsimple_memelemscan(const void *, const void *, size_t, size_t); * `!memcmp(r, needle, width)` where `r` is the returned * pointer and such that `(r - haystack) % width == 0`, * `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memrelem(const void *, const void *, size_t, size_t); @@ -96,6 +104,8 @@ void *libsimple_memrelem(const void *, const void *, size_t, size_t); * @return `haystack` with a maximal offset such that, * `!memcmp(r, needle, width)` where `r` is the returned * pointer and such that `(r - haystack) % width == 0` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemrelem(const void *, const void *, size_t, size_t); @@ -116,6 +126,8 @@ void *libsimple_rawmemrelem(const void *, const void *, size_t, size_t); * `memcmp(r, needle, width)` where `r` is the returned * pointer and such that `(r - haystack) % width == 0`, * `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memelem_inv(const void *, const void *, size_t, size_t); @@ -139,6 +151,8 @@ void *libsimple_memelem_inv(const void *, const void *, size_t, size_t); * @return `haystack` with a minimal offset such that, * `memcmp(r, needle, width)` where `r` is the returned * pointer and such that `(r - haystack) % width == 0` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemelem_inv(const void *, const void *, size_t); @@ -160,6 +174,8 @@ void *libsimple_rawmemelem_inv(const void *, const void *, size_t); * pointer and such that `(r - haystack) % width == 0`, * `(void *)&((char *)haystack)[n * width]` if no such * offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memelemscan_inv(const void *, const void *, size_t, size_t); @@ -180,6 +196,8 @@ void *libsimple_memelemscan_inv(const void *, const void *, size_t, size_t); * `memcmp(r, needle, width)` where `r` is the returned * pointer and such that `(r - haystack) % width == 0`, * `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) void *libsimple_memrelem_inv(const void *, const void *, size_t, size_t); @@ -204,6 +222,8 @@ void *libsimple_memrelem_inv(const void *, const void *, size_t, size_t); * @return `haystack` with a maximal offset such that, * `memcmp(r, needle, width)` where `r` is the returned * pointer and such that `(r - haystack) % width == 0` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __returns_nonnull__, __warn_unused_result__))) void *libsimple_rawmemrelem_inv(const void *, const void *, size_t, size_t); @@ -220,6 +240,8 @@ void *libsimple_rawmemrelem_inv(const void *, const void *, size_t, size_t); * @param width The size of `item` * @param n The number of copies to fill `buf` with * @return `&buf[n * width]` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__warn_unused_result__))) void *libsimple_mempsetelem(void *, const void *, size_t, size_t); @@ -236,6 +258,8 @@ void *libsimple_mempsetelem(void *, const void *, size_t, size_t); * @param width The size of `item` * @param n The number of copies to fill `buf` with * @return `buf` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__warn_unused_result__))) static inline void *libsimple_memsetelem(void *__buf, const void *__item, size_t __width, size_t __n) @@ -256,6 +280,8 @@ static inline void *libsimple_memsetelem(void *__buf, const void *__item, size_t * @return `&rawmemelem(d, c, width)[width]` (after copying) if `elem` * can be found within the first `n` elements of `s` (before * copying), `NULL` otherwise + * + * @since 1.1 */ void *libsimple_memelemcpy(void *restrict, const void *restrict, const void *restrict, size_t, size_t); #ifndef memelemcpy @@ -274,6 +300,8 @@ void *libsimple_memelemcpy(void *restrict, const void *restrict, const void *res * @return `&rawmemelem(d, c, width)[width]` (after copying) if `elem` * can be found within the first `n` elements of `s` (before * copying), `NULL` otherwise + * + * @since 1.1 */ void *libsimple_memelemmove(void *, const void *, const void *restrict, size_t, size_t); #ifndef memelemmove @@ -294,6 +322,8 @@ void *libsimple_memelemmove(void *, const void *, const void *restrict, size_t, * @param elem The element that stops the copying * @param width The size of each element * @return `&rawmemelem(d, c, width)[width]` (after copying) + * + * @since 1.1 */ void *libsimple_rawmemelemcpy(void *restrict, const void *restrict, const void *restrict, size_t); #ifndef rawmemelemcpy @@ -314,6 +344,8 @@ void *libsimple_rawmemelemcpy(void *restrict, const void *restrict, const void * * @param elem The element that stops the copying * @param width The size of each element * @return `&rawmemelem(d, c, width)[width]` (after copying) + * + * @since 1.1 */ void *libsimple_rawmemelemmove(void *, const void *, const void *restrict, size_t); #ifndef rawmemelemmove @@ -331,6 +363,8 @@ void *libsimple_rawmemelemmove(void *, const void *, const void *restrict, size_ * @param width The size of each element * @param n The length of `s`, measured in elements * @return `(void *)&((char *)s)[n * width]` + * + * @since 1.1 */ void *libsimple_memreplaceelem(void *restrict, const void *, const void *, size_t, size_t); #ifndef memreplaceelem diff --git a/libsimple/overflow.h b/libsimple/overflow.h index 66ea6fa..a4857a8 100644 --- a/libsimple/overflow.h +++ b/libsimple/overflow.h @@ -149,258 +149,322 @@ #endif +/* @since 1.1 */ #ifndef UADD_WOULD_OVERFLOW # define UADD_WOULD_OVERFLOW(A, B, MAX) LIBSIMPLE_UADD_WOULD_OVERFLOW(A, B, MAX) #endif +/* @since 1.1 */ #ifndef USUB_WOULD_OVERFLOW # define USUB_WOULD_OVERFLOW(A, B) LIBSIMPLE_USUB_WOULD_OVERFLOW(A, B) #endif +/* @since 1.1 */ #ifndef UMUL_WOULD_OVERFLOW # define UMUL_WOULD_OVERFLOW(A, B, MAX) LIBSIMPLE_UMUL_WOULD_OVERFLOW(A, B, MAX) #endif +/* @since 1.1 */ #ifndef UMUL_WOULD_OVERFLOW_NONZERO # define UMUL_WOULD_OVERFLOW_NONZERO(A, B, MAX) LIBSIMPLE_UMUL_WOULD_OVERFLOW_NONZERO(A, B, MAX) #endif +/* @since 1.1 */ #ifndef UINCR_WOULD_OVERFLOW # define UINCR_WOULD_OVERFLOW(A, MAX) LIBSIMPLE_UINCR_WOULD_OVERFLOW(A, MAX) #endif +/* @since 1.1 */ #ifndef UDECR_WOULD_OVERFLOW # define UDECR_WOULD_OVERFLOW(A) LIBSIMPLE_UDECR_WOULD_OVERFLOW(A) #endif +/* @since 1.1 */ #ifndef UADD_OVERFLOW # define UADD_OVERFLOW(A, B, RES, MAX) LIBSIMPLE_UADD_OVERFLOW(A, B, RES, MAX) #endif +/* @since 1.1 */ #ifndef USUB_OVERFLOW # define USUB_OVERFLOW(A, B, RES) LIBSIMPLE_USUB_OVERFLOW(A, B, RES) #endif +/* @since 1.1 */ #ifndef UMUL_OVERFLOW # define UMUL_OVERFLOW(A, B, RES, MAX) LIBSIMPLE_UMUL_OVERFLOW(A, B, RES, MAX) #endif +/* @since 1.1 */ #ifndef UMUL_OVERFLOW_NONZERO # define UMUL_OVERFLOW_NONZERO(A, B, RES, MAX) LIBSIMPLE_UMUL_OVERFLOW_NONZERO(A, B, RES, MAX) #endif +/* @since 1.1 */ #ifndef UINCR_OVERFLOW # define UINCR_OVERFLOW(AP, MAX) LIBSIMPLE_UINCR_OVERFLOW(AP, MAX) #endif +/* @since 1.1 */ #ifndef UDECR_OVERFLOW # define UDECR_OVERFLOW(AP) LIBSIMPLE_UDECR_OVERFLOW(AP) #endif +/* @since 1.1 */ #ifndef SADD_WOULD_OVERFLOW # define SADD_WOULD_OVERFLOW(A, B, MIN, MAX) LIBSIMPLE_SADD_WOULD_OVERFLOW(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SADD_WOULD_OVERFLOW_A_NEG # define SADD_WOULD_OVERFLOW_A_NEG(A, B, MIN, MAX) LIBSIMPLE_SADD_WOULD_OVERFLOW_A_NEG(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SADD_WOULD_OVERFLOW_B_NEG # define SADD_WOULD_OVERFLOW_B_NEG(A, B, MIN, MAX) LIBSIMPLE_SADD_WOULD_OVERFLOW_B_NEG(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SADD_WOULD_OVERFLOW_NONNEG # define SADD_WOULD_OVERFLOW_NONNEG(A, B, MIN, MAX) LIBSIMPLE_SADD_WOULD_OVERFLOW_NONNEG(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SSUB_WOULD_OVERFLOW # define SSUB_WOULD_OVERFLOW(A, B, MIN, MAX) LIBSIMPLE_SSUB_WOULD_OVERFLOW(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SSUB_WOULD_OVERFLOW_B_NEG # define SSUB_WOULD_OVERFLOW_B_NEG(A, B, MIN, MAX) LIBSIMPLE_SSUB_WOULD_OVERFLOW_B_NEG(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SSUB_WOULD_OVERFLOW_B_POS # define SSUB_WOULD_OVERFLOW_B_POS(A, B, MIN, MAX) LIBSIMPLE_SSUB_WOULD_OVERFLOW_B_POS(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW # define SMUL_WOULD_OVERFLOW(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_NONZERO # define SMUL_WOULD_OVERFLOW_NONZERO(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_NONZERO(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_AN # define SMUL_WOULD_OVERFLOW_AN(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_AN(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_AN_BNZ # define SMUL_WOULD_OVERFLOW_AN_BNZ(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_AN_BNZ(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_AN_BN # define SMUL_WOULD_OVERFLOW_AN_BN(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_AN_BN(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_AN_BP # define SMUL_WOULD_OVERFLOW_AN_BP(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_AN_BP(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_AP # define SMUL_WOULD_OVERFLOW_AP(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_AP(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_AP_BNZ # define SMUL_WOULD_OVERFLOW_AP_BNZ(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_AP_BNZ(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_AP_BN # define SMUL_WOULD_OVERFLOW_AP_BN(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_AP_BN(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_AP_BP # define SMUL_WOULD_OVERFLOW_AP_BP(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_AP_BP(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_BN # define SMUL_WOULD_OVERFLOW_BN(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_BN(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_ANZ_BN # define SMUL_WOULD_OVERFLOW_ANZ_BN(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_ANZ_BN(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_BP # define SMUL_WOULD_OVERFLOW_BP(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_BP(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_WOULD_OVERFLOW_ANZ_BP # define SMUL_WOULD_OVERFLOW_ANZ_BP(A, B, MIN, MAX) LIBSIMPLE_SMUL_WOULD_OVERFLOW_ANZ_BP(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SDIV_WOULD_OVERFLOW # define SDIV_WOULD_OVERFLOW(A, B, MIN, MAX) LIBSIMPLE_SDIV_WOULD_OVERFLOW(A, B, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SINCR_WOULD_OVERFLOW # define SINCR_WOULD_OVERFLOW(A, MAX) LIBSIMPLE_SINCR_WOULD_OVERFLOW(A, MAX) #endif +/* @since 1.1 */ #ifndef SDECR_WOULD_OVERFLOW # define SDECR_WOULD_OVERFLOW(A, MIN) LIBSIMPLE_SDECR_WOULD_OVERFLOW(A, MIN) #endif +/* @since 1.1 */ #ifndef SADD_OVERFLOW # define SADD_OVERFLOW(A, B, RES, MIN, MAX) LIBSIMPLE_SADD_OVERFLOW(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SADD_OVERFLOW_A_NEG # define SADD_OVERFLOW_A_NEG(A, B, RES, MIN, MAX) LIBSIMPLE_SADD_OVERFLOW_A_NEG(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SADD_OVERFLOW_B_NEG # define SADD_OVERFLOW_B_NEG(A, B, RES, MIN, MAX) LIBSIMPLE_SADD_OVERFLOW_B_NEG(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SADD_OVERFLOW_NONNEG # define SADD_OVERFLOW_NONNEG(A, B, RES, MIN, MAX) LIBSIMPLE_SADD_OVERFLOW_NONNEG(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SSUB_OVERFLOW # define SSUB_OVERFLOW(A, B, RES, MIN, MAX) LIBSIMPLE_SSUB_OVERFLOW(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SSUB_OVERFLOW_B_NEG # define SSUB_OVERFLOW_B_NEG(A, B, RES, MIN, MAX) LIBSIMPLE_SSUB_OVERFLOW_B_NEG(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SSUB_OVERFLOW_B_POS # define SSUB_OVERFLOW_B_POS(A, B, RES, MIN, MAX) LIBSIMPLE_SSUB_OVERFLOW_B_POS(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW # define SMUL_OVERFLOW(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_NONZERO # define SMUL_OVERFLOW_NONZERO(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_NONZERO(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_AN # define SMUL_OVERFLOW_AN(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_AN(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_AN_BNZ # define SMUL_OVERFLOW_AN_BNZ(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_AN_BNZ(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_AN_BN # define SMUL_OVERFLOW_AN_BN(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_AN_BN(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_AN_BP # define SMUL_OVERFLOW_AN_BP(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_AN_BP(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_AP # define SMUL_OVERFLOW_AP(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_AP(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_AP_BNZ # define SMUL_OVERFLOW_AP_BNZ(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_AP_BNZ(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_AP_BN # define SMUL_OVERFLOW_AP_BN(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_AP_BN(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_AP_BP # define SMUL_OVERFLOW_AP_BP(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_AP_BP(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_BN # define SMUL_OVERFLOW_BN(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_BN(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_ANZ_BN # define SMUL_OVERFLOW_ANZ_BN(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_ANZ_BN(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_BP # define SMUL_OVERFLOW_BP(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_BP(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SMUL_OVERFLOW_ANZ_BP # define SMUL_OVERFLOW_ANZ_BP(A, B, RES, MIN, MAX) LIBSIMPLE_SMUL_OVERFLOW_ANZ_BP(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SDIV_OVERFLOW # define SDIV_OVERFLOW(A, B, RES, MIN, MAX) LIBSIMPLE_SDIV_OVERFLOW(A, B, RES, MIN, MAX) #endif +/* @since 1.1 */ #ifndef SINCR_OVERFLOW # define SINCR_OVERFLOW(AP, MAX) LIBSIMPLE_SINCR_OVERFLOW(AP, MAX) #endif +/* @since 1.1 */ #ifndef SDECR_OVERFLOW # define SDECR_OVERFLOW(AP, MIN) LIBSIMPLE_SDECR_OVERFLOW(AP, MIN) #endif +/* @since 1.1 */ #ifndef INCR_WOULD_OVERFLOW # define INCR_WOULD_OVERFLOW(A, MAX) LIBSIMPLE_INCR_WOULD_OVERFLOW(A, MAX) #endif +/* @since 1.1 */ #ifndef DECR_WOULD_OVERFLOW # define DECR_WOULD_OVERFLOW(A, MIN) LIBSIMPLE_DECR_WOULD_OVERFLOW(A, MIN) #endif +/* @since 1.1 */ #ifndef INCR_OVERFLOW # define INCR_OVERFLOW(AP, MAX) LIBSIMPLE_INCR_OVERFLOW(AP, MAX) #endif +/* @since 1.1 */ #ifndef DECR_OVERFLOW # define DECR_OVERFLOW(AP, MIN) LIBSIMPLE_DECR_OVERFLOW(AP, MIN) #endif diff --git a/libsimple/posix_memalign.h b/libsimple/posix_memalign.h index f656ea8..56e205f 100644 --- a/libsimple/posix_memalign.h +++ b/libsimple/posix_memalign.h @@ -24,6 +24,8 @@ * @throws EINVAL `n` is 0, `alignment` is not a power of 2, or * `alignment` is not a multiple of `sizeof(void *)` * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) static inline int libsimple_vposix_memalignn(void **__memptr, size_t __alignment, size_t __n, va_list __ap) @@ -56,6 +58,8 @@ static inline int libsimple_vposix_memalignn(void **__memptr, size_t __alignment * @throws EINVAL `n` is 0, `alignment` is not a power of 2, or * `alignment` is not a multiple of `sizeof(void *)` * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) static inline int @@ -87,6 +91,8 @@ libsimple_posix_memalignn(void **__memptr, size_t __alignment, size_t __n, ... / * of `sizeof(void *)` * @param n The number of bytes to allocate, the behaviour of * this function is unspecified for the value 0 + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(2)))) static inline void libsimple_enposix_memalign(int __status, void **__memptr, size_t __alignment, size_t __n) @@ -118,6 +124,8 @@ static inline void libsimple_enposix_memalign(int __status, void **__memptr, siz * @param ap The rest of the factors for the allocation size, * all arguments should have the type `size_t`, and * list must end with 0 (which is not factor) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(2)))) static inline void libsimple_envposix_memalignn(int __status, void **__memptr, size_t __alignment, size_t __n, va_list __ap) @@ -149,6 +157,8 @@ static inline void libsimple_envposix_memalignn(int __status, void **__memptr, s * @param ... The rest of the factors for the allocation size, * all arguments should have the type `size_t`, and * list must end with 0 (which is not factor) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(2)))) static inline void @@ -179,6 +189,8 @@ libsimple_enposix_memalignn(int __status, void **__memptr, size_t __alignment, s * of `sizeof(void *)` * @param n The number of bytes to allocate, the behaviour of * this function is unspecified for the value 0 + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) static inline void libsimple_eposix_memalign(void **__memptr, size_t __alignment, size_t __n) @@ -209,6 +221,8 @@ static inline void libsimple_eposix_memalign(void **__memptr, size_t __alignment * @param ap The rest of the factors for the allocation size, * all arguments should have the type `size_t`, and * list must end with 0 (which is not factor) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) static inline void libsimple_evposix_memalignn(void **__memptr, size_t __alignment, size_t __n, va_list __ap) @@ -239,6 +253,8 @@ static inline void libsimple_evposix_memalignn(void **__memptr, size_t __alignme * @param ... The rest of the factors for the allocation size, * all arguments should have the type `size_t`, and * list must end with 0 (which is not factor) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) static inline void diff --git a/libsimple/posix_memalignz.h b/libsimple/posix_memalignz.h index 323863d..e604b7d 100644 --- a/libsimple/posix_memalignz.h +++ b/libsimple/posix_memalignz.h @@ -25,6 +25,8 @@ * @throws EINVAL `n` is 0, `alignment` is not a power of 2, or * `alignment` is not a multiple of `sizeof(void *)` * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) int libsimple_vposix_memalignzn(void **, int, size_t, size_t, va_list); @@ -51,6 +53,8 @@ int libsimple_vposix_memalignzn(void **, int, size_t, size_t, va_list); * @throws EINVAL `n` is 0, `alignment` is not a power of 2, or * `alignment` is not a multiple of `sizeof(void *)` * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) static inline int @@ -90,6 +94,8 @@ libsimple_posix_memalignz(void **__memptr, int __clear, size_t __alignment, size * @throws EINVAL `n` is 0, `alignment` is not a power of 2, or * `alignment` is not a multiple of `sizeof(void *)` * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) static inline int @@ -122,6 +128,8 @@ libsimple_posix_memalignzn(void **__memptr, int __clear, size_t __alignment, siz * of `sizeof(void *)` * @param n The number of bytes to allocate, the behaviour of * this function is unspecified for the value 0 + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(2)))) void libsimple_enposix_memalignz(int, void **, int, size_t, size_t); @@ -153,6 +161,8 @@ void libsimple_enposix_memalignz(int, void **, int, size_t, size_t); * @param ap The rest of the factors for the allocation size, * all arguments should have the type `size_t`, and * list must end with 0 (which is not factor) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(2)))) void libsimple_envposix_memalignzn(int, void **, int, size_t, size_t, va_list); @@ -184,6 +194,8 @@ void libsimple_envposix_memalignzn(int, void **, int, size_t, size_t, va_list); * @param ... The rest of the factors for the allocation size, * all arguments should have the type `size_t`, and * list must end with 0 (which is not factor) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(2)))) static inline void @@ -215,6 +227,8 @@ libsimple_enposix_memalignzn(int __status, void **__memptr, int __clear, size_t * of `sizeof(void *)` * @param n The number of bytes to allocate, the behaviour of * this function is unspecified for the value 0 + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) static inline void libsimple_eposix_memalignz(void **__memptr, int __clear, size_t __alignment, size_t __n) @@ -246,6 +260,8 @@ static inline void libsimple_eposix_memalignz(void **__memptr, int __clear, size * @param ap The rest of the factors for the allocation size, * all arguments should have the type `size_t`, and * list must end with 0 (which is not factor) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) static inline void libsimple_evposix_memalignzn(void **__memptr, int __clear, size_t __alignment, size_t __n, va_list __ap) @@ -277,6 +293,8 @@ static inline void libsimple_evposix_memalignzn(void **__memptr, int __clear, si * @param ... The rest of the factors for the allocation size, * all arguments should have the type `size_t`, and * list must end with 0 (which is not factor) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) static inline void diff --git a/libsimple/printf.h b/libsimple/printf.h index cf7192e..6bdab79 100644 --- a/libsimple/printf.h +++ b/libsimple/printf.h @@ -5,6 +5,8 @@ * Exit value for `libsimple_eprintf` * * Default value is 1 + * + * @since 1.0 */ extern int libsimple_default_failure_exit; @@ -18,6 +20,8 @@ extern int libsimple_default_failure_exit; * it was when `libsimple_vweprintf` was called. * * Default value is `NULL` + * + * @since 1.1 */ extern void (*libsimple_eprintf_preprint)(void); @@ -31,6 +35,8 @@ extern void (*libsimple_eprintf_preprint)(void); * it was when `libsimple_vweprintf` was called. * * Default value is `NULL` + * + * @since 1.1 */ extern void (*libsimple_eprintf_postprint)(void); @@ -50,6 +56,8 @@ extern void (*libsimple_eprintf_postprint)(void); * @throws EMFILE {FOPEN_MAX} streams are currently open in the calling process * @throws ENOMEM Could not allocate enough memory * @throws Any error specified for `fprintf` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1, 2), __format__(__printf__, 2, 3)))) int libsimple_asprintf(char **, const char *, ...); @@ -73,6 +81,8 @@ int libsimple_asprintf(char **, const char *, ...); * @throws EMFILE {FOPEN_MAX} streams are currently open in the calling process * @throws ENOMEM Could not allocate enough memory * @throws Any error specified for `fprintf` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1, 2)))) int libsimple_vasprintf(char **, const char *, va_list); @@ -93,6 +103,8 @@ int libsimple_vasprintf(char **, const char *, va_list); * @param ... The format argument * @return The formatted string, `NULL` on error * @throws Any error specified for `snprintf` + * + * @since 1.0 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_asprintfa(__fmt, ...)\ @@ -124,6 +136,8 @@ int libsimple_vasprintf(char **, const char *, va_list); * @param ap The format argument * @return The formatted string, `NULL` on error * @throws Any error specified for `snprintf` + * + * @since 1.0 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_vasprintfa(__fmt, __ap)\ @@ -166,6 +180,8 @@ int libsimple_vasprintf(char **, const char *, va_list); * * @param fmt The format string * @param ap The format argument + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1)))) void libsimple_vweprintf(const char *, va_list); @@ -190,6 +206,8 @@ void libsimple_vweprintf(const char *, va_list); * * @param fmt The format string * @param ... The format argument + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1), __format__(__printf__, 1, 2)))) static inline void @@ -224,6 +242,8 @@ libsimple_weprintf(const char *__fmt, ...) * @param status Exit value for the process * @param fmt The format string * @param ap The format argument + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(2), __noreturn__))) static inline void @@ -256,6 +276,8 @@ libsimple_venprintf(int __status, const char *__fmt, va_list __ap) * @param status Exit value for the process * @param fmt The format string * @param ... The format argument + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(2), __format__(__printf__, 2, 3), __noreturn__))) static inline void @@ -290,6 +312,8 @@ libsimple_enprintf(int __status, const char *__fmt, ...) * * @param fmt The format string * @param ap The format argument + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1), __noreturn__))) static inline void @@ -322,6 +346,8 @@ libsimple_veprintf(const char *__fmt, va_list __ap) * * @param fmt The format string * @param ... The format argument + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1), __format__(__printf__, 1, 2), __noreturn__))) static inline void diff --git a/libsimple/pvalloc.h b/libsimple/pvalloc.h index 78deb1a..a858221 100644 --- a/libsimple/pvalloc.h +++ b/libsimple/pvalloc.h @@ -20,6 +20,8 @@ * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void *libsimple_vpvallocn(size_t __n, va_list __ap) @@ -42,6 +44,8 @@ static inline void *libsimple_vpvallocn(size_t __n, va_list __ap) * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void *libsimple_pvalloc(size_t __n) @@ -70,6 +74,8 @@ static inline void *libsimple_pvalloc(size_t __n) * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * @@ -102,6 +108,8 @@ libsimple_pvallocn(size_t __n, ... /*, (size_t)0 */) * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_enpvalloc(int __status, size_t __n) @@ -133,6 +141,8 @@ static inline void *libsimple_enpvalloc(int __status, size_t __n) * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_envpvallocn(int __status, size_t __n, va_list __ap) @@ -164,6 +174,8 @@ static inline void *libsimple_envpvallocn(int __status, size_t __n, va_list __ap * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -195,6 +207,8 @@ libsimple_enpvallocn(int __status, size_t __n, ... /*, (size_t)0 */) * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_epvalloc(size_t __n) @@ -225,6 +239,8 @@ static inline void *libsimple_epvalloc(size_t __n) * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evpvallocn(size_t __n, va_list __ap) @@ -255,6 +271,8 @@ static inline void *libsimple_evpvallocn(size_t __n, va_list __ap) * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/pvallocz.h b/libsimple/pvallocz.h index a61f80b..5809df7 100644 --- a/libsimple/pvallocz.h +++ b/libsimple/pvallocz.h @@ -21,6 +21,8 @@ * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * @@ -51,6 +53,8 @@ libsimple_vpvalloczn(int __clear, size_t __n, va_list __ap) * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(2), __warn_unused_result__))) static inline void * @@ -87,6 +91,8 @@ libsimple_pvallocz(int __clear, size_t __n) * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * @@ -120,6 +126,8 @@ libsimple_pvalloczn(int __clear, size_t __n, ... /*, (size_t)0 */) * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -160,6 +168,8 @@ libsimple_enpvallocz(int __status, int __clear, size_t __n) * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -201,6 +211,8 @@ libsimple_envpvalloczn(int __status, int __clear, size_t __n, va_list __ap) * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -233,6 +245,8 @@ libsimple_enpvalloczn(int __status, int __clear, size_t __n, ... /*, (size_t)0 * * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_epvallocz(int __clear, size_t __n) @@ -264,6 +278,8 @@ static inline void *libsimple_epvallocz(int __clear, size_t __n) * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evpvalloczn(int __clear, size_t __n, va_list __ap) @@ -295,6 +311,8 @@ static inline void *libsimple_evpvalloczn(int __clear, size_t __n, va_list __ap) * @return A unique pointer with at least the specified size, * rounded up to the next multiple of the page size, * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/realloc.h b/libsimple/realloc.h index 8ece86d..2d8af2e 100644 --- a/libsimple/realloc.h +++ b/libsimple/realloc.h @@ -25,6 +25,8 @@ * `alignof(max_align_t)`; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__warn_unused_result__))) void *libsimple_vreallocn(void *, size_t, va_list); @@ -57,6 +59,8 @@ void *libsimple_vreallocn(void *, size_t, va_list); * `alignof(max_align_t)`; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__warn_unused_result__))) static inline void * @@ -94,6 +98,8 @@ libsimple_reallocn(void *__ptr, size_t __n, ... /*, (size_t)0 */) * @return Either `ptr` or a unique pointer with at least * the specified size and with the alignment * `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) void *libsimple_enrealloc(int, void *, size_t); @@ -129,6 +135,8 @@ void *libsimple_enrealloc(int, void *, size_t); * @return Either `ptr` or a unique pointer with at least * the specified size and with the alignment * `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__warn_unused_result__, __returns_nonnull__))) void *libsimple_envreallocn(int, void *, size_t, va_list); @@ -164,6 +172,8 @@ void *libsimple_envreallocn(int, void *, size_t, va_list); * @return Either `ptr` or a unique pointer with at least * the specified size and with the alignment * `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__warn_unused_result__, __returns_nonnull__))) static inline void * @@ -200,6 +210,8 @@ libsimple_enreallocn(int __status, void *__ptr, size_t __n, ... /*, (size_t)0 */ * @return Either `ptr` or a unique pointer with at least * the specified size and with the alignment * `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_erealloc(void *__ptr, size_t __n) @@ -235,6 +247,8 @@ static inline void *libsimple_erealloc(void *__ptr, size_t __n) * @return Either `ptr` or a unique pointer with at least * the specified size and with the alignment * `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evreallocn(void *__ptr, size_t __n, va_list __ap) @@ -270,6 +284,8 @@ static inline void *libsimple_evreallocn(void *__ptr, size_t __n, va_list __ap) * @return Either `ptr` or a unique pointer with at least * the specified size and with the alignment * `alignof(max_align_t)` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/str.h b/libsimple/str.h index 3693c14..3e321e1 100644 --- a/libsimple/str.h +++ b/libsimple/str.h @@ -8,6 +8,8 @@ * @param c The character to scan for * @return `s` with a minimal offset such that `*r == c || !*r`, * where `r` is the returned pointer + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) char *libsimple_strchrnul(const char *, int); @@ -23,6 +25,8 @@ char *libsimple_strchrnul(const char *, int); * @param c The character to scan for * @return `s` with a minimal offset such that `tolower(*r) == tolower(c)`, * where `r` is the returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strcasechr(const char *, int); @@ -38,6 +42,8 @@ char *libsimple_strcasechr(const char *, int); * @param c The character to scan for * @return `s` with a minimal offset such that `tolower(*r) == tolower(c) || !*r`, * where `r` is the returned pointer + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) char *libsimple_strcasechrnul(const char *, int); @@ -53,6 +59,8 @@ char *libsimple_strcasechrnul(const char *, int); * @param c The character to scan for * @return `s` with a maximal offset such that `tolower(*r) == tolower(c)`, * where `r` is the returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrcasechr(const char *, int); @@ -69,6 +77,8 @@ char *libsimple_strrcasechr(const char *, int); * @param c The character to skip over * @return `s` with a minimal offset such that `*r != c`, where `r` * is the returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strchr_inv(const char *, int); @@ -85,6 +95,8 @@ char *libsimple_strchr_inv(const char *, int); * @param c The character to skip over * @return `s` with a minimal offset such that `*r != c || !*r`, * where `r` is the returned pointer + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) char *libsimple_strchrnul_inv(const char *, int); @@ -101,6 +113,8 @@ char *libsimple_strchrnul_inv(const char *, int); * @param c The character to skip over * @return `s` with a minimal offset such that `tolower(*r) != tolower(c)`, * where `r` is the returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strcasechr_inv(const char *, int); @@ -117,6 +131,8 @@ char *libsimple_strcasechr_inv(const char *, int); * @param c The character to skip over * @return `s` with a minimal offset such that `tolower(*r) != tolower(c) || !*r`, * where `r` is the returned pointer + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) char *libsimple_strcasechrnul_inv(const char *, int); @@ -133,6 +149,8 @@ char *libsimple_strcasechrnul_inv(const char *, int); * @param c The character to skip over * @return `s` with a maximal offset such that `*r != c`, where `r` * is the returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrchr_inv(const char *, int); @@ -149,6 +167,8 @@ char *libsimple_strrchr_inv(const char *, int); * @param c The character to skip over * @return `s` with a maximal offset such that `tolower(*r) != tolower(c)`, * where `r` is the returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrcasechr_inv(const char *, int); @@ -162,6 +182,8 @@ char *libsimple_strrcasechr_inv(const char *, int); * * @param s The string * @return `s` with an offset such `!*r`, where `r` is the returned pointer + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline char *libsimple_strend(const char *__s) @@ -177,6 +199,8 @@ static inline char *libsimple_strend(const char *__s) * @param s The string the check * @param t The string `s` should begin with * @return 1 if `s` starts with `t`, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) int libsimple_strstarts(const char *, const char *); @@ -191,6 +215,8 @@ int libsimple_strstarts(const char *, const char *); * @param s The string the check * @param t The string `s` should begin with * @return 1 if `s` starts with `t`, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline int libsimple_strcasestarts(const char *__s, const char *__t) @@ -206,6 +232,8 @@ static inline int libsimple_strcasestarts(const char *__s, const char *__t) * @param s The string the check * @param t The string `s` should begin with * @return 1 if `s` ends with `t`, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) int libsimple_strends(const char *, const char *); @@ -220,6 +248,8 @@ int libsimple_strends(const char *, const char *); * @param s The string the check * @param t The string `s` should begin with * @return 1 if `s` end with `t`, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) int libsimple_strcaseends(const char *, const char *); @@ -236,6 +266,8 @@ int libsimple_strcaseends(const char *, const char *); * @return `haystack` with a maximal offset such that the returned * pointer begins with `needle`, `NULL` if no such offset * exists + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrstr(const char *, const char *); @@ -252,6 +284,8 @@ char *libsimple_strrstr(const char *, const char *); * @return `haystack` with a minimal offset such that the returned * pointer begins with `needle`, `NULL` if no such offset * exists + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strcasestr(const char *, const char *); @@ -268,6 +302,8 @@ char *libsimple_strcasestr(const char *, const char *); * @return `haystack` with a maximal offset such that the returned * pointer begins with `needle`, `NULL` if no such offset * exists + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrcasestr(const char *, const char *); @@ -285,6 +321,8 @@ char *libsimple_strrcasestr(const char *, const char *); * @return A negative value if `a` is less than `b`, * a positive value if `a` is greater than `b`, * 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) static inline int libsimple_strcmpnul(const char *__a, const char *__b) @@ -303,6 +341,8 @@ static inline int libsimple_strcmpnul(const char *__a, const char *__b) * @return A negative value if `a` is less than `b`, * a positive value if `a` is greater than `b`, * 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) static inline int libsimple_strcasecmpnul(const char *__a, const char *__b) @@ -319,6 +359,8 @@ static inline int libsimple_strcasecmpnul(const char *__a, const char *__b) * @param a One of the strings, may not be `NULL` * @param b The other string, may not be `NULL` * @return 1 if the strings are equal, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline int libsimple_streq(const char *__a, const char *__b) @@ -335,6 +377,8 @@ static inline int libsimple_streq(const char *__a, const char *__b) * @param a One of the strings, may be `NULL` * @param b The other string, may be `NULL` * @return 1 if the strings are equal, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) static inline int libsimple_streqnul(const char *__a, const char *__b) @@ -351,6 +395,8 @@ static inline int libsimple_streqnul(const char *__a, const char *__b) * @param a One of the strings, may not be `NULL` * @param b The other string, may not be `NULL` * @return 1 if the strings are equal, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline int libsimple_strcaseeq(const char *__a, const char *__b) @@ -367,6 +413,8 @@ static inline int libsimple_strcaseeq(const char *__a, const char *__b) * @param a One of the strings, may be `NULL` * @param b The other string, may be `NULL` * @return 1 if the strings are equal, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) static inline int libsimple_strcaseeqnul(const char *__a, const char *__b) @@ -383,6 +431,8 @@ static inline int libsimple_strcaseeqnul(const char *__a, const char *__b) * @param b The other string * @return The number of bytes `a` and `b` have * in common in their beginnings + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) size_t libsimple_streqlen(const char *, const char *); @@ -398,6 +448,8 @@ size_t libsimple_streqlen(const char *, const char *); * @param b The other string * @return The number of bytes `a` and `b` have * in common in their beginnings + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) size_t libsimple_strcaseeqlen(const char *, const char *); @@ -413,6 +465,8 @@ size_t libsimple_strcaseeqlen(const char *, const char *); * @param b The other string * @return The number of bytes `a` and `b` have * in common in their ends + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline size_t libsimple_strreqlen(const char *__a, const char *__b) @@ -429,6 +483,8 @@ static inline size_t libsimple_strreqlen(const char *__a, const char *__b) * @param b The other string * @return The number of bytes `a` and `b` have * in common in their ends + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline size_t libsimple_strrcaseeqlen(const char *__a, const char *__b) @@ -445,6 +501,8 @@ static inline size_t libsimple_strrcaseeqlen(const char *__a, const char *__b) * @param s The string to look in * @return 1 if the byte `c` is not the NUL byte and can be found in `s`, * 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline int libsimple_inchrset(int __c, const char *__s) @@ -461,6 +519,8 @@ static inline int libsimple_inchrset(int __c, const char *__s) * @param s The string to look in * @return 1 if the byte `c` is not the NUL byte and can be found in `s`, * 0 otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline int libsimple_inchrcaseset(int __c, const char *__s) @@ -477,6 +537,8 @@ static inline int libsimple_inchrcaseset(int __c, const char *__s) * string should be moved to * @param s The string to move * @return `d` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline char *libsimple_strmove(char *__d, const char *__s) @@ -493,6 +555,8 @@ static inline char *libsimple_strmove(char *__d, const char *__s) * string should be moved to * @param s The string to move * @return `&d[strlen(s)]` (this byte will be a NUL byte) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline char *libsimple_stpmove(char *__d, const char *__s) @@ -508,6 +572,8 @@ static inline char *libsimple_stpmove(char *__d, const char *__s) * @param s The string to fill * @param c The byte to replace all bytes in `s` with * @return `s` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline char * @@ -528,6 +594,8 @@ libsimple_strset(char *__s, int __c_) * @param s The string to fill * @param c The byte to replace all bytes in `s` with * @return `&s[strlen(s)]` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline char * @@ -551,6 +619,8 @@ libsimple_stpset(char *__s, int __c_) * @param c The character that stops the copying * @return `&strchr(d, c)[1]` (after copying) if `c` can be * found in `s`, `NULL` otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline char * @@ -576,6 +646,8 @@ libsimple_strccpy(char *restrict __d, const char *restrict __s, int __c_) * @param c The character that stops the copying * @return `&strchr(d, c)[1]` (after copying) if `c` can be * found in `s` (before copying), `NULL` otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) char *libsimple_strcmove(char *, const char *, int); @@ -592,6 +664,8 @@ char *libsimple_strcmove(char *, const char *, int); * @param old The value of the characters to replace * @param new The value to replace the characters with * @return `strchr(s, '\0')` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__))) static inline char * @@ -619,6 +693,8 @@ libsimple_strreplace(char *__s, int __old_, int __new_) * @param d The location the string shall be copied to * @param s The string to copy * @return `strchr(d, '\0')` (after copying) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__))) char *libsimple_stptolower(char *, const char *); @@ -638,6 +714,8 @@ char *libsimple_stptolower(char *, const char *); * @param d The location the string shall be copied to * @param s The string to copy * @return `strchr(d, '\0')` (after copying) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__))) char *libsimple_stptoupper(char *, const char *); @@ -657,6 +735,8 @@ char *libsimple_stptoupper(char *, const char *); * @param d The location the string shall be copied to * @param s The string to copy * @return `d` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__))) static inline char *libsimple_strtolower(char *__d, const char *__s) @@ -677,6 +757,8 @@ static inline char *libsimple_strtolower(char *__d, const char *__s) * @param d The location the string shall be copied to * @param s The string to copy * @return `d` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__))) static inline char *libsimple_strtoupper(char *__d, const char *__s) @@ -693,6 +775,8 @@ static inline char *libsimple_strtoupper(char *__d, const char *__s) * @param allow_modified_nul Whether Modified UTF-8 is allowed, which * allows a two-byte encoding for NUL * @return 1 if good, 0 on encoding error + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline int libsimple_strisutf8(const char *__string, int __allow_modified_nul) diff --git a/libsimple/strdup.h b/libsimple/strdup.h index 33994e3..1d23b24 100644 --- a/libsimple/strdup.h +++ b/libsimple/strdup.h @@ -6,6 +6,8 @@ * * @param s:const char * The string to copy * @return :char * Duplicate of `s` with automatic storage + * + * @since 1.0 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_strdupa(s)\ @@ -27,6 +29,8 @@ * @param status Exit value in case of failure * @param s The string to copy * @return Duplicate of `s` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __assume_aligned__(1), __nonnull__, __warn_unused_result__, __returns_nonnull__))) char *libsimple_enstrdup(int, const char *); @@ -40,6 +44,8 @@ char *libsimple_enstrdup(int, const char *); * * @param s The string to copy * @return Duplicate of `s` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __assume_aligned__(1), __nonnull__, __warn_unused_result__, __returns_nonnull__))) static inline char *libsimple_estrdup(const char *__s) diff --git a/libsimple/strn.h b/libsimple/strn.h index e9272a4..5f5740e 100644 --- a/libsimple/strn.h +++ b/libsimple/strn.h @@ -10,6 +10,8 @@ * @return `s` with a minimal offset such that `*r == c`, * where `r` is the returned pointer, `NULL` if no such offset exists * within the first `n` bytes + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strnchr(const char *, int, size_t); @@ -27,6 +29,8 @@ char *libsimple_strnchr(const char *, int, size_t); * @return `s` with a minimal offset such that `tolower(*r) == tolower(c)`, * where `r` is the returned pointer, `NULL` if no such offset exists * within the first `n` bytes + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strncasechr(const char *, int, size_t); @@ -44,6 +48,8 @@ char *libsimple_strncasechr(const char *, int, size_t); * @return `s` with a minimal offset such that `*r == c || !*r`, * where `r` is the returned pointer, however if no such * offset exists within the first `n` bytes, `&s[n]` is returned + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) char *libsimple_strnchrnul(const char *, int, size_t); @@ -61,6 +67,8 @@ char *libsimple_strnchrnul(const char *, int, size_t); * @return `s` with a minimal offset such that `tolower(*r) == tolower(c) || !*r`, * where `r` is the returned pointer, however if no such offset * exists within the first `n` bytes, `&s[n]` is returned + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) char *libsimple_strncasechrnul(const char *, int, size_t); @@ -77,6 +85,8 @@ char *libsimple_strncasechrnul(const char *, int, size_t); * @param n Truncate `s` to this length if it is longer * @return `s` with a maximal offset such that `*r == c`, * where `r` is the returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrnchr(const char *, int, size_t); @@ -94,6 +104,8 @@ char *libsimple_strrnchr(const char *, int, size_t); * @param n Truncate `s` to this length if it is longer * @return `s` with a maximal offset such that `tolower(*r) == tolower(c)`, * where `r` is the returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrncasechr(const char *, int, size_t); @@ -112,6 +124,8 @@ char *libsimple_strrncasechr(const char *, int, size_t); * @return `s` with a minimal offset such that `*r != c`, * where `r` is the returned pointer, `NULL` if no such offset exists * within the first `n` bytes + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strnchr_inv(const char *, int, size_t); @@ -130,6 +144,8 @@ char *libsimple_strnchr_inv(const char *, int, size_t); * @return `s` with a minimal offset such that `tolower(*r) != tolower(c)`, * where `r` is the returned pointer, `NULL` if no such offset exists * within the first `n` bytes + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strncasechr_inv(const char *, int, size_t); @@ -148,6 +164,8 @@ char *libsimple_strncasechr_inv(const char *, int, size_t); * @return `s` with a minimal offset such that `*r != c || !*r`, * where `r` is the returned pointer, however if no such * offset exists within the first `n` bytes, `&s[n]` is returned + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) char *libsimple_strnchrnul_inv(const char *, int, size_t); @@ -166,6 +184,8 @@ char *libsimple_strnchrnul_inv(const char *, int, size_t); * @return `s` with a minimal offset such that `tolower(*r) != tolower(c) || !*r`, * where `r` is the returned pointer, however if no such offset * exists within the first `n` bytes, `&s[n]` is returned + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) char *libsimple_strncasechrnul_inv(const char *, int, size_t); @@ -183,6 +203,8 @@ char *libsimple_strncasechrnul_inv(const char *, int, size_t); * @param n Truncate `s` to this length if it is longer * @return `s` with a maximal offset such that `*r != c`, * where `r` is the returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrnchr_inv(const char *, int, size_t); @@ -200,6 +222,8 @@ char *libsimple_strrnchr_inv(const char *, int, size_t); * @param n Truncate `s` to this length if it is longer * @return `s` with a maximal offset such that `tolower(*r) != tolower(c)`, * where `r` is the returned pointer, `NULL` if no such offset exists + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrncasechr_inv(const char *, int, size_t); @@ -217,6 +241,8 @@ char *libsimple_strrncasechr_inv(const char *, int, size_t); * is the returned pointer, however if there * is not NUL byte within the first `n` bytes * if `s`, `&s[n]` is returned + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __returns_nonnull__, __warn_unused_result__))) char *libsimple_strnend(const char *, size_t); @@ -232,6 +258,8 @@ char *libsimple_strnend(const char *, size_t); * @param t The string `s` should begin with * @param n Truncate `s` to this length if it is longer * @return 1 if `s` starts with `t`, 0 otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) int libsimple_strnstarts(const char *, const char *, size_t); @@ -247,6 +275,8 @@ int libsimple_strnstarts(const char *, const char *, size_t); * @param t The string `s` should begin with * @param n Truncate `s` to this length if it is longer * @return 1 if `s` starts with `t`, 0 otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) int libsimple_strncasestarts(const char *, const char *, size_t); @@ -262,6 +292,8 @@ int libsimple_strncasestarts(const char *, const char *, size_t); * @param t The string `s` should begin with * @param n Truncate `s` to this length if it is longer * @return 1 if `s` ends with `t`, 0 otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) int libsimple_strnends(const char *, const char *, size_t); @@ -277,6 +309,8 @@ int libsimple_strnends(const char *, const char *, size_t); * @param t The string `s` should begin with * @param n Truncate `s` to this length if it is longer * @return 1 if `s` end with `t`, 0 otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) int libsimple_strncaseends(const char *, const char *, size_t); @@ -294,6 +328,8 @@ int libsimple_strncaseends(const char *, const char *, size_t); * @return `haystack` with a minimal offset such that the returned * pointer begins with `needle`, `NULL` if no such offset * exists + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strnstr(const char *, const char *, size_t); @@ -311,6 +347,8 @@ char *libsimple_strnstr(const char *, const char *, size_t); * @return `haystack` with a minimal offset such that the returned * pointer begins with `needle`, `NULL` if no such offset * exists + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strncasestr(const char *, const char *, size_t); @@ -328,6 +366,8 @@ char *libsimple_strncasestr(const char *, const char *, size_t); * @return `haystack` with a maximal offset such that the returned * pointer begins with `needle`, `NULL` if no such offset * exists + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrnstr(const char *, const char *, size_t); @@ -345,6 +385,8 @@ char *libsimple_strrnstr(const char *, const char *, size_t); * @return `haystack` with a maximal offset such that the returned * pointer begins with `needle`, `NULL` if no such offset * exists + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) char *libsimple_strrncasestr(const char *, const char *, size_t); @@ -364,6 +406,8 @@ char *libsimple_strrncasestr(const char *, const char *, size_t); * @return A negative value if `a` is less than `b`, * a positive value if `a` is greater than `b`, * 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) static inline int libsimple_strncmpnul(const char *__a, const char *__b, size_t __n) @@ -384,6 +428,8 @@ static inline int libsimple_strncmpnul(const char *__a, const char *__b, size_t * @return A negative value if `a` is less than `b`, * a positive value if `a` is greater than `b`, * 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) static inline int libsimple_strncasecmpnul(const char *__a, const char *__b, size_t __n) @@ -402,6 +448,8 @@ static inline int libsimple_strncasecmpnul(const char *__a, const char *__b, siz * @param n Truncate each input string that is * longer than this to this length * @return 1 if the strings are equal, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline int libsimple_strneq(const char *__a, const char *__b, size_t __n) @@ -420,6 +468,8 @@ static inline int libsimple_strneq(const char *__a, const char *__b, size_t __n) * @param n Truncate each input string that is * longer than this to this length * @return 1 if the strings are equal, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) static inline int libsimple_strneqnul(const char *__a, const char *__b, size_t __n) @@ -438,6 +488,8 @@ static inline int libsimple_strneqnul(const char *__a, const char *__b, size_t _ * @param n Truncate each input string that is * longer than this to this length * @return 1 if the strings are equal, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline int libsimple_strncaseeq(const char *__a, const char *__b, size_t __n) @@ -456,6 +508,8 @@ static inline int libsimple_strncaseeq(const char *__a, const char *__b, size_t * @param n Truncate each input string that is * longer than this to this length * @return 1 if the strings are equal, 0 otherwise + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __warn_unused_result__))) static inline int libsimple_strncaseeqnul(const char *__a, const char *__b, size_t __n) @@ -474,6 +528,8 @@ static inline int libsimple_strncaseeqnul(const char *__a, const char *__b, size * longer than this to this length * @return The number of bytes `a` and `b` have * in common in their beginnings + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) size_t libsimple_strneqlen(const char *, const char *, size_t); @@ -491,6 +547,8 @@ size_t libsimple_strneqlen(const char *, const char *, size_t); * longer than this to this length * @return The number of bytes `a` and `b` have * in common in their beginnings + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) size_t libsimple_strncaseeqlen(const char *, const char *, size_t); @@ -508,6 +566,8 @@ size_t libsimple_strncaseeqlen(const char *, const char *, size_t); * longer than this to this length * @return The number of bytes `a` and `b` have * in common in their ends + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline size_t libsimple_strrneqlen(const char *__a, const char *__b, size_t __n) @@ -526,6 +586,8 @@ static inline size_t libsimple_strrneqlen(const char *__a, const char *__b, size * longer than this to this length * @return The number of bytes `a` and `b` have * in common in their ends + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline size_t libsimple_strrncaseeqlen(const char *__a, const char *__b, size_t __n) @@ -543,6 +605,8 @@ static inline size_t libsimple_strrncaseeqlen(const char *__a, const char *__b, * @param s The string to move * @param n The maximum number of bytes to move * @return `d` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline char *libsimple_strnmove(char *__d, const char *__s, size_t __n) @@ -560,6 +624,8 @@ static inline char *libsimple_strnmove(char *__d, const char *__s, size_t __n) * @param s The string to move * @param n The maximum number of bytes to move * @return `&d[strnlen(s, n)]` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline char * @@ -581,6 +647,8 @@ libsimple_stpnmove(char *__d, const char *__s, size_t __n) * @param c The byte to replace all bytes in `s` with * @param n The maximum number of bytes to write * @return `s` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline char * @@ -602,6 +670,8 @@ libsimple_strnset(char *__s, int __c_, size_t __n) * @param c The byte to replace all bytes in `s` with * @param n The maximum number of bytes to write * @return `&s[strnlen(s, n)]` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline char * @@ -627,6 +697,8 @@ libsimple_stpnset(char *__s, int __c_, size_t __n) * @param n The maximum number of bytes to copy * @return `&strchr(d, c)[1]` (after copying) if `c` can be * found in `s`, `NULL` otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline char * @@ -660,6 +732,8 @@ libsimple_strnccpy(char *restrict __d, const char *restrict __s, int __c_, size_ * @return `&strchr(d, c)[1]` (after copying) if `c` can be * found within the first `n` bytes of `s` (before * copying), `NULL` otherwise + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) char *libsimple_strncmove(char *, const char *, int, size_t); @@ -677,6 +751,8 @@ char *libsimple_strncmove(char *, const char *, int, size_t); * @param new The value to replace the characters with * @param n The maximum length of `s` * @return `strnchr(s, '\0', n)` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__))) static inline char * @@ -705,6 +781,8 @@ libsimple_strnreplace(char *__s, int __old_, int __new_, size_t __n) * @param s The string to copy * @param n The maximum number of bytes to copy or convert * @return `strnchrnul(d, '\0', n)` (after copying) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__))) char *libsimple_stpntolower(char *, const char *, size_t); @@ -725,6 +803,8 @@ char *libsimple_stpntolower(char *, const char *, size_t); * @param s The string to copy * @param n The maximum number of bytes to copy or convert * @return `strnchrnul(d, '\0', n)` (after copying) + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__))) char *libsimple_stpntoupper(char *, const char *, size_t); @@ -745,6 +825,8 @@ char *libsimple_stpntoupper(char *, const char *, size_t); * @param s The string to copy * @param n The maximum number of bytes to copy or convert * @return `d` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__))) static inline char *libsimple_strntolower(char *__d, const char *__s, size_t __n) @@ -766,6 +848,8 @@ static inline char *libsimple_strntolower(char *__d, const char *__s, size_t __n * @param s The string to copy * @param n The maximum number of bytes to copy or convert * @return `d` + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __returns_nonnull__))) static inline char *libsimple_strntoupper(char *__d, const char *__s, size_t __n) @@ -786,6 +870,8 @@ static inline char *libsimple_strntoupper(char *__d, const char *__s, size_t __n * @param allow_modified_nul Whether Modified UTF-8 is allowed, which * allows a two-byte encoding for NUL * @return 1 if good, 0 on encoding error + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__))) static inline int libsimple_strnisutf8(const char *__string, size_t __n, int __allow_modified_nul) diff --git a/libsimple/strndup.h b/libsimple/strndup.h index 2b5bbd0..c7d0b3a 100644 --- a/libsimple/strndup.h +++ b/libsimple/strndup.h @@ -7,6 +7,8 @@ * @param s:const char * The string to copy * @param n:size_t The maximum number of bytes to copy * @return :char * Duplicate of `s` with automatic storage + * + * @since 1.0 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_strndupa(s, n)\ @@ -32,6 +34,8 @@ * @param s The string to copy * @param n The maximum number of bytes to copy * @return Duplicate of `s` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __assume_aligned__(1), __nonnull__, __warn_unused_result__, __returns_nonnull__))) char *libsimple_enstrndup(int, const char *, size_t); @@ -46,6 +50,8 @@ char *libsimple_enstrndup(int, const char *, size_t); * @param s The string to copy * @param n The maximum number of bytes to copy * @return Duplicate of `s` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __assume_aligned__(1), __nonnull__, __warn_unused_result__, __returns_nonnull__))) static inline char *libsimple_estrndup(const char *__s, size_t __n) diff --git a/libsimple/time.h b/libsimple/time.h index e0f7603..b6eb923 100644 --- a/libsimple/time.h +++ b/libsimple/time.h @@ -12,6 +12,8 @@ * will be `{.tv_sec = TIME_MAX, .tv_nsec = 999999999L}` if the * result too large and `{.tv_sec = TIME_MIN, .tv_nsec = 0L}` * if the result too small + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) int libsimple_sumtimespec(struct timespec *, const struct timespec *, const struct timespec *); @@ -31,6 +33,8 @@ int libsimple_sumtimespec(struct timespec *, const struct timespec *, const stru * will be `{.tv_sec = TIME_MAX, .tv_nsec = 999999999L}` if the * result too large and `{.tv_sec = TIME_MIN, .tv_nsec = 0L}` * if the result too small + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) int libsimple_difftimespec(struct timespec *, const struct timespec *, const struct timespec *); @@ -50,6 +54,8 @@ int libsimple_difftimespec(struct timespec *, const struct timespec *, const str * will be `{.tv_sec = TIME_MAX, .tv_nsec = 999999999L}` if the * result too large and `{.tv_sec = TIME_MIN, .tv_nsec = 0L}` * if the result too small + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) int libsimple_multimespec(struct timespec *, const struct timespec *, int); @@ -64,6 +70,8 @@ int libsimple_multimespec(struct timespec *, const struct timespec *, int); * @param a One of the `struct timespec`s * @param b The other `struct timespec` * @return -1 if `a` < `b`, 0 if `a` = `b`, and +1 if `a` > `b` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __warn_unused_result__))) static inline int @@ -89,6 +97,8 @@ libsimple_cmptimespec(const struct timespec *__a, const struct timespec *__b) * will be `{.tv_sec = TIME_MAX, .tv_usec = 999999L}` if the * result too large and `{.tv_sec = TIME_MIN, .tv_usec = 0L}` * if the result too small + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) int libsimple_sumtimeval(struct timeval *, const struct timeval *, const struct timeval *); @@ -108,6 +118,8 @@ int libsimple_sumtimeval(struct timeval *, const struct timeval *, const struct * will be `{.tv_sec = TIME_MAX, .tv_usec = 999999L}` if the * result too large and `{.tv_sec = TIME_MIN, .tv_usec = 0L}` * if the result too small + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) int libsimple_difftimeval(struct timeval *, const struct timeval *, const struct timeval *); @@ -127,6 +139,8 @@ int libsimple_difftimeval(struct timeval *, const struct timeval *, const struct * will be `{.tv_sec = TIME_MAX, .tv_usec = 999999L}` if the * result too large and `{.tv_sec = TIME_MIN, .tv_usec = 0L}` * if the result too small + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) int libsimple_multimeval(struct timeval *, const struct timeval *, int); @@ -141,6 +155,8 @@ int libsimple_multimeval(struct timeval *, const struct timeval *, int); * @param a One of the `struct timeval`s * @param b The other `struct timeval` * @return -1 if `a` < `b`, 0 if `a` = `b`, and +1 if `a` > `b` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__, __warn_unused_result__))) static inline int @@ -160,6 +176,8 @@ libsimple_cmptimeval(const struct timeval *__a, const struct timeval *__b) * * @param ts Output parameter for the result * @param tv The value to convert + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline void @@ -182,6 +200,8 @@ libsimple_timeval2timespec(struct timespec *restrict __ts, const struct timeval * @return 0 on success, -1 on error * @throws EOVERFLOW The value is too large to be convert, the value will be * truncated to `{.tv_sec = TIME_MAX, .tv_usec = 999999L}` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) int libsimple_timespec2timeval(struct timeval *restrict, const struct timespec *restrict); @@ -207,6 +227,8 @@ int libsimple_timespec2timeval(struct timeval *restrict, const struct timespec * * will be `{.tv_sec = TIME_MAX, .tv_nsec = 999999999L}` if the * result too large and `{.tv_sec = TIME_MIN, .tv_nsec = 0L}` * if the result too small (`*end` is set) + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1, 2)))) int libsimple_strtotimespec(struct timespec *restrict, const char *restrict, char **restrict); @@ -232,6 +254,8 @@ int libsimple_strtotimespec(struct timespec *restrict, const char *restrict, cha * will be `{.tv_sec = TIME_MAX, .tv_usec = 999999L}` if the * result too large and `{.tv_sec = TIME_MIN, .tv_usec = 0L}` * if the result too small (`*end` is set) + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(1, 2)))) int libsimple_strtotimeval(struct timeval *restrict, const char *restrict, char **restrict); @@ -251,6 +275,8 @@ int libsimple_strtotimeval(struct timeval *restrict, const char *restrict, char * `NULL` on failure * @throws ENOMEM Output buffer could not be allocated (only if `buf == NULL`) * @throws EINVAL `ts->tv_nsec` is negative or greater than 999999999 + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(2)))) char *libsimple_timespectostr(char *restrict, const struct timespec *restrict); @@ -270,6 +296,8 @@ char *libsimple_timespectostr(char *restrict, const struct timespec *restrict); * `NULL` on failure * @throws ENOMEM Output buffer could not be allocated (only if `buf == NULL`) * @throws EINVAL `ts->tv_usec` is negative or greater than 999999 + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__(2)))) char *libsimple_timevaltostr(char *restrict, const struct timeval *restrict); @@ -283,6 +311,8 @@ char *libsimple_timevaltostr(char *restrict, const struct timeval *restrict); * * @param ts The value to convert * @return The result + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline double @@ -303,6 +333,8 @@ libsimple_timespectodouble(const struct timespec *__ts) * * @param tv The value to convert * @return The result + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline double @@ -325,6 +357,8 @@ libsimple_timevaltodouble(const struct timeval *__tv) * * @param ts Output parameter for the result * @param d The value to convert + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) void libsimple_doubletotimespec(struct timespec *, double); @@ -340,6 +374,8 @@ void libsimple_doubletotimespec(struct timespec *, double); * * @param tv Output parameter for the result * @param d The value to convert + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) void libsimple_doubletotimeval(struct timeval *, double); @@ -355,6 +391,8 @@ void libsimple_doubletotimeval(struct timeval *, double); * * @param s The string to minimise * @return `s` + * + * @since 1.0 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__returns_nonnull__, __nonnull__))) char *libsimple_minimise_number_string(char *); diff --git a/libsimple/valloc.h b/libsimple/valloc.h index c0fcd03..07e9b95 100644 --- a/libsimple/valloc.h +++ b/libsimple/valloc.h @@ -16,6 +16,8 @@ * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void *libsimple_vvallocn(size_t __n, va_list __ap) @@ -34,6 +36,8 @@ static inline void *libsimple_vvallocn(size_t __n, va_list __ap) * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(1), __warn_unused_result__))) static inline void *libsimple_valloc(size_t __n) @@ -58,6 +62,8 @@ static inline void *libsimple_valloc(size_t __n) * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * @@ -86,6 +92,8 @@ libsimple_vallocn(size_t __n, ... /*, (size_t)0 */) * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_envalloc(int __status, size_t __n) @@ -113,6 +121,8 @@ static inline void *libsimple_envalloc(int __status, size_t __n) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_envvallocn(int __status, size_t __n, va_list __ap) @@ -140,6 +150,8 @@ static inline void *libsimple_envvallocn(int __status, size_t __n, va_list __ap) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -167,6 +179,8 @@ libsimple_envallocn(int __status, size_t __n, ... /*, (size_t)0 */) * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(1), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evalloc(size_t __n) @@ -193,6 +207,8 @@ static inline void *libsimple_evalloc(size_t __n) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evvallocn(size_t __n, va_list __ap) @@ -219,6 +235,8 @@ static inline void *libsimple_evvallocn(size_t __n, va_list __ap) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * diff --git a/libsimple/vallocz.h b/libsimple/vallocz.h index 3d8b4ec..f651584 100644 --- a/libsimple/vallocz.h +++ b/libsimple/vallocz.h @@ -17,6 +17,8 @@ * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * @@ -42,6 +44,8 @@ libsimple_vvalloczn(int __clear, size_t __n, va_list __ap) * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(2), __warn_unused_result__))) static inline void * @@ -73,6 +77,8 @@ libsimple_vallocz(int __clear, size_t __n) * and with page size alignment; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__))) static inline void * @@ -102,6 +108,8 @@ libsimple_valloczn(int __clear, size_t __n, ... /*, (size_t)0 */) * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -137,6 +145,8 @@ libsimple_envallocz(int __status, int __clear, size_t __n) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -173,6 +183,8 @@ libsimple_envvalloczn(int __status, int __clear, size_t __n, va_list __ap) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -201,6 +213,8 @@ libsimple_envalloczn(int __status, int __clear, size_t __n, ... /*, (size_t)0 */ * this function is unspecified for the value 0 * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evallocz(int __clear, size_t __n) @@ -228,6 +242,8 @@ static inline void *libsimple_evallocz(int __clear, size_t __n) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evvalloczn(int __clear, size_t __n, va_list __ap) @@ -255,6 +271,8 @@ static inline void *libsimple_evvalloczn(int __clear, size_t __n, va_list __ap) * list must end with 0 (which is not factor) * @return A unique pointer with at least the specified size * and with page size alignment + * + * @since 1.1 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __warn_unused_result__, __returns_nonnull__))) static inline void * -- cgit v1.2.3-70-g09d2 From aa61d87c6d556a1848e41850f12c4c8cd80bcba3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 18 Aug 2024 09:51:03 +0200 Subject: Add @since for definitions added in version 1.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libsimple.h | 14 +++++++------- libsimple/aligned_realloc.h | 32 ++++++++++++++++++++++++++++++++ libsimple/aligned_strdup.h | 8 ++++++++ libsimple/aligned_strndup.h | 8 ++++++++ libsimple/aligned_wcsdup.h | 8 ++++++++ libsimple/aligned_wcsndup.h | 8 ++++++++ libsimple/aligned_wmemdup.h | 8 ++++++++ libsimple/realloc.h | 14 ++++++++++++++ libsimple/wcsdup.h | 6 ++++++ libsimple/wcsndup.h | 8 ++++++++ libsimple/wmemdup.h | 8 ++++++++ 11 files changed, 115 insertions(+), 7 deletions(-) diff --git a/libsimple.h b/libsimple.h index 28d884c..3ee1e90 100644 --- a/libsimple.h +++ b/libsimple.h @@ -197,20 +197,20 @@ libsimple_unlist(void *__list, size_t __i, size_t *__np, size_t __width) #define _LIBSIMPLE_REMOVE_CONST(X, TYPE, ...) (*(TYPE *)(void *)&(X)) -#define LIBSIMPLE_REMOVE_CONST(...) _LIBSIMPLE_REMOVE_CONST(__VA_ARGS__, void *) /* TODO test, doc, man */ +#define LIBSIMPLE_REMOVE_CONST(...) _LIBSIMPLE_REMOVE_CONST(__VA_ARGS__, void *) /* TODO test, doc, man (since 1.2) */ #ifndef REMOVE_CONST # define REMOVE_CONST(...) LIBSIMPLE_REMOVE_CONST(__VA_ARGS__) #endif -#define LIBSIMPLE_PREFETCH_RDONLY(ADDRESS, LOCALITY) /* void */ /* TODO test, doc, man */\ +#define LIBSIMPLE_PREFETCH_RDONLY(ADDRESS, LOCALITY) /* void */ /* TODO test, doc, man (since 1.2) */\ _LIBSIMPLE_GCC_ONLY(__builtin_prefetch(ADDRESS, 0, LOCALITY)) #ifndef PREFETCH_RDONLY # define PREFETCH_RDONLY(...) LIBSIMPLE_PREFETCH_RDONLY(__VA_ARGS__) #endif -#define LIBSIMPLE_PREFETCH_RDWR(ADDRESS, LOCALITY) /* void */ /* TODO test, doc, man */\ +#define LIBSIMPLE_PREFETCH_RDWR(ADDRESS, LOCALITY) /* void */ /* TODO test, doc, man (since 1.2) */\ _LIBSIMPLE_GCC_ONLY(__builtin_prefetch(ADDRESS, 1, LOCALITY)) #ifndef PREFETCH_RDWR # define PREFETCH_RDWR(...) LIBSIMPLE_PREFETCH_RDWR(__VA_ARGS__) @@ -220,7 +220,7 @@ libsimple_unlist(void *__list, size_t __i, size_t *__np, size_t __width) #define _LIBSIMPLE_ASSUME_ALIGNED(PTR, ALIGNMENT, ...)\ _LIBSIMPLE_GCC_ONLY(__builtin_assume_aligned(PTR, ALIGNMENT)) #if defined(__GNUC__) && !defined(__clang__) -# define LIBSIMPLE_ASSUME_ALIGNED(PTR, ...) /* returns PTR */ /* TODO test, doc, man */\ +# define LIBSIMPLE_ASSUME_ALIGNED(PTR, ...) /* returns PTR */ /* TODO test, doc, man (since 1.2) */\ _LIBSIMPLE_GCC_ONLY(__builtin_assume_aligned(PTR, ##__VA_ARGS__,\ _LIBSIMPLE_C11_ONLY(_Alignof(PTR))\ _LIBSIMPLE_PREC11_ONLY(__alignof(PTR)))) @@ -230,20 +230,20 @@ libsimple_unlist(void *__list, size_t __i, size_t *__np, size_t __width) #endif -#define LIBSIMPLE_ASSUME_MISALIGNED(PTR, ALIGNMENT, OFFSET) /* returns PTR */ /* TODO test, doc, man */\ +#define LIBSIMPLE_ASSUME_MISALIGNED(PTR, ALIGNMENT, OFFSET) /* returns PTR */ /* TODO test, doc, man (since 1.2) */\ __builtin_assume_aligned(PTR, ALIGNMENT, OFFSET) #ifndef ASSUME_MISALIGNED # define ASSUME_MISALIGNED(...) LIBSIMPLE_ASSUME_MISALIGNED(__VA_ARGS__) #endif -#define LIBSIMPLE_UNROLLED(N) _LIBSIMPLE_GCC_ONLY(_LIBSIMPLE_C11_ONLY(_Pragma("GCC unroll "#N))) /* TODO test, doc, man */ +#define LIBSIMPLE_UNROLLED(N) _LIBSIMPLE_GCC_ONLY(_LIBSIMPLE_C11_ONLY(_Pragma("GCC unroll "#N))) /* TODO test, doc, man (since 1.2) */ #ifndef UNROLLED # define UNROLLED(N) LIBSIMPLE_UNROLLED(N) #endif -#define LIBSIMPLE_SIMDLOOP _LIBSIMPLE_GCC_ONLY(_LIBSIMPLE_C11_ONLY(_Pragma("GCC ivdep"))) /* TODO test, doc, man */ +#define LIBSIMPLE_SIMDLOOP _LIBSIMPLE_GCC_ONLY(_LIBSIMPLE_C11_ONLY(_Pragma("GCC ivdep"))) /* TODO test, doc, man (since 1.2) */ #ifndef SIMDLOOP # define SIMDLOOP LIBSIMPLE_SIMDLOOP #endif diff --git a/libsimple/aligned_realloc.h b/libsimple/aligned_realloc.h index 1da7ba7..b4926e4 100644 --- a/libsimple/aligned_realloc.h +++ b/libsimple/aligned_realloc.h @@ -26,6 +26,8 @@ * @throws EINVAL `alignment` is not a valid alignment * @throws ENOMEM Could not allocated enough memory * @throws ENOSYS Not implemented (requires non-standard libc functions) + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __alloc_size__(3), __warn_unused_result__))) #if defined(__GLIBC__) @@ -88,6 +90,8 @@ libsimple_aligned_realloc(void *__ptr, size_t __alignment, size_t __n) * this function is unspecified for the value 0 * @return Either `ptr` or a unique pointer with at least * the specified size + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(3), __alloc_size__(4), __warn_unused_result__, __returns_nonnull__))) void *libsimple_enaligned_realloc(int, void *, size_t, size_t); @@ -120,6 +124,8 @@ void *libsimple_enaligned_realloc(int, void *, size_t, size_t); * this function is unspecified for the value 0 * @return Either `ptr` or a unique pointer with at least * the specified size + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_ealigned_realloc(void *__ptr, size_t __alignment, size_t __n) @@ -154,6 +160,8 @@ static inline void *libsimple_ealigned_realloc(void *__ptr, size_t __alignment, * @throws EINVAL `n` is 0 * @throws EINVAL `alignment` is not a valid alignment * @throws ENOMEM Could not allocated enough memory + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __alloc_size__(3), __warn_unused_result__))) static inline void * @@ -197,6 +205,8 @@ libsimple_aligned_reallocf(void *__ptr, size_t __alignment, size_t __n) /* TODO * @throws EINVAL `alignment` is not a valid alignment * @throws ENOMEM Could not allocated enough memory * @throws ENOSYS Not implemented (requires non-standard libc functions) + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __alloc_size__(3, 4), __warn_unused_result__))) static inline void * @@ -241,6 +251,8 @@ libsimple_aligned_reallocarray(void *__ptr, size_t __alignment, size_t __n, size * this function is unspecified for the value 0 * @return Either `ptr` or a unique pointer with at least * the specified size + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(3), __alloc_size__(4, 5), __warn_unused_result__, __returns_nonnull__))) void *libsimple_enaligned_reallocarray(int, void *, size_t, size_t, size_t); @@ -277,6 +289,8 @@ void *libsimple_enaligned_reallocarray(int, void *, size_t, size_t, size_t); * this function is unspecified for the value 0 * @return Either `ptr` or a unique pointer with at least * the specified size + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __alloc_size__(3, 4), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_ealigned_reallocarray(void *__ptr, size_t __alignment, size_t __n, size_t __m) @@ -310,6 +324,8 @@ static inline void *libsimple_ealigned_reallocarray(void *__ptr, size_t __alignm * @throws EINVAL `alignment` is not a valid alignment * @throws ENOMEM Could not allocated enough memory * @throws ENOSYS Not implemented (requires non-standard libc functions) + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __alloc_size__(3, 4), __warn_unused_result__))) static inline void * @@ -354,6 +370,8 @@ libsimple_aligned_reallocarrayf(void *__ptr, size_t __alignment, size_t __n, siz * @throws EINVAL `alignment` is not a valid alignment * @throws ENOMEM Could not allocated enough memory * @throws ENOSYS Not implemented (requires non-standard libc functions) + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __warn_unused_result__))) void *libsimple_valigned_reallocn(void *, size_t, size_t, va_list); @@ -392,6 +410,8 @@ void *libsimple_valigned_reallocn(void *, size_t, size_t, va_list); * list must end with 0 (which is not factor) * @return Either `ptr` or a unique pointer with at least * the specified size + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(3), __warn_unused_result__, __returns_nonnull__))) void *libsimple_envaligned_reallocn(int, void *, size_t, size_t, va_list); @@ -429,6 +449,8 @@ void *libsimple_envaligned_reallocn(int, void *, size_t, size_t, va_list); * list must end with 0 (which is not factor) * @return Either `ptr` or a unique pointer with at least * the specified size + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_evaligned_reallocn(void *__ptr, size_t __alignment, size_t __n, va_list __ap) @@ -463,6 +485,8 @@ static inline void *libsimple_evaligned_reallocn(void *__ptr, size_t __alignment * @throws EINVAL `alignment` is not a valid alignment * @throws ENOMEM Could not allocated enough memory * @throws ENOSYS Not implemented (requires non-standard libc functions) + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __warn_unused_result__))) static inline void * @@ -507,6 +531,8 @@ libsimple_valigned_reallocfn(void *__ptr, size_t __alignment, size_t __n, va_lis * @throws EINVAL `alignment` is not a valid alignment * @throws ENOMEM Could not allocated enough memory * @throws ENOSYS Not implemented (requires non-standard libc functions) + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __warn_unused_result__))) static inline void * @@ -552,6 +578,8 @@ libsimple_aligned_reallocn(void *__ptr, size_t __alignment, size_t __n, ... /*, * list must end with 0 (which is not factor) * @return Either `ptr` or a unique pointer with at least * the specified size + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(3), __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -596,6 +624,8 @@ libsimple_enaligned_reallocn(int __status, void *__ptr, size_t __alignment, size * list must end with 0 (which is not factor) * @return Either `ptr` or a unique pointer with at least * the specified size + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) static inline void * @@ -640,6 +670,8 @@ libsimple_ealigned_reallocn(void *__ptr, size_t __alignment, size_t __n, ... /*, * @throws EINVAL `alignment` is not a valid alignment * @throws ENOMEM Could not allocated enough memory * @throws ENOSYS Not implemented (requires non-standard libc functions) + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_align__(2), __warn_unused_result__))) static inline void * diff --git a/libsimple/aligned_strdup.h b/libsimple/aligned_strdup.h index 07b7edf..44b0b5e 100644 --- a/libsimple/aligned_strdup.h +++ b/libsimple/aligned_strdup.h @@ -7,6 +7,8 @@ * @param s:const char * The string to copy * @param alignment:size_t The alignment of the returned pointer * @return :char * Duplicate of `s` with automatic storage + * + * @since 1.2 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_aligned_strdupa(s, alignment)\ @@ -35,6 +37,8 @@ * @param s The string to copy * @param alignment The alignment of the returned pointer * @return Duplicate of `s`, `NULL` on failure + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __nonnull__, __warn_unused_result__))) static inline char *libsimple_aligned_strdup(const char * __s, size_t __alignment) @@ -51,6 +55,8 @@ static inline char *libsimple_aligned_strdup(const char * __s, size_t __alignmen * @param s The string to copy * @param alignment The alignment of the returned pointer * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __nonnull__, __warn_unused_result__, __returns_nonnull__))) char *libsimple_enaligned_strdup(int, const char *, size_t); @@ -65,6 +71,8 @@ char *libsimple_enaligned_strdup(int, const char *, size_t); * @param s The string to copy * @param alignment The alignment of the returned pointer * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __nonnull__, __warn_unused_result__, __returns_nonnull__))) static inline char *libsimple_ealigned_strdup(const char *__s, size_t __alignment) diff --git a/libsimple/aligned_strndup.h b/libsimple/aligned_strndup.h index 16a3aac..5a8ca79 100644 --- a/libsimple/aligned_strndup.h +++ b/libsimple/aligned_strndup.h @@ -8,6 +8,8 @@ * @param alignment:size_t The alignment of the returned pointer * @param n:size_t The maximum number of bytes to copy * @return :char * Duplicate of `s` with automatic storage + * + * @since 1.2 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_aligned_strndupa(s, alignment, n)\ @@ -39,6 +41,8 @@ * @param alignment The alignment of the returned pointer * @param n The maximum number of bytes to copy * @return Duplicate of `s`, `NULL` on failure + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __nonnull__, __warn_unused_result__))) char *libsimple_aligned_strndup(const char * __s, size_t __alignment, size_t __n); @@ -55,6 +59,8 @@ char *libsimple_aligned_strndup(const char * __s, size_t __alignment, size_t __n * @param alignment The alignment of the returned pointer * @param n The maximum number of bytes to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __nonnull__, __warn_unused_result__, __returns_nonnull__))) char *libsimple_enaligned_strndup(int, const char *, size_t, size_t); @@ -70,6 +76,8 @@ char *libsimple_enaligned_strndup(int, const char *, size_t, size_t); * @param alignment The alignment of the returned pointer * @param n The maximum number of bytes to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __nonnull__, __warn_unused_result__, __returns_nonnull__))) static inline char *libsimple_ealigned_strndup(const char *__s, size_t __alignment, size_t __n) diff --git a/libsimple/aligned_wcsdup.h b/libsimple/aligned_wcsdup.h index 527d210..d08bcbf 100644 --- a/libsimple/aligned_wcsdup.h +++ b/libsimple/aligned_wcsdup.h @@ -7,6 +7,8 @@ * @param s:const wchar_t * The string to copy * @param alignment:size_t The alignment of the returned pointer * @return :wchar_t * Duplicate of `s` with automatic storage + * + * @since 1.2 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_aligned_wcsdupa(s, alignment)\ @@ -35,6 +37,8 @@ * @param s The string to copy * @param alignment The alignment of the returned pointer * @return Duplicate of `s`, `NULL` on failure + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __nonnull__, __warn_unused_result__))) static inline wchar_t *libsimple_aligned_wcsdup(const wchar_t * __s, size_t __alignment) @@ -51,6 +55,8 @@ static inline wchar_t *libsimple_aligned_wcsdup(const wchar_t * __s, size_t __al * @param s The string to copy * @param alignment The alignment of the returned pointer * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __nonnull__, __warn_unused_result__, __returns_nonnull__))) wchar_t *libsimple_enaligned_wcsdup(int, const wchar_t *, size_t); @@ -65,6 +71,8 @@ wchar_t *libsimple_enaligned_wcsdup(int, const wchar_t *, size_t); * @param s The string to copy * @param alignment The alignment of the returned pointer * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __nonnull__, __warn_unused_result__, __returns_nonnull__))) static inline wchar_t *libsimple_ealigned_wcsdup(const wchar_t *__s, size_t __alignment) diff --git a/libsimple/aligned_wcsndup.h b/libsimple/aligned_wcsndup.h index 015d1dc..5982c0b 100644 --- a/libsimple/aligned_wcsndup.h +++ b/libsimple/aligned_wcsndup.h @@ -8,6 +8,8 @@ * @param alignment:size_t The alignment of the returned pointer * @param n:size_t The maximum number of wide characters to copy * @return :wchar_t * Duplicate of `s` with automatic storage + * + * @since 1.2 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_aligned_wcsndupa(s, alignment, n)\ @@ -39,6 +41,8 @@ * @param alignment The alignment of the returned pointer * @param n The maximum number of wide characters to copy * @return Duplicate of `s`, `NULL` on failure + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __nonnull__, __warn_unused_result__))) wchar_t *libsimple_aligned_wcsndup(const wchar_t * __s, size_t __alignment, size_t __n); @@ -55,6 +59,8 @@ wchar_t *libsimple_aligned_wcsndup(const wchar_t * __s, size_t __alignment, size * @param alignment The alignment of the returned pointer * @param n The maximum number of wide characters to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __nonnull__, __warn_unused_result__, __returns_nonnull__))) wchar_t *libsimple_enaligned_wcsndup(int, const wchar_t *, size_t, size_t); @@ -70,6 +76,8 @@ wchar_t *libsimple_enaligned_wcsndup(int, const wchar_t *, size_t, size_t); * @param alignment The alignment of the returned pointer * @param n The maximum number of wide characters to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __nonnull__, __warn_unused_result__, __returns_nonnull__))) static inline wchar_t *libsimple_ealigned_wcsndup(const wchar_t *__s, size_t __alignment, size_t __n) diff --git a/libsimple/aligned_wmemdup.h b/libsimple/aligned_wmemdup.h index 63a9d40..d19b826 100644 --- a/libsimple/aligned_wmemdup.h +++ b/libsimple/aligned_wmemdup.h @@ -8,6 +8,8 @@ * @param alignment:size_t The alignment of the returned pointer * @param n:size_t The number of wide characters to copy * @return :wchar_t * Duplicate of `s` with automatic storage + * + * @since 1.2 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_aligned_wmemdupa(s, alignment, n)\ @@ -39,6 +41,8 @@ * @param alignment The alignment of the returned pointer * @param n The number of wide characters to copy * @return Duplicate of `s`, `NULL` on failure + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __alloc_size__(3), __nonnull__, __warn_unused_result__))) wchar_t *libsimple_aligned_wmemdup(const wchar_t *, size_t, size_t); @@ -55,6 +59,8 @@ wchar_t *libsimple_aligned_wmemdup(const wchar_t *, size_t, size_t); * @param alignment The alignment of the returned pointer * @param n The number of wide characters to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(3), __alloc_size__(4), __warn_unused_result__, __returns_nonnull__))) wchar_t *libsimple_enaligned_wmemdup(int, const wchar_t *, size_t, size_t); @@ -70,6 +76,8 @@ wchar_t *libsimple_enaligned_wmemdup(int, const wchar_t *, size_t, size_t); * @param alignment The alignment of the returned pointer * @param n The number of wide characters to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, __alloc_align__(2), __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) static inline wchar_t *libsimple_ealigned_wmemdup(const wchar_t *__s, size_t __alignment, size_t __n) diff --git a/libsimple/realloc.h b/libsimple/realloc.h index 32a5f59..0d487f5 100644 --- a/libsimple/realloc.h +++ b/libsimple/realloc.h @@ -322,6 +322,8 @@ libsimple_ereallocn(void *__ptr, size_t __n, ... /*, (size_t)0 */) * `alignof(max_align_t)`; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_size__(2), __warn_unused_result__))) static inline void * @@ -360,6 +362,8 @@ libsimple_reallocf(void *__ptr, size_t __n) /* TODO test */ * `alignof(max_align_t)`; `NULL` on failure * @throws EINVAL `n` or `m` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_size__(2, 3), __warn_unused_result__))) static inline void * @@ -401,6 +405,8 @@ libsimple_reallocarray(void *__ptr, size_t __n, size_t __m) * @return Either `ptr` or a unique pointer with at least * the specified size and with the alignment * `alignof(max_align_t)` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_size__(3, 4), __warn_unused_result__, __returns_nonnull__))) void *libsimple_enreallocarray(int, void *, size_t, size_t); @@ -434,6 +440,8 @@ void *libsimple_enreallocarray(int, void *, size_t, size_t); * @return Either `ptr` or a unique pointer with at least * the specified size and with the alignment * `alignof(max_align_t)` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_size__(2, 3), __warn_unused_result__, __returns_nonnull__))) static inline void *libsimple_ereallocarray(void *__ptr, size_t __n, size_t __m) @@ -466,6 +474,8 @@ static inline void *libsimple_ereallocarray(void *__ptr, size_t __n, size_t __m) * `alignof(max_align_t)`; `NULL` on failure * @throws EINVAL `n` or `m` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__alloc_size__(2, 3), __warn_unused_result__))) static inline void * @@ -505,6 +515,8 @@ libsimple_reallocarrayf(void *__ptr, size_t __n, size_t __m) /* TODO test */ * `alignof(max_align_t)`; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__warn_unused_result__))) static inline void * @@ -544,6 +556,8 @@ libsimple_vreallocfn(void *__ptr, size_t __n, va_list __ap) /* TODO test (reallo * `alignof(max_align_t)`; `NULL` on failure * @throws EINVAL `n` is 0 * @throws ENOMEM Could not allocated enough memory + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__warn_unused_result__))) static inline void * diff --git a/libsimple/wcsdup.h b/libsimple/wcsdup.h index b85d265..153d1eb 100644 --- a/libsimple/wcsdup.h +++ b/libsimple/wcsdup.h @@ -6,6 +6,8 @@ * * @param s:const wchar_t * The string to copy * @return :wchar_t * Duplicate of `s` with automatic storage + * + * @since 1.2 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_wcsdupa(s)\ @@ -27,6 +29,8 @@ * @param status Exit value in case of failure * @param s The string to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, _libsimple_assume_aligned_as(wchar_t), __nonnull__, __warn_unused_result__, __returns_nonnull__))) @@ -41,6 +45,8 @@ wchar_t *libsimple_enwcsdup(int, const wchar_t *); * * @param s The string to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, _libsimple_assume_aligned_as(wchar_t), __nonnull__, __warn_unused_result__, __returns_nonnull__))) diff --git a/libsimple/wcsndup.h b/libsimple/wcsndup.h index 31e9118..c68da7d 100644 --- a/libsimple/wcsndup.h +++ b/libsimple/wcsndup.h @@ -7,6 +7,8 @@ * @param s:const wchar_t * The string to copy * @param n:size_t The maximum number of wide characters to copy * @return :wchar_t * Duplicate of `s` with automatic storage + * + * @since 1.2 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_wcsndupa(s, n)\ @@ -31,6 +33,8 @@ * @param s The string to copy * @param n The maximum number of wide characters to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, _libsimple_assume_aligned_as(wchar_t), __nonnull__, __warn_unused_result__))) @@ -47,6 +51,8 @@ wchar_t *libsimple_wcsndup(const wchar_t *, size_t); * @param s The string to copy * @param n The maximum number of wide characters to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, _libsimple_assume_aligned_as(wchar_t), __nonnull__, __warn_unused_result__, __returns_nonnull__))) @@ -62,6 +68,8 @@ wchar_t *libsimple_enwcsndup(int, const wchar_t *, size_t); * @param s The string to copy * @param n The maximum number of wide characters to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, _libsimple_assume_aligned_as(wchar_t), __nonnull__, __warn_unused_result__, __returns_nonnull__))) diff --git a/libsimple/wmemdup.h b/libsimple/wmemdup.h index 2c1f899..2b213cb 100644 --- a/libsimple/wmemdup.h +++ b/libsimple/wmemdup.h @@ -7,6 +7,8 @@ * @param s:const wchar_t * The wide characters to copy * @param n:size_t The number of wide characters to copy * @return :wchar_t * Duplicate of `s` with automatic storage + * + * @since 1.2 */ #if defined(__GNUC__) || defined(__clang__) # define libsimple_wmemdupa(s, n)\ @@ -28,6 +30,8 @@ * @param s The wide characters to copy * @param n The number of wide characters to copy * @return Duplicate of `s`, `NULL` on failure + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, _libsimple_assume_aligned_as(wchar_t), __alloc_size__(2), __warn_unused_result__))) wchar_t *libsimple_wmemdup(const wchar_t *, size_t); @@ -43,6 +47,8 @@ wchar_t *libsimple_wmemdup(const wchar_t *, size_t); * @param s The wide characters to copy * @param n The number of wide characters to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, _libsimple_assume_aligned_as(wchar_t), __alloc_size__(3), __warn_unused_result__, __returns_nonnull__))) @@ -58,6 +64,8 @@ wchar_t *libsimple_enwmemdup(int, const wchar_t *, size_t); * @param s The wide characters to copy * @param n The number of wide characters to copy * @return Duplicate of `s` + * + * @since 1.2 */ _LIBSIMPLE_GCC_ONLY(__attribute__((__malloc__, _libsimple_assume_aligned_as(wchar_t), __alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) -- cgit v1.2.3-70-g09d2 From 55c5987ca34fb4bc5acc561a53091669bfbff966 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 18 Aug 2024 10:03:15 +0200 Subject: Add @since for definitions added in version 1.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libsimple/search.h | 4 ++++ libsimple/strtoint.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/libsimple/search.h b/libsimple/search.h index 19c1f85..bbd4f97 100644 --- a/libsimple/search.h +++ b/libsimple/search.h @@ -26,6 +26,8 @@ * * @seealso bsearch(3p) * @seealso libsimple_bindex_r(3p) + * + * @since 1.4 */ ssize_t libsimple_bindex(const void *key, const void *base, size_t nel, size_t width, /* TODO man */ int (*compar)(const void *, const void *)); @@ -61,6 +63,8 @@ ssize_t libsimple_bindex(const void *key, const void *base, size_t nel, size_t w * * @seealso bsearch(3p) * @seealso libsimple_bindex(3p) + * + * @since 1.4 */ ssize_t libsimple_bindex_r(const void *key, const void *base, size_t nel, size_t width, /* TODO man */ int (*compar)(const void *, const void *, void *), void *arg); diff --git a/libsimple/strtoint.h b/libsimple/strtoint.h index d7fc292..a86a6fd 100644 --- a/libsimple/strtoint.h +++ b/libsimple/strtoint.h @@ -16,6 +16,8 @@ * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) signed char libsimple_strtohh(const char *restrict, char **restrict, int); @@ -39,6 +41,8 @@ signed char libsimple_strtohh(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) unsigned char libsimple_strtouhh(const char *restrict, char **restrict, int); @@ -62,6 +66,8 @@ unsigned char libsimple_strtouhh(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) signed short int libsimple_strtoh(const char *restrict, char **restrict, int); @@ -85,6 +91,8 @@ signed short int libsimple_strtoh(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) unsigned short int libsimple_strtouh(const char *restrict, char **restrict, int); @@ -108,6 +116,8 @@ unsigned short int libsimple_strtouh(const char *restrict, char **restrict, int) * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) signed int libsimple_strtoi(const char *restrict, char **restrict, int); @@ -131,6 +141,8 @@ signed int libsimple_strtoi(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) unsigned int libsimple_strtou(const char *restrict, char **restrict, int); @@ -154,6 +166,8 @@ unsigned int libsimple_strtou(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) inline ssize_t @@ -181,6 +195,8 @@ libsimple_strtoz(const char *restrict nptr__, char **restrict endptr__, int base * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) inline size_t @@ -208,6 +224,8 @@ libsimple_strtouz(const char *restrict nptr__, char **restrict endptr__, int bas * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) int_least8_t libsimple_strtoi8(const char *restrict, char **restrict, int); @@ -231,6 +249,8 @@ int_least8_t libsimple_strtoi8(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) uint_least8_t libsimple_strtou8(const char *restrict, char **restrict, int); @@ -254,6 +274,8 @@ uint_least8_t libsimple_strtou8(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) int_least16_t libsimple_strtoi16(const char *restrict, char **restrict, int); @@ -277,6 +299,8 @@ int_least16_t libsimple_strtoi16(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) uint_least16_t libsimple_strtou16(const char *restrict, char **restrict, int); @@ -300,6 +324,8 @@ uint_least16_t libsimple_strtou16(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) int_least32_t libsimple_strtoi32(const char *restrict, char **restrict, int); @@ -323,6 +349,8 @@ int_least32_t libsimple_strtoi32(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) uint_least32_t libsimple_strtou32(const char *restrict, char **restrict, int); @@ -346,6 +374,8 @@ uint_least32_t libsimple_strtou32(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) int_least64_t libsimple_strtoi64(const char *restrict, char **restrict, int); @@ -369,6 +399,8 @@ int_least64_t libsimple_strtoi64(const char *restrict, char **restrict, int); * if out of range (`errno` set to `ERANGE`), the * closed value that can be represented; 0 on * failure (unless `errno` not set to `ERANGE`) + * + * @since 1.4 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__))) uint_least64_t libsimple_strtou64(const char *restrict, char **restrict, int); -- cgit v1.2.3-70-g09d2 From d615fdf3d64ed0c02765ca4c94f1f0fabc05b048 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 18 Aug 2024 10:07:45 +0200 Subject: Add @since for definitions added in version 1.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libsimple/array.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsimple/array.h b/libsimple/array.h index ae347f9..8300f0a 100644 --- a/libsimple/array.h +++ b/libsimple/array.h @@ -192,12 +192,14 @@ #endif +/* @since 1.5 */ #define libsimple_arrayfill(buf, item) libsimple_memsetelem(buf, item, sizeof *(buf), sizeof (buf) / sizeof *(buf)) #ifndef arrayfill # define arrayfill(...) libsimple_arrayfill(__VA_ARGS__) #endif +/* @since 1.5 */ #define libsimple_arraynull(buf) libsimple_memsetelem(buf, (void *)0, sizeof *(buf), sizeof (buf) / sizeof *(buf)) #ifndef arraynull # define arraynull(...) libsimple_arraynull(__VA_ARGS__) -- cgit v1.2.3-70-g09d2 From 14363225fc5f0527744e9a67610b2d15e5b86bc0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 18 Aug 2024 10:25:56 +0200 Subject: Add @since for definitions added in version 1.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libsimple/abs.h | 48 +++++ libsimple/ascii.h | 69 +++++++ libsimple/exec.h | 22 ++ libsimple/net.h | 2 + libsimple/path.h | 42 ++-- libsimple/printf.h | 8 + libsimple/random.h | 6 +- libsimple/sort.h | 576 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 757 insertions(+), 16 deletions(-) diff --git a/libsimple/abs.h b/libsimple/abs.h index c1a9123..86ec95f 100644 --- a/libsimple/abs.h +++ b/libsimple/abs.h @@ -41,150 +41,198 @@ #define LIBSIMPLE_SIGN_(UTYPE, STYPE, VALUE) ((VALUE) >> (sizeof(UTYPE) * CHAR_BIT - 1) ? (STYPE)(VALUE) : -(STYPE)-(VALUE)) +/* @since 1.6 */ inline unsigned char libsimple_hhdiff(signed char max, signed char min) { return LIBSIMPLE_DIFF_(unsigned char, max, min); } +/* @since 1.6 */ inline unsigned short int libsimple_hdiff(short int max, short int min) { return LIBSIMPLE_DIFF_(unsigned short int, max, min); } +/* @since 1.6 */ inline unsigned int libsimple_diff(int max, int min) { return LIBSIMPLE_DIFF_(unsigned int, max, min); } +/* @since 1.6 */ inline unsigned long int libsimple_ldiff(long int max, long int min) { return LIBSIMPLE_DIFF_(unsigned long int, max, min); } +/* @since 1.6 */ inline unsigned long long int libsimple_lldiff(long long int max, long long int min) { return LIBSIMPLE_DIFF_(unsigned long long int, max, min); } +/* @since 1.6 */ inline size_t libsimple_zdiff(ssize_t max, ssize_t min) { return LIBSIMPLE_DIFF_(size_t, max, min); } +/* @since 1.6 */ inline uint_least8_t libsimple_i8diff(int_least8_t max, int_least8_t min) { return LIBSIMPLE_DIFF_(uint_least8_t, max, min); } +/* @since 1.6 */ inline uint_least16_t libsimple_i16diff(int_least16_t max, int_least16_t min) { return LIBSIMPLE_DIFF_(uint_least16_t, max, min); } +/* @since 1.6 */ inline uint_least32_t libsimple_i32diff(int_least32_t max, int_least32_t min) { return LIBSIMPLE_DIFF_(uint_least32_t, max, min); } +/* @since 1.6 */ inline uint_least64_t libsimple_i64diff(int_least64_t max, int_least64_t min) { return LIBSIMPLE_DIFF_(uint_least64_t, max, min); } +/* @since 1.6 */ inline uintmax_t libsimple_imaxdiff(intmax_t max, intmax_t min) { return LIBSIMPLE_DIFF_(uintmax_t, max, min); } +/* @since 1.6 */ inline uintptr_t libsimple_iptrdiff(intptr_t max, intptr_t min) { return LIBSIMPLE_DIFF_(uintptr_t, max, min); } +/* @since 1.6 */ inline unsigned char libsimple_hhabs(signed char a, signed char b) { return LIBSIMPLE_IABS_(unsigned char, a, b); } +/* @since 1.6 */ inline unsigned short int libsimple_habs(short int a, short int b) { return LIBSIMPLE_IABS_(unsigned short int, a, b); } +/* @since 1.6 */ inline unsigned int libsimple_abs(int a, int b) { return LIBSIMPLE_IABS_(unsigned int, a, b); } +/* @since 1.6 */ inline unsigned long int libsimple_labs(long int a, long int b) { return LIBSIMPLE_IABS_(unsigned long int, a, b); } +/* @since 1.6 */ inline unsigned long long int libsimple_llabs(long long int a, long long int b) { return LIBSIMPLE_IABS_(unsigned long long int, a, b); } +/* @since 1.6 */ inline size_t libsimple_zabs(ssize_t a, ssize_t b) { return LIBSIMPLE_IABS_(size_t, a, b); } +/* @since 1.6 */ inline uint_least8_t libsimple_i8abs(int_least8_t a, int_least8_t b) { return LIBSIMPLE_IABS_(uint_least8_t, a, b); } +/* @since 1.6 */ inline uint_least16_t libsimple_i16abs(int_least16_t a, int_least16_t b) { return LIBSIMPLE_IABS_(uint_least16_t, a, b); } +/* @since 1.6 */ inline uint_least32_t libsimple_i32abs(int_least32_t a, int_least32_t b) { return LIBSIMPLE_IABS_(uint_least32_t, a, b); } +/* @since 1.6 */ inline uint_least64_t libsimple_i64abs(int_least64_t a, int_least64_t b) { return LIBSIMPLE_IABS_(uint_least64_t, a, b); } +/* @since 1.6 */ inline uintmax_t libsimple_imaxabs(intmax_t a, intmax_t b) { return LIBSIMPLE_IABS_(uintmax_t, a, b); } +/* @since 1.6 */ inline uintptr_t libsimple_iptrabs(intptr_t a, intptr_t b) { return LIBSIMPLE_IABS_(uintptr_t, a, b); } +/* @since 1.6 */ inline unsigned char libsimple_uhhabs(unsigned char a, unsigned char b) { return LIBSIMPLE_UABS_(unsigned char, a, b); } +/* @since 1.6 */ inline unsigned short int libsimple_uhabs(unsigned short int a, unsigned short int b) { return LIBSIMPLE_UABS_(unsigned short int, a, b); } +/* @since 1.6 */ inline unsigned int libsimple_uabs(unsigned int a, unsigned int b) { return LIBSIMPLE_UABS_(unsigned int, a, b); } +/* @since 1.6 */ inline unsigned long int libsimple_ulabs(unsigned long int a, unsigned long int b) { return LIBSIMPLE_UABS_(unsigned long int, a, b); } +/* @since 1.6 */ inline unsigned long long int libsimple_ullabs(unsigned long long int a, unsigned long long int b) { return LIBSIMPLE_UABS_(unsigned long long int, a, b); } +/* @since 1.6 */ inline size_t libsimple_uzabs(size_t a, size_t b) { return LIBSIMPLE_UABS_(size_t, a, b); } +/* @since 1.6 */ inline uint_least8_t libsimple_u8abs(uint_least8_t a, uint_least8_t b) { return LIBSIMPLE_UABS_(uint_least8_t, a, b); } +/* @since 1.6 */ inline uint_least16_t libsimple_u16abs(uint_least16_t a, uint_least16_t b) { return LIBSIMPLE_UABS_(uint_least16_t, a, b); } +/* @since 1.6 */ inline uint_least32_t libsimple_u32abs(uint_least32_t a, uint_least32_t b) { return LIBSIMPLE_UABS_(uint_least32_t, a, b); } +/* @since 1.6 */ inline uint_least64_t libsimple_u64abs(uint_least64_t a, uint_least64_t b) { return LIBSIMPLE_UABS_(uint_least64_t, a, b); } +/* @since 1.6 */ inline uintmax_t libsimple_umaxabs(uintmax_t a, uintmax_t b) { return LIBSIMPLE_UABS_(uintmax_t, a, b); } +/* @since 1.6 */ inline uintptr_t libsimple_uptrabs(uintptr_t a, uintptr_t b) { return LIBSIMPLE_UABS_(uintptr_t, a, b); } +/* @since 1.6 */ inline signed char libsimple_toihh(unsigned char value) { return LIBSIMPLE_SIGN_(unsigned char, signed char, value); } +/* @since 1.6 */ inline short int libsimple_toih(unsigned short int value) { return LIBSIMPLE_SIGN_(unsigned short int, short int, value); } +/* @since 1.6 */ inline int libsimple_toi(unsigned int value) { return LIBSIMPLE_SIGN_(unsigned int, int, value); } +/* @since 1.6 */ inline long int libsimple_toil(unsigned long int value) { return LIBSIMPLE_SIGN_(unsigned long int, long int, value); } +/* @since 1.6 */ inline long long int libsimple_toill(unsigned long long int value) { return LIBSIMPLE_SIGN_(unsigned long long int, long long int, value); } +/* @since 1.6 */ inline ssize_t libsimple_toiz(size_t value) { return LIBSIMPLE_SIGN_(size_t, ssize_t, value); } +/* @since 1.6 */ inline int_least8_t libsimple_toi8(uint_least8_t value) { return LIBSIMPLE_SIGN_(uint_least8_t, int_least8_t, value); } +/* @since 1.6 */ inline int_least16_t libsimple_toi16(uint_least16_t value) { return LIBSIMPLE_SIGN_(uint_least16_t, int_least16_t, value); } +/* @since 1.6 */ inline int_least32_t libsimple_toi32(uint_least32_t value) { return LIBSIMPLE_SIGN_(uint_least32_t, int_least32_t, value); } +/* @since 1.6 */ inline int_least64_t libsimple_toi64(uint_least64_t value) { return LIBSIMPLE_SIGN_(uint_least32_t, int_least32_t, value); } +/* @since 1.6 */ inline intmax_t libsimple_toimax(uintmax_t value) { return LIBSIMPLE_SIGN_(uintmax_t, intmax_t, value); } +/* @since 1.6 */ inline intptr_t libsimple_toiptr(uintptr_t value) { return LIBSIMPLE_SIGN_(uintptr_t, intptr_t, value); } diff --git a/libsimple/ascii.h b/libsimple/ascii.h index faaa99e..7415fac 100644 --- a/libsimple/ascii.h +++ b/libsimple/ascii.h @@ -3,6 +3,7 @@ /* TODO man, doc, test */ +/* @since 1.6 */ #define LIBSIMPLE_CHAR_NUL '\x00' #ifndef CHAR_NUL # define CHAR_NUL LIBSIMPLE_CHAR_NUL @@ -12,6 +13,7 @@ # define CHAR_NULL LIBSIMPLE_CHAR_NULL #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_SOH '\x01' #ifndef CHAR_SOH # define CHAR_SOH LIBSIMPLE_CHAR_SOH @@ -21,6 +23,7 @@ # define CHAR_START_OF_HEADING LIBSIMPLE_CHAR_START_OF_HEADING #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_STX '\x02' #ifndef CHAR_STX # define CHAR_STX LIBSIMPLE_CHAR_STX @@ -30,6 +33,7 @@ # define CHAR_START_OF_TEXT LIBSIMPLE_CHAR_START_OF_TEXT #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_ETX '\x03' #ifndef CHAR_ETX # define CHAR_ETX LIBSIMPLE_CHAR_ETX @@ -39,6 +43,7 @@ # define CHAR_END_OF_TEXT LIBSIMPLE_CHAR_END_OF_TEXT #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_EOT '\x04' #ifndef CHAR_EOT # define CHAR_EOT LIBSIMPLE_CHAR_EOT @@ -48,6 +53,7 @@ # define CHAR_END_OF_TRANSMISSION LIBSIMPLE_CHAR_END_OF_TRANSMISSION #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_ENQ '\x05' #ifndef CHAR_ENQ # define CHAR_ENQ LIBSIMPLE_CHAR_ENQ @@ -57,6 +63,7 @@ # define CHAR_ENQUIRY LIBSIMPLE_CHAR_ENQUIRY #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_ACK '\x06' #ifndef CHAR_ACK # define CHAR_ACK LIBSIMPLE_CHAR_ACK @@ -66,6 +73,7 @@ # define CHAR_ACKNOWLEDGE LIBSIMPLE_CHAR_ACKNOWLEDGE #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_BEL '\x07' #ifndef CHAR_BEL # define CHAR_BEL LIBSIMPLE_CHAR_BEL @@ -75,6 +83,7 @@ # define CHAR_BELL LIBSIMPLE_CHAR_BELL #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_BS '\x08' #ifndef CHAR_BS # define CHAR_BS LIBSIMPLE_CHAR_BS @@ -84,6 +93,7 @@ # define CHAR_BACKSPACE LIBSIMPLE_CHAR_BACKSPACE #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_HT '\x09' #ifndef CHAR_HT # define CHAR_HT LIBSIMPLE_CHAR_HT @@ -93,6 +103,7 @@ # define CHAR_HORIZONTAL_TABULATION LIBSIMPLE_CHAR_HORIZONTAL_TABULATION #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_LF '\x0A' #ifndef CHAR_LF # define CHAR_LF LIBSIMPLE_CHAR_LF @@ -102,6 +113,7 @@ # define CHAR_LINE_FEED LIBSIMPLE_CHAR_LINE_FEED #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_VT '\x0B' #ifndef CHAR_VT # define CHAR_VT LIBSIMPLE_CHAR_VT @@ -111,6 +123,7 @@ # define CHAR_VERTICAL_TABULATION LIBSIMPLE_CHAR_VERTICAL_TABULATION #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_FF '\x0C' #ifndef CHAR_FF # define CHAR_FF LIBSIMPLE_CHAR_FF @@ -120,6 +133,7 @@ # define CHAR_FORM_FEED LIBSIMPLE_CHAR_FORM_FEED #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_CR '\x0D' #ifndef CHAR_CR # define CHAR_CR LIBSIMPLE_CHAR_CR @@ -129,6 +143,7 @@ # define CHAR_CARRIAGE_RETURN LIBSIMPLE_CHAR_CARRIAGE_RETURN #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_SO '\x0E' #ifndef CHAR_SO # define CHAR_SO LIBSIMPLE_CHAR_SO @@ -138,6 +153,7 @@ # define CHAR_SHIFT_OUT LIBSIMPLE_CHAR_SHIFT_OUT #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_SI '\x0F' #ifndef CHAR_SI # define CHAR_SI LIBSIMPLE_CHAR_SI @@ -147,6 +163,7 @@ # define CHAR_SHIFT_IN LIBSIMPLE_CHAR_SHIFT_IN #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_DLE '\x10' #ifndef CHAR_DLE # define CHAR_DLE LIBSIMPLE_CHAR_DLE @@ -156,6 +173,7 @@ # define CHAR_DATA_LINK_ESCAPE LIBSIMPLE_CHAR_DATA_LINK_ESCAPE #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_DC1 '\x11' #ifndef CHAR_DC1 # define CHAR_DC1 LIBSIMPLE_CHAR_DC1 @@ -165,6 +183,7 @@ # define CHAR_DEVICE_CONTROL_1 LIBSIMPLE_CHAR_DEVICE_CONTROL_1 #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_DC2 '\x12' #ifndef CHAR_DC2 # define CHAR_DC2 LIBSIMPLE_CHAR_DC2 @@ -174,6 +193,7 @@ # define CHAR_DEVICE_CONTROL_2 LIBSIMPLE_CHAR_DEVICE_CONTROL_2 #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_DC3 '\x13' #ifndef CHAR_DC3 # define CHAR_DC3 LIBSIMPLE_CHAR_DC3 @@ -183,6 +203,7 @@ # define CHAR_DEVICE_CONTROL_3 LIBSIMPLE_CHAR_DEVICE_CONTROL_3 #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_DC4 '\x14' #ifndef CHAR_DC4 # define CHAR_DC4 LIBSIMPLE_CHAR_DC4 @@ -192,6 +213,7 @@ # define CHAR_DEVICE_CONTROL_4 LIBSIMPLE_CHAR_DEVICE_CONTROL_4 #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_NAK '\x15' #ifndef CHAR_NAK # define CHAR_NAK LIBSIMPLE_CHAR_NAK @@ -201,6 +223,7 @@ # define CHAR_NEGATIVE_ACKNOWLEDGE LIBSIMPLE_CHAR_NEGATIVE_ACKNOWLEDGE #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_SYN '\x16' #ifndef CHAR_SYN # define CHAR_SYN LIBSIMPLE_CHAR_SYN @@ -210,6 +233,7 @@ # define CHAR_SYNCHRONOUS_IDLE LIBSIMPLE_CHAR_SYNCHRONOUS_IDLE #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_ETB '\x17' #ifndef CHAR_ETB # define CHAR_ETB LIBSIMPLE_CHAR_ETB @@ -219,6 +243,7 @@ # define CHAR_END_OF_TRANSMISSION_BLOCK LIBSIMPLE_CHAR_END_OF_TRANSMISSION_BLOCK #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_CAN '\x18' #ifndef CHAR_CAN # define CHAR_CAN LIBSIMPLE_CHAR_CAN @@ -228,6 +253,7 @@ # define CHAR_CANCEL LIBSIMPLE_CHAR_CANCEL #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_EM '\x19' #ifndef CHAR_EM # define CHAR_EM LIBSIMPLE_CHAR_EM @@ -237,6 +263,7 @@ # define CHAR_END_OF_MEDIUM LIBSIMPLE_CHAR_END_OF_MEDIUM #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_SUB '\x1A' #ifndef CHAR_SUB # define CHAR_SUB LIBSIMPLE_CHAR_SUB @@ -246,6 +273,7 @@ # define CHAR_SUBSTITUTE LIBSIMPLE_CHAR_SUBSTITUTE #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_ESC '\x1B' #ifndef CHAR_ESC # define CHAR_ESC LIBSIMPLE_CHAR_ESC @@ -255,6 +283,7 @@ # define CHAR_ESCAPE LIBSIMPLE_CHAR_ESCAPE #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_FS '\x1C' #ifndef CHAR_FS # define CHAR_FS LIBSIMPLE_CHAR_FS @@ -264,6 +293,7 @@ # define CHAR_FILE_SEPARATOR LIBSIMPLE_CHAR_FILE_SEPARATOR #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_GS '\x1D' #ifndef CHAR_GS # define CHAR_GS LIBSIMPLE_CHAR_GS @@ -273,6 +303,7 @@ # define CHAR_GROUP_SEPARATOR LIBSIMPLE_CHAR_GROUP_SEPARATOR #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_RS '\x1E' #ifndef CHAR_RS # define CHAR_RS LIBSIMPLE_CHAR_RS @@ -282,6 +313,7 @@ # define CHAR_RECORD_SEPARATOR LIBSIMPLE_CHAR_RECORD_SEPARATOR #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_US '\x1F' #ifndef CHAR_US # define CHAR_US LIBSIMPLE_CHAR_US @@ -291,6 +323,7 @@ # define CHAR_UNIT_SEPARATOR LIBSIMPLE_CHAR_UNIT_SEPARATOR #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_SP '\x20' #ifndef CHAR_SP # define CHAR_SP LIBSIMPLE_CHAR_SP @@ -300,6 +333,7 @@ # define CHAR_SPACE LIBSIMPLE_CHAR_SPACE #endif +/* @since 1.6 */ #define LIBSIMPLE_CHAR_DEL '\x7F' #ifndef CHAR_DEL # define CHAR_DEL LIBSIMPLE_CHAR_DEL @@ -310,6 +344,7 @@ #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_NUL "\x00" #ifndef STR_CHAR_NUL # define STR_CHAR_NUL LIBSIMPLE_STR_CHAR_NUL @@ -319,6 +354,7 @@ # define STR_CHAR_NULL LIBSIMPLE_STR_CHAR_NULL #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_SOH "\x01" #ifndef STR_CHAR_SOH # define STR_CHAR_SOH LIBSIMPLE_STR_CHAR_SOH @@ -328,6 +364,7 @@ # define STR_CHAR_START_OF_HEADING LIBSIMPLE_STR_CHAR_START_OF_HEADING #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_STX "\x02" #ifndef STR_CHAR_STX # define STR_CHAR_STX LIBSIMPLE_STR_CHAR_STX @@ -337,6 +374,7 @@ # define STR_CHAR_START_OF_TEXT LIBSIMPLE_STR_CHAR_START_OF_TEXT #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_ETX "\x03" #ifndef STR_CHAR_ETX # define STR_CHAR_ETX LIBSIMPLE_STR_CHAR_ETX @@ -346,6 +384,7 @@ # define STR_CHAR_END_OF_TEXT LIBSIMPLE_STR_CHAR_END_OF_TEXT #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_EOT "\x04" #ifndef STR_CHAR_EOT # define STR_CHAR_EOT LIBSIMPLE_STR_CHAR_EOT @@ -355,6 +394,7 @@ # define STR_CHAR_END_OF_TRANSMISSION LIBSIMPLE_STR_CHAR_END_OF_TRANSMISSION #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_ENQ "\x05" #ifndef STR_CHAR_ENQ # define STR_CHAR_ENQ LIBSIMPLE_STR_CHAR_ENQ @@ -364,6 +404,7 @@ # define STR_CHAR_ENQUIRY LIBSIMPLE_STR_CHAR_ENQUIRY #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_ACK "\x06" #ifndef STR_CHAR_ACK # define STR_CHAR_ACK LIBSIMPLE_STR_CHAR_ACK @@ -373,6 +414,7 @@ # define STR_CHAR_ACKNOWLEDGE LIBSIMPLE_STR_CHAR_ACKNOWLEDGE #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_BEL "\x07" #ifndef STR_CHAR_BEL # define STR_CHAR_BEL LIBSIMPLE_STR_CHAR_BEL @@ -382,6 +424,7 @@ # define STR_CHAR_BELL LIBSIMPLE_STR_CHAR_BELL #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_BS "\x08" #ifndef STR_CHAR_BS # define STR_CHAR_BS LIBSIMPLE_STR_CHAR_BS @@ -391,6 +434,7 @@ # define STR_CHAR_BACKSPACE LIBSIMPLE_STR_CHAR_BACKSPACE #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_HT "\x09" #ifndef STR_CHAR_HT # define STR_CHAR_HT LIBSIMPLE_STR_CHAR_HT @@ -400,6 +444,7 @@ # define STR_CHAR_HORIZONTAL_TABULATION LIBSIMPLE_STR_CHAR_HORIZONTAL_TABULATION #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_LF "\x0A" #ifndef STR_CHAR_LF # define STR_CHAR_LF LIBSIMPLE_STR_CHAR_LF @@ -409,6 +454,7 @@ # define STR_CHAR_LINE_FEED LIBSIMPLE_STR_CHAR_LINE_FEED #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_VT "\x0B" #ifndef STR_CHAR_VT # define STR_CHAR_VT LIBSIMPLE_STR_CHAR_VT @@ -418,6 +464,7 @@ # define STR_CHAR_VERTICAL_TABULATION LIBSIMPLE_STR_CHAR_VERTICAL_TABULATION #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_FF "\x0C" #ifndef STR_CHAR_FF # define STR_CHAR_FF LIBSIMPLE_STR_CHAR_FF @@ -427,6 +474,7 @@ # define STR_CHAR_FORM_FEED LIBSIMPLE_STR_CHAR_FORM_FEED #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_CR "\x0D" #ifndef STR_CHAR_CR # define STR_CHAR_CR LIBSIMPLE_STR_CHAR_CR @@ -436,6 +484,7 @@ # define STR_CHAR_CARRIAGE_RETURN LIBSIMPLE_STR_CHAR_CARRIAGE_RETURN #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_SO "\x0E" #ifndef STR_CHAR_SO # define STR_CHAR_SO LIBSIMPLE_STR_CHAR_SO @@ -445,6 +494,7 @@ # define STR_CHAR_SHIFT_OUT LIBSIMPLE_STR_CHAR_SHIFT_OUT #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_SI "\x0F" #ifndef STR_CHAR_SI # define STR_CHAR_SI LIBSIMPLE_STR_CHAR_SI @@ -454,6 +504,7 @@ # define STR_CHAR_SHIFT_IN LIBSIMPLE_STR_CHAR_SHIFT_IN #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_DLE "\x10" #ifndef STR_CHAR_DLE # define STR_CHAR_DLE LIBSIMPLE_STR_CHAR_DLE @@ -463,6 +514,7 @@ # define STR_CHAR_DATA_LINK_ESCAPE LIBSIMPLE_STR_CHAR_DATA_LINK_ESCAPE #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_DC1 "\x11" #ifndef STR_CHAR_DC1 # define STR_CHAR_DC1 LIBSIMPLE_STR_CHAR_DC1 @@ -472,6 +524,7 @@ # define STR_CHAR_DEVICE_CONTROL_1 LIBSIMPLE_STR_CHAR_DEVICE_CONTROL_1 #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_DC2 "\x12" #ifndef STR_CHAR_DC2 # define STR_CHAR_DC2 LIBSIMPLE_STR_CHAR_DC2 @@ -481,6 +534,7 @@ # define STR_CHAR_DEVICE_CONTROL_2 LIBSIMPLE_STR_CHAR_DEVICE_CONTROL_2 #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_DC3 "\x13" #ifndef STR_CHAR_DC3 # define STR_CHAR_DC3 LIBSIMPLE_STR_CHAR_DC3 @@ -490,6 +544,7 @@ # define STR_CHAR_DEVICE_CONTROL_3 LIBSIMPLE_STR_CHAR_DEVICE_CONTROL_3 #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_DC4 "\x14" #ifndef STR_CHAR_DC4 # define STR_CHAR_DC4 LIBSIMPLE_STR_CHAR_DC4 @@ -499,6 +554,7 @@ # define STR_CHAR_DEVICE_CONTROL_4 LIBSIMPLE_STR_CHAR_DEVICE_CONTROL_4 #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_NAK "\x15" #ifndef STR_CHAR_NAK # define STR_CHAR_NAK LIBSIMPLE_STR_CHAR_NAK @@ -508,6 +564,7 @@ # define STR_CHAR_NEGATIVE_ACKNOWLEDGE LIBSIMPLE_STR_CHAR_NEGATIVE_ACKNOWLEDGE #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_SYN "\x16" #ifndef STR_CHAR_SYN # define STR_CHAR_SYN LIBSIMPLE_STR_CHAR_SYN @@ -517,6 +574,7 @@ # define STR_CHAR_SYNCHRONOUS_IDLE LIBSIMPLE_STR_CHAR_SYNCHRONOUS_IDLE #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_ETB "\x17" #ifndef STR_CHAR_ETB # define STR_CHAR_ETB LIBSIMPLE_STR_CHAR_ETB @@ -526,6 +584,7 @@ # define STR_CHAR_END_OF_TRANSMISSION_BLOCK LIBSIMPLE_STR_CHAR_END_OF_TRANSMISSION_BLOCK #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_CAN "\x18" #ifndef STR_CHAR_CAN # define STR_CHAR_CAN LIBSIMPLE_STR_CHAR_CAN @@ -535,6 +594,7 @@ # define STR_CHAR_CANCEL LIBSIMPLE_STR_CHAR_CANCEL #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_EM "\x19" #ifndef STR_CHAR_EM # define STR_CHAR_EM LIBSIMPLE_STR_CHAR_EM @@ -544,6 +604,7 @@ # define STR_CHAR_END_OF_MEDIUM LIBSIMPLE_STR_CHAR_END_OF_MEDIUM #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_SUB "\x1A" #ifndef STR_CHAR_SUB # define STR_CHAR_SUB LIBSIMPLE_STR_CHAR_SUB @@ -553,6 +614,7 @@ # define STR_CHAR_SUBSTITUTE LIBSIMPLE_STR_CHAR_SUBSTITUTE #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_ESC "\x1B" #ifndef STR_CHAR_ESC # define STR_CHAR_ESC LIBSIMPLE_STR_CHAR_ESC @@ -562,6 +624,7 @@ # define STR_CHAR_ESCAPE LIBSIMPLE_STR_CHAR_ESCAPE #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_FS "\x1C" #ifndef STR_CHAR_FS # define STR_CHAR_FS LIBSIMPLE_STR_CHAR_FS @@ -571,6 +634,7 @@ # define STR_CHAR_FILE_SEPARATOR LIBSIMPLE_STR_CHAR_FILE_SEPARATOR #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_GS "\x1D" #ifndef STR_CHAR_GS # define STR_CHAR_GS LIBSIMPLE_STR_CHAR_GS @@ -580,6 +644,7 @@ # define STR_CHAR_GROUP_SEPARATOR LIBSIMPLE_STR_CHAR_GROUP_SEPARATOR #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_RS "\x1E" #ifndef STR_CHAR_RS # define STR_CHAR_RS LIBSIMPLE_STR_CHAR_RS @@ -589,6 +654,7 @@ # define STR_CHAR_RECORD_SEPARATOR LIBSIMPLE_STR_CHAR_RECORD_SEPARATOR #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_US "\x1F" #ifndef STR_CHAR_US # define STR_CHAR_US LIBSIMPLE_STR_CHAR_US @@ -598,6 +664,7 @@ # define STR_CHAR_UNIT_SEPARATOR LIBSIMPLE_STR_CHAR_UNIT_SEPARATOR #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_SP "\x20" #ifndef STR_CHAR_SP # define STR_CHAR_SP LIBSIMPLE_STR_CHAR_SP @@ -607,6 +674,7 @@ # define STR_CHAR_SPACE LIBSIMPLE_STR_CHAR_SPACE #endif +/* @since 1.6 */ #define LIBSIMPLE_STR_CHAR_DEL "\x7F" #ifndef STR_CHAR_DEL # define STR_CHAR_DEL LIBSIMPLE_STR_CHAR_DEL @@ -620,6 +688,7 @@ #define LIBSIMPLE_LIST_ASCII_CONTROL_CHARS__(X, ABBR, FULL, NAME)\ X(LIBSIMPLE_CHAR_##ABBR, LIBSIMPLE_STR_CHAR_##ABBR, #ABBR, ABBR, #FULL, FULL, NAME) +/* @since 1.6 */ #define LIBSIMPLE_LIST_ASCII_CONTROL_CHARS(X, D)\ LIBSIMPLE_LIST_ASCII_CONTROL_CHARS__(X, NUL, NULL, "null") D\ LIBSIMPLE_LIST_ASCII_CONTROL_CHARS__(X, SOH, START_OF_HEADING, "start of heading") D\ diff --git a/libsimple/exec.h b/libsimple/exec.h index bc61628..5d27dc4 100644 --- a/libsimple/exec.h +++ b/libsimple/exec.h @@ -3,96 +3,118 @@ /* TODO man, doc, test */ +/* @since 1.6 */ const char *libsimple_which(const char *file, int cwdfd, const char *path, char **free_this_out); +/* @since 1.6 */ int libsimple_xexecv(int dirfd, const char *file, int atflags, const char *path, char *const *envp, char *const *argv); +/* @since 1.6 */ int libsimple_vxexecl(int dirfd, const char *file, int atflags, const char *path, char *const *envp, va_list argv_null); +/* @since 1.6 */ int libsimple_xexecl(int dirfd, const char *file, int atflags, const char *path, char *const *envp, ... /* argv, NULL */); +/* @since 1.6 */ int libsimple_vxexecle(int dirfd, const char *file, int atflags, const char *path, va_list argv_null_envp); +/* @since 1.6 */ int libsimple_execlpe(const char *file, ... /* argv, NULL, char *const envp[] */); #ifndef execlpe # define execlpe libsimple_execlpe #endif +/* @since 1.6 */ int libsimple_vexecl(const char *pathname, va_list argv_null); #ifndef vexecl # define vexecl libsimple_vexecl #endif +/* @since 1.6 */ int libsimple_vexecle(const char *pathname, va_list argv_null_envp); #ifndef vexecle # define vexecle libsimple_vexecle #endif +/* @since 1.6 */ int libsimple_vexeclp(const char *file, va_list argv_null); #ifndef vexeclp # define vexeclp libsimple_vexeclp #endif +/* @since 1.6 */ int libsimple_vexeclpe(const char *file, va_list argv_null_envp); #ifndef vexeclpe # define vexeclpe libsimple_vexeclpe #endif +/* @since 1.6 */ int libsimple_execvpe(const char *file, char *const argv[], char *const envp[]); #ifndef execvpe # define execvpe libsimple_execvpe #endif +/* @since 1.6 */ int libsimple_vfexecl(int fd, va_list argv_null); #ifndef vfexecl # define vfexecl libsimple_vfexecl #endif +/* @since 1.6 */ int libsimple_vfexecle(int fd, va_list argv_null_envp); #ifndef vfexecle # define vfexecle libsimple_vfexecle #endif +/* @since 1.6 */ int libsimple_fexecl(int fd, ... /* argv, NULL */); #ifndef fexecl # define fexecl libsimple_fexecl #endif +/* @since 1.6 */ int libsimple_fexecle(int fd, ... /* argv, NULL, char *const envp[] */); #ifndef fexecle # define fexecle libsimple_fexecle #endif +/* @since 1.6 */ int libsimple_fexecv(int fd, char *const argv[]); #ifndef fexecv # define fexecv libsimple_fexecv #endif +/* @since 1.6 */ int libsimple_execveat(int dirfd, const char *pathname, char *const argv[], char *const envp[], int flags); #ifndef execveat # define execveat libsimple_execveat #endif +/* @since 1.6 */ int libsimple_execvat(int dirfd, const char *pathname, char *const argv[], int flags); #ifndef execvat # define execvat libsimple_execvat #endif +/* @since 1.6 */ int libsimple_execleat(int dirfd, const char *pathname, ... /* argv, NULL, char *const envp[], int flags */); #ifndef execleat # define execleat libsimple_execleat #endif +/* @since 1.6 */ int libsimple_execlat(int dirfd, const char *pathname, ... /* argv, NULL, int flags */); #ifndef execlat # define execlat libsimple_execlat #endif +/* @since 1.6 */ int libsimple_vexecleat(int dirfd, const char *pathname, va_list argv_null_envp_flags); #ifndef vexecleat # define vexecleat libsimple_execlpe #endif +/* @since 1.6 */ int libsimple_vexeclat(int dirfd, const char *pathname, va_list argv_null_flags); #ifndef vexeclat # define vexeclat libsimple_vexeclat diff --git a/libsimple/net.h b/libsimple/net.h index c30020b..bbe2a6c 100644 --- a/libsimple/net.h +++ b/libsimple/net.h @@ -12,5 +12,7 @@ * name of the file the socket will be bound to * @param addrlen_out Output parameter for the size of the socket name (may be `NULL`) * @return 0 on success, -1 on failure + * + * @since 1.6 */ int libsimple_bindtemp_un(int fd, int dir_fd, struct sockaddr_un *addr_out, socklen_t *addrlen_out); /* TODO man */ diff --git a/libsimple/path.h b/libsimple/path.h index cb78863..0d6e44c 100644 --- a/libsimple/path.h +++ b/libsimple/path.h @@ -5,6 +5,8 @@ * Get the current working directory * * @return The current working directory, or `NULL` on failure + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__))) char *libsimple_getcwd(void); /* TODO man */ @@ -14,6 +16,8 @@ char *libsimple_getcwd(void); /* TODO man */ * * @param status Exit value in case of failure * @return The current working directory + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __returns_nonnull__))) char *libsimple_engetcwd(int); /* TODO man */ @@ -22,6 +26,8 @@ char *libsimple_engetcwd(int); /* TODO man */ * Version of `libsimple_getcwd` that calls `libsimple_eprintf` on error * * @return The current working directory + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __returns_nonnull__))) inline char * @@ -38,6 +44,8 @@ libsimple_egetcwd(void) /* TODO man */ * @param relto The directory `path` is relative to if it is a relative path, * `NULL` for the current working directory * @return `path` as an absolute path, or `NULL` on failure + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__(1)))) char *libsimple_abspath(const char *, const char *); /* TODO man */ @@ -50,6 +58,8 @@ char *libsimple_abspath(const char *, const char *); /* TODO man */ * @param relto The directory `path` is relative to if it is a relative path, * `NULL` for the current working directory * @return `path` as an absolute path + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__(2), __returns_nonnull__))) char *libsimple_enabspath(int, const char *, const char *); /* TODO man */ @@ -61,6 +71,8 @@ char *libsimple_enabspath(int, const char *, const char *); /* TODO man */ * @param relto The directory `path` is relative to if it is a relative path, * `NULL` for the current working directory * @return `path` as an absolute path + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__(1), __returns_nonnull__))) inline char * @@ -71,14 +83,14 @@ libsimple_eabspath(const char *p__, const char *r__) /* TODO man */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__))) -char *libsimple_readlinkat(int, const char *); /* TODO man, doc */ +char *libsimple_readlinkat(int, const char *); /* TODO man, doc (since 1.6) */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__, __returns_nonnull__))) -char *libsimple_enreadlinkat(int, int, const char *); /* TODO man, doc */ +char *libsimple_enreadlinkat(int, int, const char *); /* TODO man, doc (since 1.6) */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__, __returns_nonnull__))) inline char * -libsimple_ereadlinkat(int dirfd__, const char *path__) /* TODO man, doc */ +libsimple_ereadlinkat(int dirfd__, const char *path__) /* TODO man, doc (since 1.6) */ { return libsimple_enreadlinkat(libsimple_default_failure_exit, dirfd__, path__); } @@ -86,70 +98,70 @@ libsimple_ereadlinkat(int dirfd__, const char *path__) /* TODO man, doc */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__))) inline char * -libsimple_readlink(const char *path__) /* TODO man, doc */ +libsimple_readlink(const char *path__) /* TODO man, doc (since 1.6) */ { return libsimple_readlinkat(AT_FDCWD, path__); } LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__, __returns_nonnull__))) inline char * -libsimple_enreadlink(int status__, const char *path__) /* TODO man, doc */ +libsimple_enreadlink(int status__, const char *path__) /* TODO man, doc (since 1.6) */ { return libsimple_enreadlinkat(status__, AT_FDCWD, path__); } LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__, __returns_nonnull__))) inline char * -libsimple_ereadlink(const char *path__) /* TODO man, doc */ +libsimple_ereadlink(const char *path__) /* TODO man, doc (since 1.6) */ { return libsimple_enreadlinkat(libsimple_default_failure_exit, AT_FDCWD, path__); } LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__))) inline char * -libsimple_freadlink(int fd__) /* TODO man, doc */ +libsimple_freadlink(int fd__) /* TODO man, doc (since 1.6) */ { return libsimple_readlinkat(fd__, ""); } LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__, __returns_nonnull__))) inline char * -libsimple_enfreadlink(int status__, int fd__) /* TODO man, doc */ +libsimple_enfreadlink(int status__, int fd__) /* TODO man, doc (since 1.6) */ { return libsimple_enreadlinkat(status__, fd__, ""); } LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__, __returns_nonnull__))) inline char * -libsimple_efreadlink(int fd__) /* TODO man, doc */ +libsimple_efreadlink(int fd__) /* TODO man, doc (since 1.6) */ { return libsimple_enreadlinkat(libsimple_default_failure_exit, fd__, ""); } LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__))) -char *libsimple_readmagiclink(const char *); /* TODO man, doc */ +char *libsimple_readmagiclink(const char *); /* TODO man, doc (since 1.6) */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__, __returns_nonnull__))) -char *libsimple_enreadmagiclink(int, const char *); /* TODO man, doc */ +char *libsimple_enreadmagiclink(int, const char *); /* TODO man, doc (since 1.6) */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__, __returns_nonnull__))) inline char * -libsimple_ereadmagiclink(const char *path__) /* TODO man, doc */ +libsimple_ereadmagiclink(const char *path__) /* TODO man, doc (since 1.6) */ { return libsimple_enreadmagiclink(libsimple_default_failure_exit, path__); } LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__))) -char *libsimple_getexecpath(void); /* TODO man, doc */ +char *libsimple_getexecpath(void); /* TODO man, doc (since 1.6) */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__, __returns_nonnull__))) -char *libsimple_engetexecpath(int); /* TODO man, doc */ +char *libsimple_engetexecpath(int); /* TODO man, doc (since 1.6) */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __assume_aligned__(1), __warn_unused_result__, __nonnull__, __returns_nonnull__))) inline char * -libsimple_egetexecpath(void) /* TODO man, doc */ +libsimple_egetexecpath(void) /* TODO man, doc (since 1.6) */ { return libsimple_engetexecpath(libsimple_default_failure_exit); } diff --git a/libsimple/printf.h b/libsimple/printf.h index 90d15a8..b295eff 100644 --- a/libsimple/printf.h +++ b/libsimple/printf.h @@ -281,6 +281,8 @@ libsimple_venprintf(int status__, const char *fmt__, va_list ap__) * @param status Exit value for the process * @param fmt The format string * @param ap The format argument + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(2), __format__(__printf__, 2, 0)))) inline LIBSIMPLE_NORETURN void @@ -351,6 +353,8 @@ libsimple_enprintf(int status__, const char *fmt__, ...) * @param status Exit value for the process * @param fmt The format string * @param ... The format argument + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(2), __format__(__printf__, 2, 3)))) inline LIBSIMPLE_NORETURN void @@ -421,6 +425,8 @@ libsimple_veprintf(const char *fmt__, va_list ap__) * * @param fmt The format string * @param ap The format argument + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __format__(__printf__, 1, 0)))) inline LIBSIMPLE_NORETURN void @@ -491,6 +497,8 @@ libsimple_eprintf(const char *fmt__, ...) * * @param fmt The format string * @param ... The format argument + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__nonnull__(1), __format__(__printf__, 1, 2)))) inline LIBSIMPLE_NORETURN void diff --git a/libsimple/random.h b/libsimple/random.h index a3b1739..29e3bbf 100644 --- a/libsimple/random.h +++ b/libsimple/random.h @@ -5,6 +5,8 @@ * Creates a pseudo-random seed * * @return The pseudo-random seed + * + * @since 1.6 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__warn_unused_result__))) unsigned int libsimple_generate_seed(void); /* TODO add man page */ @@ -14,6 +16,8 @@ unsigned int libsimple_generate_seed(void); /* TODO add man page */ * Wrapper for srand(3) that creates a pseudo-random * seed with which it seeds the pseudo-random number * generator + * + * @since 1.6 */ inline void libsimple_srand(void) /* TODO add man page */ @@ -22,7 +26,7 @@ libsimple_srand(void) /* TODO add man page */ } -/* TODO doc, man (libsimple_random_float requires -lm) */ +/* TODO doc, man (since 1.6) (libsimple_random_float requires -lm) */ uintmax_t libsimple_random_bits(size_t bits, void *unused); uintmax_t libsimple_random_unsigned(uintmax_t (*rng)(size_t bits, void *user), void *user, uintmax_t min, uintmax_t max); intmax_t libsimple_random_signed(uintmax_t (*rng)(size_t bits, void *user), void *user, intmax_t min, intmax_t max); diff --git a/libsimple/sort.h b/libsimple/sort.h index 77929d1..4d8c4ce 100644 --- a/libsimple/sort.h +++ b/libsimple/sort.h @@ -117,1731 +117,2307 @@ return -FUNC(**L##_typed, **R##_typed) +/* @since 1.6 */ inline int libsimple_cmp_ucharp(const unsigned char *a, const unsigned char *b) { LIBSIMPLE_CMP_NUMP__(unsigned char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uchar(unsigned char base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ucharp); } +/* @since 1.6 */ inline int libsimple_cmp_ucharpp(unsigned char *const *a, unsigned char *const *b) { LIBSIMPLE_CMP_NUMPP__(unsigned char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ucharp(unsigned char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ucharpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_ucharpp(unsigned char *const *a, unsigned char *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(unsigned char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_ucharp(unsigned char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_ucharpp); } +/* @since 1.6 */ inline int libsimple_cmp_ucharpp_nul(unsigned char *const *a, unsigned char *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(unsigned char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ucharp_nul(unsigned char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ucharpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ucharp(const unsigned char *a, const unsigned char *b) { LIBSIMPLE_CMP_REV_NUMP__(unsigned char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uchar(unsigned char base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ucharp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ucharpp(unsigned char *const *a, unsigned char *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(unsigned char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ucharp(unsigned char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ucharpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_ucharpp(unsigned char *const *a, unsigned char *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(unsigned char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_ucharp(unsigned char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_ucharpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ucharpp_nul(unsigned char *const *a, unsigned char *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(unsigned char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ucharp_nul(unsigned char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ucharpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_scharp(const signed char *a, const signed char *b) { LIBSIMPLE_CMP_NUMP__(signed char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_schar(signed char base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_scharp); } +/* @since 1.6 */ inline int libsimple_cmp_scharpp(signed char *const *a, signed char *const *b) { LIBSIMPLE_CMP_NUMPP__(signed char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_scharp(signed char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_scharpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_scharpp(signed char *const *a, signed char *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(signed char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_scharp(signed char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_scharpp); } +/* @since 1.6 */ inline int libsimple_cmp_scharpp_nul(signed char *const *a, signed char *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(signed char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_scharp_nul(signed char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_scharpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_scharp(const signed char *a, const signed char *b) { LIBSIMPLE_CMP_REV_NUMP__(signed char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_schar(signed char base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_scharp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_scharpp(signed char *const *a, signed char *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(signed char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_scharp(signed char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_scharpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_scharpp(signed char *const *a, signed char *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(signed char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_scharp(signed char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_scharpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_scharpp_nul(signed char *const *a, signed char *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(signed char, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_scharp_nul(signed char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_scharpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_shortp(const short int *a, const short int *b) { LIBSIMPLE_CMP_NUMP__(short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_short(short int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_shortp); } +/* @since 1.6 */ inline int libsimple_cmp_shortpp(short int *const *a, short int *const *b) { LIBSIMPLE_CMP_NUMPP__(short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_shortp(short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_shortpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_shortpp(short int *const *a, short int *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_shortp(short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_shortpp); } +/* @since 1.6 */ inline int libsimple_cmp_shortpp_nul(short int *const *a, short int *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_shortp_nul(short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_shortpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_shortp(const short int *a, const short int *b) { LIBSIMPLE_CMP_REV_NUMP__(short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_short(short int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_shortp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_shortpp(short int *const *a, short int *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_shortp(short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_shortpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_shortpp(short int *const *a, short int *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_shortp(short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_shortpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_shortpp_nul(short int *const *a, short int *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_shortp_nul(short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_shortpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_ushortp(const unsigned short int *a, const unsigned short int *b) { LIBSIMPLE_CMP_NUMP__(unsigned short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ushort(unsigned short int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ushortp); } +/* @since 1.6 */ inline int libsimple_cmp_ushortpp(unsigned short int *const *a, unsigned short int *const *b) { LIBSIMPLE_CMP_NUMPP__(unsigned short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ushortp(unsigned short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ushortpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_ushortpp(unsigned short int *const *a, unsigned short int *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(unsigned short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_ushortp(unsigned short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_ushortpp); } +/* @since 1.6 */ inline int libsimple_cmp_ushortpp_nul(unsigned short int *const *a, unsigned short int *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(unsigned short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ushortp_nul(unsigned short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ushortpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ushortp(const unsigned short int *a, const unsigned short int *b) { LIBSIMPLE_CMP_REV_NUMP__(unsigned short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ushort(unsigned short int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ushortp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ushortpp(unsigned short int *const *a, unsigned short int *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(unsigned short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ushortp(unsigned short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ushortpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_ushortpp(unsigned short int *const *a, unsigned short int *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(unsigned short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_ushortp(unsigned short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_ushortpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ushortpp_nul(unsigned short int *const *a, unsigned short int *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(unsigned short int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ushortp_nul(unsigned short int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ushortpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_intp(const int *a, const int *b) { LIBSIMPLE_CMP_NUMP__(int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int(int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_intp); } +/* @since 1.6 */ inline int libsimple_cmp_intpp(int *const *a, int *const *b) { LIBSIMPLE_CMP_NUMPP__(int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_intp(int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_intpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_intpp(int *const *a, int *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_intp(int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_intpp); } +/* @since 1.6 */ inline int libsimple_cmp_intpp_nul(int *const *a, int *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_intp_nul(int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_intpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_intp(const int *a, const int *b) { LIBSIMPLE_CMP_REV_NUMP__(int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int(int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_intp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_intpp(int *const *a, int *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_intp(int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_intpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_intpp(int *const *a, int *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_intp(int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_intpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_intpp_nul(int *const *a, int *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_intp_nul(int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_intpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uintp(const unsigned int *a, const unsigned int *b) { LIBSIMPLE_CMP_NUMP__(unsigned int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint(unsigned int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uintp); } +/* @since 1.6 */ inline int libsimple_cmp_uintpp(unsigned int *const *a, unsigned int *const *b) { LIBSIMPLE_CMP_NUMPP__(unsigned int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uintp(unsigned int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uintpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uintpp(unsigned int *const *a, unsigned int *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(unsigned int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uintp(unsigned int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uintpp); } +/* @since 1.6 */ inline int libsimple_cmp_uintpp_nul(unsigned int *const *a, unsigned int *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(unsigned int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uintp_nul(unsigned int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uintpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uintp(const unsigned int *a, const unsigned int *b) { LIBSIMPLE_CMP_REV_NUMP__(unsigned int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint(unsigned int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uintp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uintpp(unsigned int *const *a, unsigned int *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(unsigned int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uintp(unsigned int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uintpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uintpp(unsigned int *const *a, unsigned int *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(unsigned int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uintp(unsigned int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uintpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uintpp_nul(unsigned int *const *a, unsigned int *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(unsigned int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uintp_nul(unsigned int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uintpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_longp(const long int *a, const long int *b) { LIBSIMPLE_CMP_NUMP__(long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_long(long int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_longp); } +/* @since 1.6 */ inline int libsimple_cmp_longpp(long int *const *a, long int *const *b) { LIBSIMPLE_CMP_NUMPP__(long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_longp(long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_longpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_longpp(long int *const *a, long int *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_longp(long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_longpp); } +/* @since 1.6 */ inline int libsimple_cmp_longpp_nul(long int *const *a, long int *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_longp_nul(long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_longpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_longp(const long int *a, const long int *b) { LIBSIMPLE_CMP_REV_NUMP__(long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_long(long int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_longp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_longpp(long int *const *a, long int *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_longp(long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_longpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_longpp(long int *const *a, long int *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_longp(long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_longpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_longpp_nul(long int *const *a, long int *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_longp_nul(long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_longpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_ulongp(const unsigned long int *a, const unsigned long int *b) { LIBSIMPLE_CMP_NUMP__(unsigned long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ulong(unsigned long int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ulongp); } +/* @since 1.6 */ inline int libsimple_cmp_ulongpp(unsigned long int *const *a, unsigned long int *const *b) { LIBSIMPLE_CMP_NUMPP__(unsigned long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ulongp(unsigned long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ulongpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_ulongpp(unsigned long int *const *a, unsigned long int *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(unsigned long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_ulongp(unsigned long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_ulongpp); } +/* @since 1.6 */ inline int libsimple_cmp_ulongpp_nul(unsigned long int *const *a, unsigned long int *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(unsigned long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ulongp_nul(unsigned long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ulongpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ulongp(const unsigned long int *a, const unsigned long int *b) { LIBSIMPLE_CMP_REV_NUMP__(unsigned long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ulong(unsigned long int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ulongp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ulongpp(unsigned long int *const *a, unsigned long int *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(unsigned long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ulongp(unsigned long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ulongpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_ulongpp(unsigned long int *const *a, unsigned long int *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(unsigned long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_ulongp(unsigned long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_ulongpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ulongpp_nul(unsigned long int *const *a, unsigned long int *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(unsigned long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ulongp_nul(unsigned long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ulongpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_llongp(const long long int *a, const long long int *b) { LIBSIMPLE_CMP_NUMP__(long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_llong(long long int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_llongp); } +/* @since 1.6 */ inline int libsimple_cmp_llongpp(long long int *const *a, long long int *const *b) { LIBSIMPLE_CMP_NUMPP__(long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_llongp(long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_llongpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_llongpp(long long int *const *a, long long int *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_llongp(long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_llongpp); } +/* @since 1.6 */ inline int libsimple_cmp_llongpp_nul(long long int *const *a, long long int *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_llongp_nul(long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_llongpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_llongp(const long long int *a, const long long int *b) { LIBSIMPLE_CMP_REV_NUMP__(long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_llong(long long int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_llongp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_llongpp(long long int *const *a, long long int *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_llongp(long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_llongpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_llongpp(long long int *const *a, long long int *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_llongp(long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_llongpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_llongpp_nul(long long int *const *a, long long int *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_llongp_nul(long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_llongpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_ullongp(const unsigned long long int *a, const unsigned long long int *b) { LIBSIMPLE_CMP_NUMP__(unsigned long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ullong(unsigned long long int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ullongp); } +/* @since 1.6 */ inline int libsimple_cmp_ullongpp(unsigned long long int *const *a, unsigned long long int *const *b) { LIBSIMPLE_CMP_NUMPP__(unsigned long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ullongp(unsigned long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ullongpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_ullongpp(unsigned long long int *const *a, unsigned long long int *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(unsigned long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_ullongp(unsigned long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_ullongpp); } +/* @since 1.6 */ inline int libsimple_cmp_ullongpp_nul(unsigned long long int *const *a, unsigned long long int *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(unsigned long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ullongp_nul(unsigned long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ullongpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ullongp(const unsigned long long int *a, const unsigned long long int *b) { LIBSIMPLE_CMP_REV_NUMP__(unsigned long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ullong(unsigned long long int base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ullongp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ullongpp(unsigned long long int *const *a, unsigned long long int *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(unsigned long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ullongp(unsigned long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ullongpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_ullongpp(unsigned long long int *const *a, unsigned long long int *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(unsigned long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_ullongp(unsigned long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_ullongpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ullongpp_nul(unsigned long long int *const *a, unsigned long long int *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(unsigned long long int, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ullongp_nul(unsigned long long int *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ullongpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_int8p(const int8_t *a, const int8_t *b) { LIBSIMPLE_CMP_NUMP__(int8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int8(int8_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int8p); } +/* @since 1.6 */ inline int libsimple_cmp_int8pp(int8_t *const *a, int8_t *const *b) { LIBSIMPLE_CMP_NUMPP__(int8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int8p(int8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int8pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_int8pp(int8_t *const *a, int8_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(int8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_int8p(int8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_int8pp); } +/* @since 1.6 */ inline int libsimple_cmp_int8pp_nul(int8_t *const *a, int8_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(int8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int8p_nul(int8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int8pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int8p(const int8_t *a, const int8_t *b) { LIBSIMPLE_CMP_REV_NUMP__(int8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int8(int8_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int8p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int8pp(int8_t *const *a, int8_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(int8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int8p(int8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int8pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_int8pp(int8_t *const *a, int8_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(int8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_int8p(int8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_int8pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int8pp_nul(int8_t *const *a, int8_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(int8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int8p_nul(int8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int8pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uint8p(const uint8_t *a, const uint8_t *b) { LIBSIMPLE_CMP_NUMP__(uint8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint8(uint8_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint8p); } +/* @since 1.6 */ inline int libsimple_cmp_uint8pp(uint8_t *const *a, uint8_t *const *b) { LIBSIMPLE_CMP_NUMPP__(uint8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint8p(uint8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint8pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uint8pp(uint8_t *const *a, uint8_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(uint8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uint8p(uint8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uint8pp); } +/* @since 1.6 */ inline int libsimple_cmp_uint8pp_nul(uint8_t *const *a, uint8_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(uint8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint8p_nul(uint8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint8pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint8p(const uint8_t *a, const uint8_t *b) { LIBSIMPLE_CMP_REV_NUMP__(uint8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint8(uint8_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint8p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint8pp(uint8_t *const *a, uint8_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(uint8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint8p(uint8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint8pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uint8pp(uint8_t *const *a, uint8_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(uint8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uint8p(uint8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uint8pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint8pp_nul(uint8_t *const *a, uint8_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(uint8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint8p_nul(uint8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint8pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_int16p(const int16_t *a, const int16_t *b) { LIBSIMPLE_CMP_NUMP__(int16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int16(int16_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int16p); } +/* @since 1.6 */ inline int libsimple_cmp_int16pp(int16_t *const *a, int16_t *const *b) { LIBSIMPLE_CMP_NUMPP__(int16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int16p(int16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int16pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_int16pp(int16_t *const *a, int16_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(int16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_int16p(int16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_int16pp); } +/* @since 1.6 */ inline int libsimple_cmp_int16pp_nul(int16_t *const *a, int16_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(int16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int16p_nul(int16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int16pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int16p(const int16_t *a, const int16_t *b) { LIBSIMPLE_CMP_REV_NUMP__(int16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int16(int16_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int16p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int16pp(int16_t *const *a, int16_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(int16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int16p(int16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int16pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_int16pp(int16_t *const *a, int16_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(int16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_int16p(int16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_int16pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int16pp_nul(int16_t *const *a, int16_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(int16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int16p_nul(int16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int16pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uint16p(const uint16_t *a, const uint16_t *b) { LIBSIMPLE_CMP_NUMP__(uint16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint16(uint16_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint16p); } +/* @since 1.6 */ inline int libsimple_cmp_uint16pp(uint16_t *const *a, uint16_t *const *b) { LIBSIMPLE_CMP_NUMPP__(uint16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint16p(uint16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint16pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uint16pp(uint16_t *const *a, uint16_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(uint16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uint16p(uint16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uint16pp); } +/* @since 1.6 */ inline int libsimple_cmp_uint16pp_nul(uint16_t *const *a, uint16_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(uint16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint16p_nul(uint16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint16pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint16p(const uint16_t *a, const uint16_t *b) { LIBSIMPLE_CMP_REV_NUMP__(uint16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint16(uint16_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint16p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint16pp(uint16_t *const *a, uint16_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(uint16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint16p(uint16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint16pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uint16pp(uint16_t *const *a, uint16_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(uint16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uint16p(uint16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uint16pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint16pp_nul(uint16_t *const *a, uint16_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(uint16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint16p_nul(uint16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint16pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_int32p(const int32_t *a, const int32_t *b) { LIBSIMPLE_CMP_NUMP__(int32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int32(int32_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int32p); } +/* @since 1.6 */ inline int libsimple_cmp_int32pp(int32_t *const *a, int32_t *const *b) { LIBSIMPLE_CMP_NUMPP__(int32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int32p(int32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int32pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_int32pp(int32_t *const *a, int32_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(int32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_int32p(int32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_int32pp); } +/* @since 1.6 */ inline int libsimple_cmp_int32pp_nul(int32_t *const *a, int32_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(int32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int32p_nul(int32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int32pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int32p(const int32_t *a, const int32_t *b) { LIBSIMPLE_CMP_REV_NUMP__(int32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int32(int32_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int32p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int32pp(int32_t *const *a, int32_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(int32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int32p(int32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int32pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_int32pp(int32_t *const *a, int32_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(int32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_int32p(int32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_int32pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int32pp_nul(int32_t *const *a, int32_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(int32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int32p_nul(int32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int32pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uint32p(const uint32_t *a, const uint32_t *b) { LIBSIMPLE_CMP_NUMP__(uint32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint32(uint32_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint32p); } +/* @since 1.6 */ inline int libsimple_cmp_uint32pp(uint32_t *const *a, uint32_t *const *b) { LIBSIMPLE_CMP_NUMPP__(uint32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint32p(uint32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint32pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uint32pp(uint32_t *const *a, uint32_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(uint32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uint32p(uint32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uint32pp); } +/* @since 1.6 */ inline int libsimple_cmp_uint32pp_nul(uint32_t *const *a, uint32_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(uint32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint32p_nul(uint32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint32pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint32p(const uint32_t *a, const uint32_t *b) { LIBSIMPLE_CMP_REV_NUMP__(uint32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint32(uint32_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint32p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint32pp(uint32_t *const *a, uint32_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(uint32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint32p(uint32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint32pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uint32pp(uint32_t *const *a, uint32_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(uint32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uint32p(uint32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uint32pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint32pp_nul(uint32_t *const *a, uint32_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(uint32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint32p_nul(uint32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint32pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_int64p(const int64_t *a, const int64_t *b) { LIBSIMPLE_CMP_NUMP__(int64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int64(int64_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int64p); } +/* @since 1.6 */ inline int libsimple_cmp_int64pp(int64_t *const *a, int64_t *const *b) { LIBSIMPLE_CMP_NUMPP__(int64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int64p(int64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int64pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_int64pp(int64_t *const *a, int64_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(int64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_int64p(int64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_int64pp); } +/* @since 1.6 */ inline int libsimple_cmp_int64pp_nul(int64_t *const *a, int64_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(int64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int64p_nul(int64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int64pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int64p(const int64_t *a, const int64_t *b) { LIBSIMPLE_CMP_REV_NUMP__(int64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int64(int64_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int64p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int64pp(int64_t *const *a, int64_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(int64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int64p(int64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int64pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_int64pp(int64_t *const *a, int64_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(int64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_int64p(int64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_int64pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int64pp_nul(int64_t *const *a, int64_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(int64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int64p_nul(int64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int64pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uint64p(const uint64_t *a, const uint64_t *b) { LIBSIMPLE_CMP_NUMP__(uint64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint64(uint64_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint64p); } +/* @since 1.6 */ inline int libsimple_cmp_uint64pp(uint64_t *const *a, uint64_t *const *b) { LIBSIMPLE_CMP_NUMPP__(uint64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint64p(uint64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint64pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uint64pp(uint64_t *const *a, uint64_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(uint64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uint64p(uint64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uint64pp); } +/* @since 1.6 */ inline int libsimple_cmp_uint64pp_nul(uint64_t *const *a, uint64_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(uint64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint64p_nul(uint64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint64pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint64p(const uint64_t *a, const uint64_t *b) { LIBSIMPLE_CMP_REV_NUMP__(uint64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint64(uint64_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint64p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint64pp(uint64_t *const *a, uint64_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(uint64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint64p(uint64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint64pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uint64pp(uint64_t *const *a, uint64_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(uint64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uint64p(uint64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uint64pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint64pp_nul(uint64_t *const *a, uint64_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(uint64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint64p_nul(uint64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint64pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_int_least8p(const int_least8_t *a, const int_least8_t *b) { LIBSIMPLE_CMP_NUMP__(int_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least8(int_least8_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least8p); } +/* @since 1.6 */ inline int libsimple_cmp_int_least8pp(int_least8_t *const *a, int_least8_t *const *b) { LIBSIMPLE_CMP_NUMPP__(int_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least8p(int_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least8pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_int_least8pp(int_least8_t *const *a, int_least8_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(int_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_int_least8p(int_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_int_least8pp); } +/* @since 1.6 */ inline int libsimple_cmp_int_least8pp_nul(int_least8_t *const *a, int_least8_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(int_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least8p_nul(int_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least8pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least8p(const int_least8_t *a, const int_least8_t *b) { LIBSIMPLE_CMP_REV_NUMP__(int_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least8(int_least8_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least8p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least8pp(int_least8_t *const *a, int_least8_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(int_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least8p(int_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least8pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_int_least8pp(int_least8_t *const *a, int_least8_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(int_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_int_least8p(int_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_int_least8pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least8pp_nul(int_least8_t *const *a, int_least8_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(int_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least8p_nul(int_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least8pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least8p(const uint_least8_t *a, const uint_least8_t *b) { LIBSIMPLE_CMP_NUMP__(uint_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least8(uint_least8_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least8p); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least8pp(uint_least8_t *const *a, uint_least8_t *const *b) { LIBSIMPLE_CMP_NUMPP__(uint_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least8p(uint_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least8pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uint_least8pp(uint_least8_t *const *a, uint_least8_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(uint_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uint_least8p(uint_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uint_least8pp); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least8pp_nul(uint_least8_t *const *a, uint_least8_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(uint_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least8p_nul(uint_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least8pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least8p(const uint_least8_t *a, const uint_least8_t *b) { LIBSIMPLE_CMP_REV_NUMP__(uint_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least8(uint_least8_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least8p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least8pp(uint_least8_t *const *a, uint_least8_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(uint_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least8p(uint_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least8pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uint_least8pp(uint_least8_t *const *a, uint_least8_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(uint_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uint_least8p(uint_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uint_least8pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least8pp_nul(uint_least8_t *const *a, uint_least8_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(uint_least8_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least8p_nul(uint_least8_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least8pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_int_least16p(const int_least16_t *a, const int_least16_t *b) { LIBSIMPLE_CMP_NUMP__(int_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least16(int_least16_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least16p); } +/* @since 1.6 */ inline int libsimple_cmp_int_least16pp(int_least16_t *const *a, int_least16_t *const *b) { LIBSIMPLE_CMP_NUMPP__(int_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least16p(int_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least16pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_int_least16pp(int_least16_t *const *a, int_least16_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(int_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_int_least16p(int_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_int_least16pp); } +/* @since 1.6 */ inline int libsimple_cmp_int_least16pp_nul(int_least16_t *const *a, int_least16_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(int_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least16p_nul(int_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least16pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least16p(const int_least16_t *a, const int_least16_t *b) { LIBSIMPLE_CMP_REV_NUMP__(int_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least16(int_least16_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least16p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least16pp(int_least16_t *const *a, int_least16_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(int_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least16p(int_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least16pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_int_least16pp(int_least16_t *const *a, int_least16_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(int_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_int_least16p(int_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_int_least16pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least16pp_nul(int_least16_t *const *a, int_least16_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(int_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least16p_nul(int_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least16pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least16p(const uint_least16_t *a, const uint_least16_t *b) { LIBSIMPLE_CMP_NUMP__(uint_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least16(uint_least16_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least16p); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least16pp(uint_least16_t *const *a, uint_least16_t *const *b) { LIBSIMPLE_CMP_NUMPP__(uint_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least16p(uint_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least16pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uint_least16pp(uint_least16_t *const *a, uint_least16_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(uint_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uint_least16p(uint_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uint_least16pp); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least16pp_nul(uint_least16_t *const *a, uint_least16_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(uint_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least16p_nul(uint_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least16pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least16p(const uint_least16_t *a, const uint_least16_t *b) { LIBSIMPLE_CMP_REV_NUMP__(uint_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least16(uint_least16_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least16p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least16pp(uint_least16_t *const *a, uint_least16_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(uint_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least16p(uint_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least16pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uint_least16pp(uint_least16_t *const *a, uint_least16_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(uint_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uint_least16p(uint_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uint_least16pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least16pp_nul(uint_least16_t *const *a, uint_least16_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(uint_least16_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least16p_nul(uint_least16_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least16pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_int_least32p(const int_least32_t *a, const int_least32_t *b) { LIBSIMPLE_CMP_NUMP__(int_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least32(int_least32_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least32p); } +/* @since 1.6 */ inline int libsimple_cmp_int_least32pp(int_least32_t *const *a, int_least32_t *const *b) { LIBSIMPLE_CMP_NUMPP__(int_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least32p(int_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least32pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_int_least32pp(int_least32_t *const *a, int_least32_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(int_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_int_least32p(int_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_int_least32pp); } +/* @since 1.6 */ inline int libsimple_cmp_int_least32pp_nul(int_least32_t *const *a, int_least32_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(int_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least32p_nul(int_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least32pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least32p(const int_least32_t *a, const int_least32_t *b) { LIBSIMPLE_CMP_REV_NUMP__(int_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least32(int_least32_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least32p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least32pp(int_least32_t *const *a, int_least32_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(int_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least32p(int_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least32pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_int_least32pp(int_least32_t *const *a, int_least32_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(int_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_int_least32p(int_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_int_least32pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least32pp_nul(int_least32_t *const *a, int_least32_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(int_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least32p_nul(int_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least32pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least32p(const uint_least32_t *a, const uint_least32_t *b) { LIBSIMPLE_CMP_NUMP__(uint_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least32(uint_least32_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least32p); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least32pp(uint_least32_t *const *a, uint_least32_t *const *b) { LIBSIMPLE_CMP_NUMPP__(uint_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least32p(uint_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least32pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uint_least32pp(uint_least32_t *const *a, uint_least32_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(uint_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uint_least32p(uint_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uint_least32pp); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least32pp_nul(uint_least32_t *const *a, uint_least32_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(uint_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least32p_nul(uint_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least32pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least32p(const uint_least32_t *a, const uint_least32_t *b) { LIBSIMPLE_CMP_REV_NUMP__(uint_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least32(uint_least32_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least32p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least32pp(uint_least32_t *const *a, uint_least32_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(uint_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least32p(uint_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least32pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uint_least32pp(uint_least32_t *const *a, uint_least32_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(uint_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uint_least32p(uint_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uint_least32pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least32pp_nul(uint_least32_t *const *a, uint_least32_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(uint_least32_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least32p_nul(uint_least32_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least32pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_int_least64p(const int_least64_t *a, const int_least64_t *b) { LIBSIMPLE_CMP_NUMP__(int_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least64(int_least64_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least64p); } +/* @since 1.6 */ inline int libsimple_cmp_int_least64pp(int_least64_t *const *a, int_least64_t *const *b) { LIBSIMPLE_CMP_NUMPP__(int_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least64p(int_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least64pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_int_least64pp(int_least64_t *const *a, int_least64_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(int_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_int_least64p(int_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_int_least64pp); } +/* @since 1.6 */ inline int libsimple_cmp_int_least64pp_nul(int_least64_t *const *a, int_least64_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(int_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_int_least64p_nul(int_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_int_least64pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least64p(const int_least64_t *a, const int_least64_t *b) { LIBSIMPLE_CMP_REV_NUMP__(int_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least64(int_least64_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least64p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least64pp(int_least64_t *const *a, int_least64_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(int_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least64p(int_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least64pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_int_least64pp(int_least64_t *const *a, int_least64_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(int_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_int_least64p(int_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_int_least64pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_int_least64pp_nul(int_least64_t *const *a, int_least64_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(int_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_int_least64p_nul(int_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_int_least64pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least64p(const uint_least64_t *a, const uint_least64_t *b) { LIBSIMPLE_CMP_NUMP__(uint_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least64(uint_least64_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least64p); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least64pp(uint_least64_t *const *a, uint_least64_t *const *b) { LIBSIMPLE_CMP_NUMPP__(uint_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least64p(uint_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least64pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uint_least64pp(uint_least64_t *const *a, uint_least64_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(uint_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uint_least64p(uint_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uint_least64pp); } +/* @since 1.6 */ inline int libsimple_cmp_uint_least64pp_nul(uint_least64_t *const *a, uint_least64_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(uint_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uint_least64p_nul(uint_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uint_least64pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least64p(const uint_least64_t *a, const uint_least64_t *b) { LIBSIMPLE_CMP_REV_NUMP__(uint_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least64(uint_least64_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least64p); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least64pp(uint_least64_t *const *a, uint_least64_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(uint_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least64p(uint_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least64pp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uint_least64pp(uint_least64_t *const *a, uint_least64_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(uint_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uint_least64p(uint_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uint_least64pp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uint_least64pp_nul(uint_least64_t *const *a, uint_least64_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(uint_least64_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uint_least64p_nul(uint_least64_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uint_least64pp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_intmaxp(const intmax_t *a, const intmax_t *b) { LIBSIMPLE_CMP_NUMP__(intmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_intmax(intmax_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_intmaxp); } +/* @since 1.6 */ inline int libsimple_cmp_intmaxpp(intmax_t *const *a, intmax_t *const *b) { LIBSIMPLE_CMP_NUMPP__(intmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_intmaxp(intmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_intmaxpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_intmaxpp(intmax_t *const *a, intmax_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(intmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_intmaxp(intmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_intmaxpp); } +/* @since 1.6 */ inline int libsimple_cmp_intmaxpp_nul(intmax_t *const *a, intmax_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(intmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_intmaxp_nul(intmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_intmaxpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_intmaxp(const intmax_t *a, const intmax_t *b) { LIBSIMPLE_CMP_REV_NUMP__(intmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_intmax(intmax_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_intmaxp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_intmaxpp(intmax_t *const *a, intmax_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(intmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_intmaxp(intmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_intmaxpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_intmaxpp(intmax_t *const *a, intmax_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(intmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_intmaxp(intmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_intmaxpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_intmaxpp_nul(intmax_t *const *a, intmax_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(intmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_intmaxp_nul(intmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_intmaxpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uintmaxp(const uintmax_t *a, const uintmax_t *b) { LIBSIMPLE_CMP_NUMP__(uintmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uintmax(uintmax_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uintmaxp); } +/* @since 1.6 */ inline int libsimple_cmp_uintmaxpp(uintmax_t *const *a, uintmax_t *const *b) { LIBSIMPLE_CMP_NUMPP__(uintmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uintmaxp(uintmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uintmaxpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uintmaxpp(uintmax_t *const *a, uintmax_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(uintmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uintmaxp(uintmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uintmaxpp); } +/* @since 1.6 */ inline int libsimple_cmp_uintmaxpp_nul(uintmax_t *const *a, uintmax_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(uintmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uintmaxp_nul(uintmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uintmaxpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uintmaxp(const uintmax_t *a, const uintmax_t *b) { LIBSIMPLE_CMP_REV_NUMP__(uintmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uintmax(uintmax_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uintmaxp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uintmaxpp(uintmax_t *const *a, uintmax_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(uintmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uintmaxp(uintmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uintmaxpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uintmaxpp(uintmax_t *const *a, uintmax_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(uintmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uintmaxp(uintmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uintmaxpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uintmaxpp_nul(uintmax_t *const *a, uintmax_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(uintmax_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uintmaxp_nul(uintmax_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uintmaxpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_sizep(const size_t *a, const size_t *b) { LIBSIMPLE_CMP_NUMP__(size_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_size(size_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_sizep); } +/* @since 1.6 */ inline int libsimple_cmp_sizepp(size_t *const *a, size_t *const *b) { LIBSIMPLE_CMP_NUMPP__(size_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_sizep(size_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_sizepp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_sizepp(size_t *const *a, size_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(size_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_sizep(size_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_sizepp); } +/* @since 1.6 */ inline int libsimple_cmp_sizepp_nul(size_t *const *a, size_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(size_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_sizep_nul(size_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_sizepp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_sizep(const size_t *a, const size_t *b) { LIBSIMPLE_CMP_REV_NUMP__(size_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_size(size_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_sizep); } +/* @since 1.6 */ inline int libsimple_cmp_rev_sizepp(size_t *const *a, size_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(size_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_sizep(size_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_sizepp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_sizepp(size_t *const *a, size_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(size_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_sizep(size_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_sizepp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_sizepp_nul(size_t *const *a, size_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(size_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_sizep_nul(size_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_sizepp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_ssizep(const ssize_t *a, const ssize_t *b) { LIBSIMPLE_CMP_NUMP__(ssize_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ssize(ssize_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ssizep); } +/* @since 1.6 */ inline int libsimple_cmp_ssizepp(ssize_t *const *a, ssize_t *const *b) { LIBSIMPLE_CMP_NUMPP__(ssize_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ssizep(ssize_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ssizepp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_ssizepp(ssize_t *const *a, ssize_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(ssize_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_ssizep(ssize_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_ssizepp); } +/* @since 1.6 */ inline int libsimple_cmp_ssizepp_nul(ssize_t *const *a, ssize_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(ssize_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ssizep_nul(ssize_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ssizepp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ssizep(const ssize_t *a, const ssize_t *b) { LIBSIMPLE_CMP_REV_NUMP__(ssize_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ssize(ssize_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ssizep); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ssizepp(ssize_t *const *a, ssize_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(ssize_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ssizep(ssize_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ssizepp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_ssizepp(ssize_t *const *a, ssize_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(ssize_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_ssizep(ssize_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_ssizepp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ssizepp_nul(ssize_t *const *a, ssize_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(ssize_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ssizep_nul(ssize_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ssizepp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_intptrp(const intptr_t *a, const intptr_t *b) { LIBSIMPLE_CMP_NUMP__(intptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_intptr(intptr_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_intptrp); } +/* @since 1.6 */ inline int libsimple_cmp_intptrpp(intptr_t *const *a, intptr_t *const *b) { LIBSIMPLE_CMP_NUMPP__(intptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_intptrp(intptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_intptrpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_intptrpp(intptr_t *const *a, intptr_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(intptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_intptrp(intptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_intptrpp); } +/* @since 1.6 */ inline int libsimple_cmp_intptrpp_nul(intptr_t *const *a, intptr_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(intptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_intptrp_nul(intptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_intptrpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_intptrp(const intptr_t *a, const intptr_t *b) { LIBSIMPLE_CMP_REV_NUMP__(intptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_intptr(intptr_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_intptrp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_intptrpp(intptr_t *const *a, intptr_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(intptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_intptrp(intptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_intptrpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_intptrpp(intptr_t *const *a, intptr_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(intptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_intptrp(intptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_intptrpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_intptrpp_nul(intptr_t *const *a, intptr_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(intptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_intptrp_nul(intptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_intptrpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_uintptrp(const uintptr_t *a, const uintptr_t *b) { LIBSIMPLE_CMP_NUMP__(uintptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uintptr(uintptr_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uintptrp); } +/* @since 1.6 */ inline int libsimple_cmp_uintptrpp(uintptr_t *const *a, uintptr_t *const *b) { LIBSIMPLE_CMP_NUMPP__(uintptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uintptrp(uintptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uintptrpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_uintptrpp(uintptr_t *const *a, uintptr_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(uintptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_uintptrp(uintptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_uintptrpp); } +/* @since 1.6 */ inline int libsimple_cmp_uintptrpp_nul(uintptr_t *const *a, uintptr_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(uintptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_uintptrp_nul(uintptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_uintptrpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uintptrp(const uintptr_t *a, const uintptr_t *b) { LIBSIMPLE_CMP_REV_NUMP__(uintptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uintptr(uintptr_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uintptrp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uintptrpp(uintptr_t *const *a, uintptr_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(uintptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uintptrp(uintptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uintptrpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_uintptrpp(uintptr_t *const *a, uintptr_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(uintptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_uintptrp(uintptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_uintptrpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_uintptrpp_nul(uintptr_t *const *a, uintptr_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(uintptr_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_uintptrp_nul(uintptr_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_uintptrpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_ptrdiffp(const ptrdiff_t *a, const ptrdiff_t *b) { LIBSIMPLE_CMP_NUMP__(ptrdiff_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ptrdiff(ptrdiff_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ptrdiffp); } +/* @since 1.6 */ inline int libsimple_cmp_ptrdiffpp(ptrdiff_t *const *a, ptrdiff_t *const *b) { LIBSIMPLE_CMP_NUMPP__(ptrdiff_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ptrdiffp(ptrdiff_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ptrdiffpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_ptrdiffpp(ptrdiff_t *const *a, ptrdiff_t *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(ptrdiff_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_ptrdiffp(ptrdiff_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_ptrdiffpp); } +/* @since 1.6 */ inline int libsimple_cmp_ptrdiffpp_nul(ptrdiff_t *const *a, ptrdiff_t *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(ptrdiff_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_ptrdiffp_nul(ptrdiff_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_ptrdiffpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ptrdiffp(const ptrdiff_t *a, const ptrdiff_t *b) { LIBSIMPLE_CMP_REV_NUMP__(ptrdiff_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ptrdiff(ptrdiff_t base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ptrdiffp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ptrdiffpp(ptrdiff_t *const *a, ptrdiff_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(ptrdiff_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ptrdiffp(ptrdiff_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ptrdiffpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_ptrdiffpp(ptrdiff_t *const *a, ptrdiff_t *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(ptrdiff_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_ptrdiffp(ptrdiff_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_ptrdiffpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_ptrdiffpp_nul(ptrdiff_t *const *a, ptrdiff_t *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(ptrdiff_t, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_ptrdiffp_nul(ptrdiff_t *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_ptrdiffpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_floatp(const float *a, const float *b) { LIBSIMPLE_CMP_NUMP__(float, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_float(float base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_floatp); } +/* @since 1.6 */ inline int libsimple_cmp_floatpp(float *const *a, float *const *b) { LIBSIMPLE_CMP_NUMPP__(float, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_floatp(float *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_floatpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_floatpp(float *const *a, float *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(float, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_floatp(float *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_floatpp); } +/* @since 1.6 */ inline int libsimple_cmp_floatpp_nul(float *const *a, float *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(float, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_floatp_nul(float *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_floatpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_floatp(const float *a, const float *b) { LIBSIMPLE_CMP_REV_NUMP__(float, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_float(float base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_floatp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_floatpp(float *const *a, float *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(float, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_floatp(float *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_floatpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_floatpp(float *const *a, float *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(float, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_floatp(float *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_floatpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_floatpp_nul(float *const *a, float *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(float, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_floatp_nul(float *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_floatpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_doublep(const double *a, const double *b) { LIBSIMPLE_CMP_NUMP__(double, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_double(double base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_doublep); } +/* @since 1.6 */ inline int libsimple_cmp_doublepp(double *const *a, double *const *b) { LIBSIMPLE_CMP_NUMPP__(double, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_doublep(double *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_doublepp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_doublepp(double *const *a, double *const *b) { LIBSIMPLE_CMP_NUL_NUMPP__(double, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_doublep(double *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_doublepp); } +/* @since 1.6 */ inline int libsimple_cmp_doublepp_nul(double *const *a, double *const *b) { LIBSIMPLE_CMP_NUMPP_NUL__(double, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_doublep_nul(double *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_doublepp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_doublep(const double *a, const double *b) { LIBSIMPLE_CMP_REV_NUMP__(double, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_double(double base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_doublep); } +/* @since 1.6 */ inline int libsimple_cmp_rev_doublepp(double *const *a, double *const *b) { LIBSIMPLE_CMP_REV_NUMPP__(double, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_doublep(double *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_doublepp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_doublepp(double *const *a, double *const *b) { LIBSIMPLE_CMP_NUL_REV_NUMPP__(double, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_doublep(double *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_doublepp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_doublepp_nul(double *const *a, double *const *b) { LIBSIMPLE_CMP_REV_NUMPP_NUL__(double, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_doublep_nul(double *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_doublepp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_strp(const char *const *a, const char *const *b) { LIBSIMPLE_CMP_FUNP__(const char *, strcmp, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_str(const char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_strp); } +/* @since 1.6 */ inline int libsimple_cmp_strpp(const char **const *a, const char **const *b) { LIBSIMPLE_CMP_FUNPP__(const char *, strcmp, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_strp(const char **base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_strpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_strpp(const char **const *a, const char **const *b) { LIBSIMPLE_CMP_NUL_FUNPP__(const char *, strcmp, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_strp(const char **base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_strpp); } +/* @since 1.6 */ inline int libsimple_cmp_strpp_nul(const char **const *a, const char **const *b) { LIBSIMPLE_CMP_FUNPP_NUL__(const char *, strcmp, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_strp_nul(const char **base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_strpp_nul); } +/* @since 1.6 */ inline int libsimple_cmp_rev_strp(const char *const *a, const char *const *b) { LIBSIMPLE_CMP_REV_FUNP__(const char *, strcmp, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_str(const char *base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_strp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_strpp(const char **const *a, const char **const *b) { LIBSIMPLE_CMP_REV_FUNPP__(const char *, strcmp, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_strp(const char **base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_strpp); } +/* @since 1.6 */ inline int libsimple_cmp_nul_rev_strpp(const char **const *a, const char **const *b) { LIBSIMPLE_CMP_NUL_REV_FUNPP__(const char *, strcmp, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_nul_rev_strp(const char **base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_nul_rev_strpp); } +/* @since 1.6 */ inline int libsimple_cmp_rev_strpp_nul(const char **const *a, const char **const *b) { LIBSIMPLE_CMP_REV_FUNPP_NUL__(const char *, strcmp, a, b); } +/* @since 1.6 */ inline void libsimple_qsort_rev_strp_nul(const char **base[], size_t n) { qsort(base, n, sizeof(*base), (int (*)(const void *, const void *))&libsimple_cmp_rev_strpp_nul); } -- cgit v1.2.3-70-g09d2