aboutsummaryrefslogtreecommitdiff
path: root/src/unicode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/unicode.h')
-rw-r--r--src/unicode.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/unicode.h b/src/unicode.h
index 36bbc81..8c38409 100644
--- a/src/unicode.h
+++ b/src/unicode.h
@@ -3,10 +3,9 @@
#include <stdbool.h>
#include <stddef.h>
-#include <stdint.h>
-#define RUNE_C(x) UINT32_C(x)
-typedef uint32_t rune;
+#include "common.h"
+#include "types.h"
/* Assert that CH has the Unicode Pattern_White_Space property */
bool rune_is_pat_ws(rune ch) __attribute__((const));
@@ -21,17 +20,20 @@ bool rune_is_xidc(rune ch) __attribute__((const));
/* Decode the first UTF-8 rune in S, and point S to the next rune in the stream.
This function assumes that S points to a buffer that’s padded to a length of
4 bytes, and doesn’t perform any form of input validation. */
-rune utf8_decode(const unsigned char **s);
+rune utf8_decode(const uchar **s)
+ __attribute__((nonnull));
/* Return the offset of the first invalid byte in the UTF-8 string S of length
LEN. This function assumes that S points to a buffer that’s padded to a
length of 4 bytes (although LEN should not reflect any added padding). */
-size_t utf8_validate_off(const unsigned char *s, size_t len);
+size_t utf8_validate_off(const uchar *s, size_t len)
+ __attribute__((nonnull));
#if ORYX_SIMD
/* Assert whether the UTF-8 string S of length LEN is valid, using SIMD
intristics to speed-up computation. */
-bool utf8_validate_simd(const unsigned char *s, size_t len);
+bool utf8_validate_simd(const uchar *s, size_t len)
+ __attribute__((nonnull));
#endif
#endif /* !ORYX_UNICODE_H */