41#ifndef UTF8_UNICODE_UTILITIES
42#define UTF8_UNICODE_UTILITIES
50# define BSTR_PUBLIC __attribute__ ((visibility ("default")))
60#if INT_MAX >= 0x7fffffffUL
62#elif LONG_MAX >= 0x7fffffffUL
65#error This compiler is not supported
69typedef unsigned int cpUcs2;
70#elif USHRT_MAX == 0xFFFF
71typedef unsigned short cpUcs2;
72#elif UCHAR_MAX == 0xFFFF
73typedef unsigned char cpUcs2;
75#error This compiler is not supported
78#define isLegalUnicodeCodePoint(v) \
79 ((((v) < 0xD800L) || ((v) > 0xDFFFL)) && \
80 (((unsigned long)(v)) <= 0x0010FFFFL) && \
81 (((v)|0x1F0001) != 0x1FFFFFL))
91#define utf8IteratorNoMore(it) (!(it) || (it)->next >= (it)->slen)
94 unsigned char *
data,
int slen);
101 int len,
int pos, cpUcs4 *out);
#define data
Definition: hash.c:38
Definition: utf8util.h:83
unsigned char * data
Definition: utf8util.h:84
int start
Definition: utf8util.h:86
int slen
Definition: utf8util.h:85
int next
Definition: utf8util.h:87
int error
Definition: utf8util.h:88
#define BSTR_PUBLIC
Definition: utf8util.h:52
BSTR_PUBLIC void utf8IteratorInit(struct utf8Iterator *iter, unsigned char *data, int slen)
Definition: utf8util.c:59
BSTR_PUBLIC cpUcs4 utf8IteratorGetNextCodePoint(struct utf8Iterator *iter, cpUcs4 errCh)
Definition: utf8util.c:183
BSTR_PUBLIC int utf8ScanBackwardsForCodePoint(const unsigned char *msg, int len, int pos, cpUcs4 *out)
Definition: utf8util.c:81
BSTR_PUBLIC cpUcs4 utf8IteratorGetCurrCodePoint(struct utf8Iterator *iter, cpUcs4 errCh)
Definition: utf8util.c:288
BSTR_PUBLIC void utf8IteratorUninit(struct utf8Iterator *iter)
Definition: utf8util.c:71