diff options
Diffstat (limited to '')
49 files changed, 1736 insertions, 26 deletions
diff --git a/libsimple-arg.h b/libsimple-arg.h index 6aa3c2a..3662b70 100644 --- a/libsimple-arg.h +++ b/libsimple-arg.h @@ -19,6 +19,8 @@ /** * The zeroth command line argument, the name of the process, * set by the command line parsing macros + * + * @since 1.0 */ extern char *argv0; @@ -32,6 +34,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 { /** @@ -101,6 +105,8 @@ struct longopt { * // print usage information for other flags * usage(); * } ARGEND; + * + * @since 1.0 */ #define ARGBEGIN ARGBEGIN2(1, 0) @@ -109,6 +115,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) @@ -120,6 +128,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 {\ @@ -164,6 +174,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_++) {\ @@ -198,6 +210,8 @@ struct longopt { * } ARGEND; * * @param SYMBOL:char The symbol flags should begin with + * + * @since 1.0 */ #define ARGALT(SYMBOL)\ }\ @@ -222,7 +236,9 @@ struct longopt { switch (flag_) { /** - * Refer to `ARGBEGIN`, `SUBARGBEGIN`, and `ARGBEGIN4` + * Refer to `ARGBEGIN`, `SUBARGBEGIN`, and `ARGBEGIN2` + * + * @since 1.0 */ #define ARGEND\ }\ @@ -243,6 +259,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' @@ -252,6 +270,8 @@ struct longopt { * 'a' is returned * * @return :char The option's identifying character + * + * @since 1.0 */ #define FLAG() (flag_) @@ -263,6 +283,8 @@ struct longopt { * value can also be in the next argument * * @return :char * The current command line argument + * + * @since 1.0 */ #define LFLAG() (lflag_) @@ -275,6 +297,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)) @@ -291,6 +315,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) @@ -326,6 +352,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]) @@ -355,6 +383,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)\ @@ -386,6 +416,8 @@ struct longopt { * * @param ... If non-zero, the `usage` function * will be called + * + * @since 1.0 */ #define NOFLAGS(...)\ do {\ @@ -412,6 +444,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) @@ -440,6 +474,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 */ #define NUSAGE(STATUS, SYNOPSIS)\ static LIBSIMPLE_NORETURN__ void\ diff --git a/libsimple.h b/libsimple.h index 5758582..dd96615 100644 --- a/libsimple.h +++ b/libsimple.h @@ -184,6 +184,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__))) inline int @@ -222,6 +224,8 @@ int libsimple_close_range(unsigned int first, unsigned int last, unsigned int *n * @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 @@ -236,6 +240,8 @@ int libsimple_close_range(unsigned int first, unsigned int last, unsigned int *n * @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__))) inline void @@ -250,20 +256,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__) @@ -273,7 +279,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))\ LIBSIMPLE_NON_GCC_ONLY__(PTR) -#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_ASSUME_ALIGNED__(PTR, ##__VA_ARGS__, LIBSIMPLE_C11_ONLY__(_Alignof(*PTR)) /* no , */\ LIBSIMPLE_PRE_C11_ONLY__(__alignof(*PTR))) #ifndef ASSUME_ALIGNED @@ -281,20 +287,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/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/aligned_alloc.h b/libsimple/aligned_alloc.h index 6916b9a..9e05533 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__))) inline void * @@ -40,6 +42,8 @@ libsimple_valigned_allocn(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__(1), __warn_unused_result__))) inline void * @@ -69,6 +73,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__))) inline void * @@ -101,6 +107,8 @@ libsimple_enaligned_alloc(int status__, 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__(2), __warn_unused_result__, __returns_nonnull__))) inline void * @@ -133,6 +141,8 @@ libsimple_envaligned_allocn(int status__, 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__(2), __warn_unused_result__, __returns_nonnull__))) inline void * @@ -161,6 +171,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__))) inline void * @@ -192,6 +204,8 @@ 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__))) inline void * @@ -223,6 +237,8 @@ libsimple_evaligned_allocn(size_t alignment__, 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 alignment + * + * @since 1.1 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __alloc_align__(1), __warn_unused_result__, __returns_nonnull__))) inline void * diff --git a/libsimple/aligned_allocz.h b/libsimple/aligned_allocz.h index 3137004..9aa4700 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__))) inline void * @@ -83,6 +87,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__))) inline void * @@ -113,6 +119,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); @@ -142,6 +150,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); @@ -171,6 +181,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__))) inline void * @@ -199,6 +211,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__))) inline void * @@ -231,6 +245,8 @@ libsimple_ealigned_allocz(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__(2), __warn_unused_result__, __returns_nonnull__))) inline void * @@ -263,6 +279,8 @@ libsimple_evaligned_alloczn(int clear__, size_t alignment__, size_t n__, 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__(2), __warn_unused_result__, __returns_nonnull__))) inline void * diff --git a/libsimple/aligned_memdup.h b/libsimple/aligned_memdup.h index 6cb9415..1bea686 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)\ @@ -40,6 +42,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); @@ -56,6 +60,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); @@ -71,6 +77,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__))) inline void * diff --git a/libsimple/aligned_realloc.h b/libsimple/aligned_realloc.h index 0c81cd7..10238ba 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__))) inline void * @@ -157,6 +163,8 @@ libsimple_ealigned_realloc(void *ptr__, size_t alignment__, size_t n__) * @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__))) inline void * @@ -200,6 +208,8 @@ libsimple_aligned_reallocf(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), __alloc_size__(3, 4), __warn_unused_result__))) inline void * @@ -244,6 +254,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); @@ -280,6 +292,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__))) inline void * @@ -316,6 +330,8 @@ libsimple_ealigned_reallocarray(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), __alloc_size__(3, 4), __warn_unused_result__))) inline void * @@ -360,6 +376,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); @@ -398,6 +416,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); @@ -435,6 +455,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__))) inline void * @@ -472,6 +494,8 @@ libsimple_evaligned_reallocn(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__))) inline void * @@ -516,6 +540,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__))) inline void * @@ -561,6 +587,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__))) inline void * @@ -605,6 +633,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__))) inline void * @@ -649,6 +679,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__))) inline void * diff --git a/libsimple/aligned_strdup.h b/libsimple/aligned_strdup.h index 2488f96..a69669d 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)\ @@ -36,6 +38,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__))) inline char * @@ -55,6 +59,8 @@ libsimple_aligned_strdup(const char *s__, size_t alignment__) * @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); @@ -69,6 +75,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__))) inline char * diff --git a/libsimple/aligned_strndup.h b/libsimple/aligned_strndup.h index 84f2218..d5b85fd 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)\ @@ -40,6 +42,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__); @@ -56,6 +60,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); @@ -71,6 +77,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__))) inline char * diff --git a/libsimple/aligned_wcsdup.h b/libsimple/aligned_wcsdup.h index 3b33338..2ea0579 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)\ @@ -36,6 +38,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__))) inline wchar_t * @@ -55,6 +59,8 @@ libsimple_aligned_wcsdup(const wchar_t *s__, size_t alignment__) * @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); @@ -69,6 +75,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__))) inline wchar_t * diff --git a/libsimple/aligned_wcsndup.h b/libsimple/aligned_wcsndup.h index a5d2641..faae22d 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)\ @@ -40,6 +42,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__); @@ -56,6 +60,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); @@ -71,6 +77,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__))) inline wchar_t * diff --git a/libsimple/aligned_wmemdup.h b/libsimple/aligned_wmemdup.h index 51f00a9..e6e68d9 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)\ @@ -40,6 +42,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); @@ -56,6 +60,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); @@ -71,6 +77,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__))) inline wchar_t * diff --git a/libsimple/array.h b/libsimple/array.h index 5530e24..8300f0a 100644 --- a/libsimple/array.h +++ b/libsimple/array.h @@ -3,174 +3,203 @@ /* 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, sizeof *(buf), n) #ifndef arrayset # define arrayset(...) libsimple_arrayset(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arraypset(buf, item, n) libsimple_mempsetelem(buf, item, sizeof *(buf), n) #ifndef arraypset # define arraypset(...) libsimple_arraypset(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arraycpy(d, s, n) memcpy(d, s, (n) * sizeof *(s)) #ifndef arraycpy # define arraycpy(...) libsimple_arraycpy(__VA_ARGS__) #endif +/* @since 1.1 */ #define libsimple_arraymove(d, s, n) 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__) #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__) 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/calloc.h b/libsimple/calloc.h index 7e6500e..80a21d4 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__))) inline void * @@ -45,6 +47,8 @@ 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__))) inline void * @@ -75,6 +79,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 */ #ifndef LIBSIMPLE_DEFINED_LIBSIMPLE_ENCALLOC__ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __alloc_size__(2, 3), __warn_unused_result__, __returns_nonnull__))) @@ -104,6 +110,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__))) inline void * @@ -134,6 +142,8 @@ 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__))) inline void * @@ -163,6 +173,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__))) inline void * @@ -192,6 +204,8 @@ 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__))) inline void * @@ -221,6 +235,8 @@ 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__))) 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 a39ae2a..1e5a978 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__))) 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__))) 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__, __format__(__printf__, 1, 0)))) 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)))) 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__, __format__(__printf__, 2, 0)))) 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)))) 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__, __format__(__printf__, 1, 0)))) inline void @@ -181,6 +195,8 @@ 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)))) inline void 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/malloc.h b/libsimple/malloc.h index df742a1..27c54ba 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__))) inline void * @@ -45,6 +47,8 @@ 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__))) inline void * @@ -73,6 +77,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 */ #ifndef LIBSIMPLE_DEFINED_LIBSIMPLE_ENMALLOC__ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __alloc_size__(2), __warn_unused_result__, __returns_nonnull__))) @@ -102,6 +108,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__))) inline void * @@ -132,6 +140,8 @@ 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__))) inline void * @@ -159,6 +169,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__))) inline void * @@ -188,6 +200,8 @@ 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__))) inline void * @@ -217,6 +231,8 @@ 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__))) inline void * diff --git a/libsimple/mallocz.h b/libsimple/mallocz.h index 6909b1f..80cdd5f 100644 --- a/libsimple/mallocz.h +++ b/libsimple/mallocz.h @@ -35,6 +35,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); @@ -54,6 +56,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__))) inline void * @@ -83,6 +87,8 @@ 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__))) inline void * @@ -111,6 +117,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__))) inline void * @@ -143,6 +151,8 @@ 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); @@ -171,6 +181,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__))) inline void * @@ -198,6 +210,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__))) inline void * @@ -228,6 +242,8 @@ 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__))) inline void * @@ -258,6 +274,8 @@ 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__))) inline void * diff --git a/libsimple/mem.h b/libsimple/mem.h index a7cf038..2155967 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__))) inline int @@ -548,6 +606,8 @@ 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__))) inline int @@ -567,6 +627,8 @@ libsimple_memcaseeq(const void *a__, const void *b__, size_t n__) * @param s The array of bytes that should be copied * @param n The number of bytes to copy * @return `&d[n]` + * + * @since 1.0 */ inline void * libsimple_mempcpy(void *restrict d__, const void *restrict s__, size_t n__) @@ -585,6 +647,8 @@ libsimple_mempcpy(void *restrict d__, const void *restrict s__, size_t n__) * @param s The bytes that should be moved * @param n The number of bytes to move * @return `&d[n]` + * + * @since 1.1 */ inline void * libsimple_mempmove(void *d__, const void *s__, size_t n__) @@ -603,6 +667,8 @@ 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 */ inline void * libsimple_mempset(void *s__, int c__, size_t n__) @@ -626,6 +692,8 @@ 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 */ inline void * libsimple_rawmemccpy(void *restrict d___, const void *restrict s___, int c___) @@ -650,6 +718,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 @@ -669,6 +739,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 */ inline void * libsimple_rawmemcmove(void *d___, const void *s___, int c___) @@ -703,6 +775,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 */ inline void * libsimple_memreplace(void *s___, int old___, int new___, size_t n__) @@ -731,6 +805,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 @@ -750,6 +826,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 @@ -769,6 +847,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 */ inline void * libsimple_memtolower(void *d__, const void *s__, size_t n__) @@ -793,6 +873,8 @@ 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 */ inline void * libsimple_memtoupper(void *d__, const void *s__, size_t n__) @@ -814,6 +896,8 @@ 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); @@ -831,6 +915,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); @@ -848,6 +934,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); @@ -865,6 +953,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); @@ -881,6 +971,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 bb6551f..4936661 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__))) inline void * @@ -40,6 +42,8 @@ libsimple_vmemalignn(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__(1), __alloc_size__(2), __warn_unused_result__))) inline void * @@ -69,6 +73,8 @@ 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__))) inline void * @@ -98,6 +104,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__))) inline void * @@ -130,6 +138,8 @@ libsimple_enmemalign(int status__, 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__(2), __warn_unused_result__, __returns_nonnull__))) inline void * @@ -162,6 +172,8 @@ libsimple_envmemalignn(int status__, size_t alignment__, 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 alignment + * + * @since 1.1 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) inline void * @@ -190,6 +202,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__))) inline void * @@ -222,6 +236,8 @@ 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__))) inline void * @@ -253,6 +269,8 @@ libsimple_evmemalignn(size_t alignment__, 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 alignment + * + * @since 1.1 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __alloc_align__(1), __warn_unused_result__, __returns_nonnull__))) inline void * diff --git a/libsimple/memalignz.h b/libsimple/memalignz.h index 1630783..9972124 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__))) 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__))) 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__))) 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__))) 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__))) inline void * @@ -197,6 +207,8 @@ libsimple_envmemalignzn(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__))) 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__))) inline void * @@ -258,6 +272,8 @@ libsimple_ememalignz(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__(2), __warn_unused_result__, __returns_nonnull__))) inline void * @@ -290,6 +306,8 @@ libsimple_evmemalignzn(int clear__, size_t alignment__, 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 alignment + * + * @since 1.1 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __alloc_align__(2), __warn_unused_result__, __returns_nonnull__))) inline void * diff --git a/libsimple/memalloc.h b/libsimple/memalloc.h index 9f894e8..105bb50 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,43 +54,53 @@ 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__))) inline void * libsimple_evmemalloc(size_t n__, va_list ap__) @@ -91,6 +108,7 @@ 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__))) inline void * libsimple_memalloc(size_t n__, ... /*, LIBSIMPLE_MEMALLOC_END */) @@ -101,6 +119,7 @@ libsimple_memalloc(size_t n__, ... /*, LIBSIMPLE_MEMALLOC_END */) va_end(ap__); } +/* @since 1.1 */ LIBSIMPLE_GCC_ONLY__(__attribute__((__malloc__, __warn_unused_result__))) inline void * libsimple_enmemalloc(int status__, size_t n__, ... /*, LIBSIMPLE_MEMALLOC_END */) @@ -111,6 +130,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__))) inline void * libsimple_ememalloc(size_t n__, ... /*, LIBSIMPLE_MEMALLOC_END */) diff --git a/libsimple/memdup.h b/libsimple/memdup.h index 528782f..8ab610f 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)\ @@ -29,6 +31,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); @@ -44,6 +48,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); @@ -58,6 +64,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__))) inline void * diff --git a/libsimple/memelem.h b/libsimple/memelem.h index e78251a..f92ac8a 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__))) inline void * @@ -260,6 +284,8 @@ libsimple_memsetelem(void *buf__, const void *item__, size_t width__, size_t n__ * @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 @@ -278,6 +304,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 @@ -298,6 +326,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 @@ -318,6 +348,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 @@ -335,6 +367,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/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/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/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/posix_memalign.h b/libsimple/posix_memalign.h index 78924de..f537d93 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)))) inline int @@ -59,6 +61,8 @@ libsimple_vposix_memalignn(void **memptr__, size_t alignment__, size_t n__, va_l * @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)))) inline int @@ -90,6 +94,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)))) inline void @@ -124,6 +130,8 @@ libsimple_enposix_memalign(int status__, void **memptr__, size_t alignment__, si * @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)))) inline void @@ -158,6 +166,8 @@ libsimple_envposix_memalignn(int status__, void **memptr__, size_t alignment__, * @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)))) inline void @@ -188,6 +198,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)))) inline void @@ -221,6 +233,8 @@ libsimple_eposix_memalign(void **memptr__, size_t alignment__, size_t n__) * @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)))) inline void @@ -254,6 +268,8 @@ libsimple_evposix_memalignn(void **memptr__, size_t alignment__, size_t n__, va_ * @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)))) inline void diff --git a/libsimple/posix_memalignz.h b/libsimple/posix_memalignz.h index eb3e138..cf23cd0 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)))) 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)))) 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)))) 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)))) inline void @@ -249,6 +263,8 @@ libsimple_eposix_memalignz(void **memptr__, int clear__, size_t alignment__, 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__(1)))) inline void @@ -283,6 +299,8 @@ libsimple_evposix_memalignzn(void **memptr__, int clear__, size_t alignment__, 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__(1)))) inline void diff --git a/libsimple/printf.h b/libsimple/printf.h index b6a0959..b295eff 100644 --- a/libsimple/printf.h +++ b/libsimple/printf.h @@ -6,6 +6,8 @@ * `libsimple__eprintf` * * Default value is 1 + * + * @since 1.0 */ extern int libsimple_default_failure_exit; @@ -19,6 +21,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); @@ -32,6 +36,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); @@ -51,6 +57,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 *, ...); @@ -74,6 +82,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), __format__(__printf__, 2, 0)))) int libsimple_vasprintf(char **, const char *, va_list); @@ -94,6 +104,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__, ...)\ @@ -126,6 +138,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__)\ @@ -169,6 +183,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), __format__(__printf__, 1, 0)))) void libsimple_vweprintf(const char *, va_list); @@ -193,6 +209,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)))) inline void @@ -227,6 +245,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), __format__(__printf__, 2, 0)))) inline LIBSIMPLE_NORETURN void @@ -261,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 @@ -293,6 +315,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)))) inline LIBSIMPLE_NORETURN void @@ -329,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 @@ -363,6 +389,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), __format__(__printf__, 1, 0)))) inline LIBSIMPLE_NORETURN void @@ -397,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 @@ -429,6 +459,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)))) inline LIBSIMPLE_NORETURN void @@ -465,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/pvalloc.h b/libsimple/pvalloc.h index bc23e85..84aadef 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__))) inline void * @@ -45,6 +47,8 @@ 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__))) inline void * @@ -76,6 +80,8 @@ 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__))) inline void * @@ -108,6 +114,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__))) inline void * @@ -142,6 +150,8 @@ 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__))) inline void * @@ -176,6 +186,8 @@ 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__))) inline void * @@ -207,6 +219,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__))) inline void * @@ -240,6 +254,8 @@ 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__))) inline void * @@ -273,6 +289,8 @@ 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__))) inline void * diff --git a/libsimple/pvallocz.h b/libsimple/pvallocz.h index 6b4eaf6..a4a6498 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__))) 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__))) 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__))) 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__))) 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__))) 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__))) 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__))) inline void * @@ -267,6 +281,8 @@ 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__))) inline void * @@ -301,6 +317,8 @@ 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__))) inline 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/realloc.h b/libsimple/realloc.h index 4f780d5..37d4031 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__))) 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__))) 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__))) inline void * @@ -238,6 +250,8 @@ 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__))) inline void * @@ -276,6 +290,8 @@ 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__))) inline void * @@ -312,6 +328,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__))) inline void * @@ -350,6 +368,8 @@ libsimple_reallocf(void *ptr__, size_t n__) * `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__))) inline void * @@ -391,6 +411,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); @@ -424,6 +446,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__))) inline void * @@ -459,6 +483,8 @@ 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__))) inline void * @@ -498,6 +524,8 @@ libsimple_reallocarrayf(void *ptr__, size_t n__, size_t m__) * `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__))) inline void * @@ -537,6 +565,8 @@ libsimple_vreallocfn(void *ptr__, size_t n__, va_list ap__) * `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__))) inline void * 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/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); } diff --git a/libsimple/str.h b/libsimple/str.h index b0345bd..8970bf7 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__))) inline char * @@ -180,6 +202,8 @@ 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 *); @@ -194,6 +218,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__))) inline int @@ -212,6 +238,8 @@ 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 *); @@ -226,6 +254,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 *); @@ -242,6 +272,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 *); @@ -258,6 +290,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 *); @@ -274,6 +308,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 *); @@ -291,6 +327,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__))) inline int @@ -312,6 +350,8 @@ 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__))) inline int @@ -331,6 +371,8 @@ 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__))) inline int @@ -350,6 +392,8 @@ 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__))) inline int @@ -369,6 +413,8 @@ 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__))) inline int @@ -388,6 +434,8 @@ 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__))) inline int @@ -407,6 +455,8 @@ 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 *); @@ -422,6 +472,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 *); @@ -437,6 +489,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__))) inline size_t @@ -456,6 +510,8 @@ 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__))) inline size_t @@ -475,6 +531,8 @@ 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__))) inline int @@ -494,6 +552,8 @@ 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__))) inline int @@ -513,6 +573,8 @@ 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__))) inline char * @@ -532,6 +594,8 @@ 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__))) inline char * @@ -552,6 +616,8 @@ 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__))) inline char * @@ -572,6 +638,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__))) inline char * @@ -595,6 +663,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__))) inline char * @@ -622,6 +692,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); @@ -638,6 +710,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__))) inline char * @@ -665,6 +739,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 *); @@ -684,6 +760,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 *); @@ -703,6 +781,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__))) inline char * @@ -727,6 +807,8 @@ 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__))) inline char * @@ -747,6 +829,8 @@ 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__))) inline int diff --git a/libsimple/strdup.h b/libsimple/strdup.h index cf48119..ed1e9e4 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)\ @@ -28,6 +30,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 *); @@ -41,6 +45,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__))) inline char * diff --git a/libsimple/strn.h b/libsimple/strn.h index a333ecd..91bce69 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__))) inline int @@ -387,6 +431,8 @@ libsimple_strncmpnul(const char *a__, const char *b__, size_t n__) * @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__))) inline int @@ -408,6 +454,8 @@ libsimple_strncasecmpnul(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__, __nonnull__, __warn_unused_result__))) inline int @@ -429,6 +477,8 @@ 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__))) inline int @@ -450,6 +500,8 @@ libsimple_strneqnul(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__, __nonnull__, __warn_unused_result__))) inline int @@ -471,6 +523,8 @@ libsimple_strncaseeq(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__))) inline int @@ -492,6 +546,8 @@ libsimple_strncaseeqnul(const char *a__, const char *b__, size_t n__) * 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); @@ -509,6 +565,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); @@ -526,6 +584,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__))) inline size_t @@ -547,6 +607,8 @@ libsimple_strrneqlen(const char *a__, const char *b__, size_t n__) * 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__))) inline size_t @@ -567,6 +629,8 @@ libsimple_strrncaseeqlen(const char *a__, const char *b__, size_t n__) * @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__))) inline char * @@ -588,6 +652,8 @@ 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__))) inline char * @@ -609,6 +675,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__))) inline char * @@ -630,6 +698,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__))) inline char * @@ -655,6 +725,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__))) inline char * @@ -688,6 +760,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); @@ -705,6 +779,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__))) inline char * @@ -733,6 +809,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); @@ -753,6 +831,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); @@ -773,6 +853,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__))) inline char * @@ -798,6 +880,8 @@ 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__))) inline char * @@ -822,6 +906,8 @@ 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__))) inline int diff --git a/libsimple/strndup.h b/libsimple/strndup.h index 70c3db5..3229e01 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)\ @@ -33,6 +35,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); @@ -47,6 +51,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__))) inline char * 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); diff --git a/libsimple/time.h b/libsimple/time.h index 6618d9d..b873635 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__))) 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__))) 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__))) 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__))) 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__))) 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 023425e..eb86e08 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__))) inline void * @@ -37,6 +39,8 @@ 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__))) inline void * @@ -64,6 +68,8 @@ 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__))) inline void * @@ -92,6 +98,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__))) inline void * @@ -122,6 +130,8 @@ 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__))) inline void * @@ -152,6 +162,8 @@ 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__))) inline void * @@ -179,6 +191,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__))) inline void * @@ -208,6 +222,8 @@ 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__))) inline void * @@ -237,6 +253,8 @@ 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__))) inline void * diff --git a/libsimple/vallocz.h b/libsimple/vallocz.h index 5c8258e..337dc88 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__))) 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__))) 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__))) 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__))) 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__))) 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__))) 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__))) inline void * @@ -231,6 +245,8 @@ 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__))) inline void * @@ -261,6 +277,8 @@ 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__))) inline void * diff --git a/libsimple/wcsdup.h b/libsimple/wcsdup.h index 0573d64..84e7ee6 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)\ @@ -28,6 +30,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__))) @@ -42,6 +46,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 d9ffaa5..1fc37ce 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)\ @@ -32,6 +34,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__))) @@ -48,6 +52,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__))) @@ -63,6 +69,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 898acdd..22cd1cc 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)\ @@ -29,6 +31,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); @@ -44,6 +48,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__))) @@ -59,6 +65,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__))) |