byte-based C locale, phase 1: multibyte character handling functions
[musl] / src / multibyte / internal.h
index 82f5a07..53d62ed 100644 (file)
@@ -7,9 +7,11 @@
 #define bittab __fsmu8
 
 #include <stdint.h>
-#include "libc.h"
 
-extern const uint32_t bittab[] ATTR_LIBC_VISIBILITY;
+#ifdef __PIC__
+__attribute__((__visibility__("hidden")))
+#endif
+extern const uint32_t bittab[];
 
 /* Upper 6 state bits are a negative integer offset to bound-check next byte */
 /*    equivalent to: ( (b-0x80) | (b+offset) ) & ~0x3f      */
@@ -21,3 +23,10 @@ extern const uint32_t bittab[] ATTR_LIBC_VISIBILITY;
 
 #define SA 0xc2u
 #define SB 0xf4u
+
+/* Arbitrary encoding for representing code units instead of characters. */
+#define CODEUNIT(c) (0xdfff & (signed char)(c))
+#define IS_CODEUNIT(c) ((unsigned)(c)-0xdf80 < 0x80)
+
+/* Get inline definition of MB_CUR_MAX. */
+#include "locale_impl.h"