diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/__rune.h | 8 | ||||
-rw-r--r-- | include/__u8view.h | 13 | ||||
-rw-r--r-- | include/_bsearch.h (renamed from include/__bsearch.h) | 6 | ||||
-rw-r--r-- | include/_charN_t.h (renamed from include/__charN_t.h) | 6 | ||||
-rw-r--r-- | include/_qmacros.h (renamed from include/__qmacros.h) | 14 | ||||
-rw-r--r-- | include/_rune.h | 8 | ||||
-rw-r--r-- | include/_u8view.h | 13 | ||||
-rw-r--r-- | include/bitset.h | 12 | ||||
-rw-r--r-- | include/errors.h | 4 | ||||
-rw-r--r-- | include/mbio.h | 4 | ||||
-rw-r--r-- | include/mbstring.h | 14 | ||||
-rw-r--r-- | include/optparse.h | 6 | ||||
-rw-r--r-- | include/rune.h | 36 | ||||
-rw-r--r-- | include/unicode/_gbrk.h (renamed from include/unicode/__gbrk.h) | 8 | ||||
-rw-r--r-- | include/unicode/prop.h | 4 | ||||
-rw-r--r-- | include/unicode/string.h | 4 |
16 files changed, 80 insertions, 80 deletions
diff --git a/include/__rune.h b/include/__rune.h deleted file mode 100644 index 4011411..0000000 --- a/include/__rune.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef MLIB___RUNE_H -#define MLIB___RUNE_H - -#include <stdint.h> - -typedef uint_least32_t rune; - -#endif /* !MLIB___RUNE_H */ diff --git a/include/__u8view.h b/include/__u8view.h deleted file mode 100644 index c6073c7..0000000 --- a/include/__u8view.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef MLIB___U8VIEW_H -#define MLIB___U8VIEW_H - -#include <stddef.h> - -#include "__charN_t.h" - -struct u8view { - const char8_t *p; - size_t len; -}; - -#endif /* !MLIB___U8VIEW_H */ diff --git a/include/__bsearch.h b/include/_bsearch.h index 6abcff6..ce8f118 100644 --- a/include/__bsearch.h +++ b/include/_bsearch.h @@ -2,7 +2,7 @@ #include "macros.h" -#define __MLIB_DEFINE_BSEARCH(TYPE, TABLE, DEFAULT) \ +#define _MLIB_DEFINE_BSEARCH(TYPE, TABLE, DEFAULT) \ static TYPE mlib_lookup(rune ch) \ { \ ptrdiff_t i, lo, hi; \ @@ -21,7 +21,7 @@ return DEFAULT; \ } -#define __MLIB_DEFINE_BSEARCH_CONTAINS(TABLE) \ +#define _MLIB_DEFINE_BSEARCH_CONTAINS(TABLE) \ static bool mlib_lookup_contains(rune ch) \ { \ ptrdiff_t i, lo, hi; \ @@ -40,7 +40,7 @@ return false; \ } -#define __MLIB_DEFINE_BSEARCH_KV(TYPE, TABLE, DEFAULT) \ +#define _MLIB_DEFINE_BSEARCH_KV(TYPE, TABLE, DEFAULT) \ static TYPE mlib_lookup_kv(rune ch) \ { \ ptrdiff_t i, lo, hi; \ diff --git a/include/__charN_t.h b/include/_charN_t.h index eca16b9..5397fb3 100644 --- a/include/__charN_t.h +++ b/include/_charN_t.h @@ -1,5 +1,5 @@ -#ifndef MLIB___CHARN_T_H -#define MLIB___CHARN_T_H +#ifndef MLIB__CHARN_T_H +#define MLIB__CHARN_T_H #include <stdint.h> @@ -7,4 +7,4 @@ typedef unsigned char char8_t; typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; -#endif /* !MLIB___CHARN_T_H */ +#endif /* !MLIB__CHARN_T_H */ diff --git a/include/__qmacros.h b/include/_qmacros.h index fd7b803..d496581 100644 --- a/include/__qmacros.h +++ b/include/_qmacros.h @@ -1,5 +1,5 @@ -#ifndef MLIB___QMACROS_H -#define MLIB___QMACROS_H +#ifndef MLIB__QMACROS_H +#define MLIB__QMACROS_H /* Macros for qualifier-preserving functions. These are used to create wrappers around some functions which will return a const-qualified pointer if the @@ -9,18 +9,18 @@ The macros are taken from the N3020 proposal for C23. */ /* clang-format off */ -#define __MLIB_PTR_IS_CONST(P) \ +#define _MLIB_PTR_IS_CONST(P) \ _Generic(1 ? (P) : (void *)(P), \ const void *: 1, \ default: 0) -#define __MLIB_STATIC_IF(P, T, E) \ +#define _MLIB_STATIC_IF(P, T, E) \ _Generic(&(char[!!(P) + 1]){0}, \ char(*)[2]: T, \ char(*)[1]: E) -#define __MLIB_Q_PTR(T, F, S, ...) \ - __MLIB_STATIC_IF(__MLIB_PTR_IS_CONST((S)), \ +#define _MLIB_Q_PTR(T, F, S, ...) \ + _MLIB_STATIC_IF(_MLIB_PTR_IS_CONST((S)), \ (const T *)(F)(__VA_ARGS__), \ (T *)(F)(__VA_ARGS__)) /* clang-format on */ -#endif /* !MLIB___QMACROS_H */ +#endif /* !MLIB__QMACROS_H */ diff --git a/include/_rune.h b/include/_rune.h new file mode 100644 index 0000000..26c0df1 --- /dev/null +++ b/include/_rune.h @@ -0,0 +1,8 @@ +#ifndef MLIB__RUNE_H +#define MLIB__RUNE_H + +#include <stdint.h> + +typedef uint_least32_t rune; + +#endif /* !MLIB__RUNE_H */ diff --git a/include/_u8view.h b/include/_u8view.h new file mode 100644 index 0000000..5d6a9b8 --- /dev/null +++ b/include/_u8view.h @@ -0,0 +1,13 @@ +#ifndef MLIB__U8VIEW_H +#define MLIB__U8VIEW_H + +#include <stddef.h> + +#include "_charN_t.h" + +struct u8view { + const char8_t *p; + size_t len; +}; + +#endif /* !MLIB__U8VIEW_H */ diff --git a/include/bitset.h b/include/bitset.h index 6be07d6..4945d5b 100644 --- a/include/bitset.h +++ b/include/bitset.h @@ -3,14 +3,14 @@ #include <limits.h> -#define __MLIB_BITSLOT(x) ((x) / CHAR_BIT) -#define __MLIB_BITMASK(x) (1 << ((x) % CHAR_BIT)) +#define _MLIB_BITSLOT(x) ((x) / CHAR_BIT) +#define _MLIB_BITMASK(x) (1 << ((x) % CHAR_BIT)) #define bitset(name, n) unsigned char name[(n + CHAR_BIT - 1) / CHAR_BIT] -#define CLRBIT(bs, x) ((bs)[__MLIB_BITSLOT(x)] &= ~__MLIB_BITMASK(x)) -#define SETBIT(bs, x) ((bs)[__MLIB_BITSLOT(x)] |= __MLIB_BITMASK(x)) -#define TOGLBIT(bs, x) ((bs)[__MLIB_BITSLOT(x)] ^= __MLIB_BITMASK(x)) -#define TESTBIT(bs, x) ((bool)((bs)[__MLIB_BITSLOT(x)] & __MLIB_BITMASK(x))) +#define CLRBIT(bs, x) ((bs)[_MLIB_BITSLOT(x)] &= ~_MLIB_BITMASK(x)) +#define SETBIT(bs, x) ((bs)[_MLIB_BITSLOT(x)] |= _MLIB_BITMASK(x)) +#define TOGLBIT(bs, x) ((bs)[_MLIB_BITSLOT(x)] ^= _MLIB_BITMASK(x)) +#define TESTBIT(bs, x) ((bool)((bs)[_MLIB_BITSLOT(x)] & _MLIB_BITMASK(x))) #endif /* !MLIB_BITSET_H */ diff --git a/include/errors.h b/include/errors.h index dfd092a..6e8cbce 100644 --- a/include/errors.h +++ b/include/errors.h @@ -11,7 +11,7 @@ void vwarn(const char *, va_list); [[noreturn, gnu::format(printf, 1, 2)]] void err(const char *, ...); [[noreturn, gnu::format(printf, 2, 3)]] void cerr(int, const char *, ...); -extern const char *__mlib_errors_progname; +extern const char *_mlib_errors_progname; void mlib_setprogname(const char *); @@ -19,7 +19,7 @@ void mlib_setprogname(const char *); static inline const char * mlib_progname(void) { - return __mlib_errors_progname; + return _mlib_errors_progname; } #endif /* !MLIB_ERRORS_H */ diff --git a/include/mbio.h b/include/mbio.h index 80e703b..2cb501d 100644 --- a/include/mbio.h +++ b/include/mbio.h @@ -3,8 +3,8 @@ #include <stdio.h> -#include "__charN_t.h" -#include "__rune.h" +#include "_charN_t.h" +#include "_rune.h" int freadrune(rune *, FILE *); diff --git a/include/mbstring.h b/include/mbstring.h index 7e3f453..b6a769c 100644 --- a/include/mbstring.h +++ b/include/mbstring.h @@ -3,10 +3,10 @@ #include <stddef.h> -#include "__charN_t.h" -#include "__qmacros.h" -#include "__rune.h" -#include "__u8view.h" +#include "_charN_t.h" +#include "_qmacros.h" +#include "_rune.h" +#include "_u8view.h" #define U8V(s) ((struct u8view){.p = (s), .len = sizeof(s) - 1}) #define U8_ARGS(s) ((s).p), ((s).len) @@ -51,8 +51,8 @@ int u8prev(rune *, const char8_t **, const char8_t *); [[nodiscard]] size_t u8len(const char8_t *, size_t); -#define u8chk(s, n) __MLIB_Q_PTR(char8_t, u8chk, (s), (s), (n)) -#define u8chr(s, n, ch) __MLIB_Q_PTR(char8_t, u8chr, (s), (s), (n), (ch)) -#define u8rchr(s, n, ch) __MLIB_Q_PTR(char8_t, u8rchr, (s), (s), (n), (ch)) +#define u8chk(s, n) _MLIB_Q_PTR(char8_t, u8chk, (s), (s), (n)) +#define u8chr(s, n, ch) _MLIB_Q_PTR(char8_t, u8chr, (s), (s), (n), (ch)) +#define u8rchr(s, n, ch) _MLIB_Q_PTR(char8_t, u8rchr, (s), (s), (n), (ch)) #endif /* !MLIB_MBSTRING_H */ diff --git a/include/optparse.h b/include/optparse.h index 5f7eafd..7e2c315 100644 --- a/include/optparse.h +++ b/include/optparse.h @@ -3,10 +3,10 @@ #include <stddef.h> -#include "__charN_t.h" -#include "__rune.h" -#include "__u8view.h" #include "_attrs.h" +#include "_charN_t.h" +#include "_rune.h" +#include "_u8view.h" struct optparse { bool _b; diff --git a/include/rune.h b/include/rune.h index db08de2..1ee868c 100644 --- a/include/rune.h +++ b/include/rune.h @@ -3,28 +3,28 @@ #include <inttypes.h> -#include "__rune.h" +#include "_rune.h" -#define __MLIB_RUNE_PRIDEF(c) PRI##c##LEAST32 -#define __MLIB_RUNE_SCNDEF(c) SCN##c##LEAST32 +#define _MLIB_RUNE_PRIDEF(c) PRI##c##LEAST32 +#define _MLIB_RUNE_SCNDEF(c) SCN##c##LEAST32 #ifdef PRIBLEAST32 -# define PRIBRUNE __MLIB_RUNE_PRIDEF(B) +# define PRIBRUNE _MLIB_RUNE_PRIDEF(B) #endif -#define PRIbRUNE __MLIB_RUNE_PRIDEF(b) -#define PRIdRUNE __MLIB_RUNE_PRIDEF(d) -#define PRIiRUNE __MLIB_RUNE_PRIDEF(i) -#define PRIoRUNE __MLIB_RUNE_PRIDEF(o) -#define PRIuRUNE __MLIB_RUNE_PRIDEF(u) -#define PRIxRUNE __MLIB_RUNE_PRIDEF(x) -#define PRIXRUNE __MLIB_RUNE_PRIDEF(X) - -#define SCNbRUNE __MLIB_RUNE_SCNDEF(b) -#define SCNdRUNE __MLIB_RUNE_SCNDEF(d) -#define SCNiRUNE __MLIB_RUNE_SCNDEF(i) -#define SCNuRUNE __MLIB_RUNE_SCNDEF(u) -#define SCNoRUNE __MLIB_RUNE_SCNDEF(o) -#define SCNxRUNE __MLIB_RUNE_SCNDEF(x) +#define PRIbRUNE _MLIB_RUNE_PRIDEF(b) +#define PRIdRUNE _MLIB_RUNE_PRIDEF(d) +#define PRIiRUNE _MLIB_RUNE_PRIDEF(i) +#define PRIoRUNE _MLIB_RUNE_PRIDEF(o) +#define PRIuRUNE _MLIB_RUNE_PRIDEF(u) +#define PRIxRUNE _MLIB_RUNE_PRIDEF(x) +#define PRIXRUNE _MLIB_RUNE_PRIDEF(X) + +#define SCNbRUNE _MLIB_RUNE_SCNDEF(b) +#define SCNdRUNE _MLIB_RUNE_SCNDEF(d) +#define SCNiRUNE _MLIB_RUNE_SCNDEF(i) +#define SCNuRUNE _MLIB_RUNE_SCNDEF(u) +#define SCNoRUNE _MLIB_RUNE_SCNDEF(o) +#define SCNxRUNE _MLIB_RUNE_SCNDEF(x) #define RUNE_C(x) UINT32_C(x) diff --git a/include/unicode/__gbrk.h b/include/unicode/_gbrk.h index 476c4a7..cfcdb34 100644 --- a/include/unicode/__gbrk.h +++ b/include/unicode/_gbrk.h @@ -1,11 +1,11 @@ /* This file is autogenerated by gen/string/gbrk; DO NOT EDIT. */ -#ifndef MLIB_UNICODE___GBRK_H -#define MLIB_UNICODE___GBRK_H +#ifndef MLIB_UNICODE__GBRK_H +#define MLIB_UNICODE__GBRK_H /* clang-format off */ -#include "__rune.h" +#include "_rune.h" typedef enum { GBP_OTHER = 0, @@ -1564,4 +1564,4 @@ static const struct { {0x0E01F0, 0x0E0FFF, GBP_CTRL}, }; -#endif /* !MLIB_UNICODE___GBRK_H */ +#endif /* !MLIB_UNICODE__GBRK_H */ diff --git a/include/unicode/prop.h b/include/unicode/prop.h index e3e0d5e..01283e8 100644 --- a/include/unicode/prop.h +++ b/include/unicode/prop.h @@ -4,9 +4,9 @@ #include <inttypes.h> #include <stddef.h> -#include "__rune.h" -#include "__u8view.h" #include "_attrs.h" +#include "_rune.h" +#include "_u8view.h" struct rview { const rune *p; diff --git a/include/unicode/string.h b/include/unicode/string.h index 81c2aff..6363d9d 100644 --- a/include/unicode/string.h +++ b/include/unicode/string.h @@ -3,8 +3,8 @@ #include <stddef.h> -#include "__charN_t.h" -#include "__u8view.h" +#include "_charN_t.h" +#include "_u8view.h" /* clang-format off */ |