aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/include/utf8.h
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/librune/include/utf8.h')
-rw-r--r--vendor/librune/include/utf8.h45
1 files changed, 19 insertions, 26 deletions
diff --git a/vendor/librune/include/utf8.h b/vendor/librune/include/utf8.h
index 1a91c24..f39e1bd 100644
--- a/vendor/librune/include/utf8.h
+++ b/vendor/librune/include/utf8.h
@@ -1,47 +1,40 @@
#ifndef RUNE_UTF8_H
#define RUNE_UTF8_H
-#if __STDC_VERSION__ < 202311L
-# include <stdbool.h> /* IWYU pragma: export */
-# define _RUNE_UNSEQUENCED
-#else
-# define _RUNE_UNSEQUENCED [[unsequenced]]
-#endif
-
+#include "internal/qmacros.h"
#define _RUNE_NEEDS_U8VIEW 1
#include "internal/types.h" /* IWYU pragma: export */
#define U8_LEN_MAX (4)
-int rtou8(char8_t *, rune, size_t);
int u8tor(rune *, const char8_t *);
int u8tor_uc(rune *, const char8_t *);
-const char8_t *u8chk(const char8_t *, size_t);
-_RUNE_UNSEQUENCED bool u8chkr(rune);
+int rtou8(char8_t *, rune, size_t);
+size_t u8set(char8_t *, rune, size_t);
-_RUNE_UNSEQUENCED int u8wdth(rune);
+char8_t *u8chk(const char8_t *, size_t);
+[[unsequenced]] bool u8chkr(rune);
-size_t u8len(const char8_t *, size_t);
+[[unsequenced]] int u8wdth(rune);
-const char8_t *u8next(rune *, const char8_t **, size_t *);
-const char8_t *u8prev(rune *, const char8_t **, const char8_t *);
+size_t u8len(const char8_t *, size_t);
-const char8_t *u8chr(const char8_t *, rune, size_t);
-const char8_t *u8rchr(const char8_t *, rune, size_t);
+int u8next(rune *, const char8_t **, size_t *);
+int u8prev(rune *, const char8_t **, const char8_t *);
-size_t u8set(const char8_t *, rune, size_t);
+char8_t *u8chr(const char8_t *, rune, size_t);
+char8_t *u8rchr(const char8_t *, rune, size_t);
-/* clang-format off */
-size_t u8spn(const char8_t *, size_t, const rune *, size_t);
-size_t u8bspn(const char8_t *, size_t, const rune *, size_t);
-size_t u8cspn(const char8_t *, size_t, const rune *, size_t);
+size_t u8spn(const char8_t *, size_t, const rune *, size_t);
+size_t u8bspn(const char8_t *, size_t, const rune *, size_t);
+size_t u8cspn(const char8_t *, size_t, const rune *, size_t);
size_t u8cbspn(const char8_t *, size_t, const rune *, size_t);
-#define U8SPN(S, N, P) u8spn((S), (N), (P), (sizeof(P) / sizeof(*(P))))
-#define U8BSPN(S, N, P) u8bspn((S), (N), (P), (sizeof(P) / sizeof(*(P))))
-#define U8CSPN(S, N, P) u8cspn((S), (N), (P), (sizeof(P) / sizeof(*(P))))
-#define U8CBSPN(S, N, P) u8cbspn((S), (N), (P), (sizeof(P) / sizeof(*(P))))
-/* clang-format on */
+#if _RUNE_MACRO_WRAP
+# define u8chk(s, n) _RUNE_Q_PTR(u8chk, (s), (s), (n))
+# define u8chr(s, ch, n) _RUNE_Q_PTR(u8chr, (s), (s), (ch), (n))
+# define u8rchr(s, ch, n) _RUNE_Q_PTR(u8rchr, (s), (s), (ch), (n))
+#endif
#endif /* !RUNE_UTF8_H */