56 #include <sys/types.h> 58 typedef signed char int8_t;
59 typedef unsigned char uint8_t;
60 typedef short int16_t;
61 typedef unsigned short uint16_t;
64 #define ssize_t __int64 68 typedef unsigned char bool;
81 #define SSIZE_MAX ((size_t)SIZE_MAX/2) 84 #define UTF8PROC_NULLTERM (1<<0) 85 #define UTF8PROC_STABLE (1<<1) 86 #define UTF8PROC_COMPAT (1<<2) 87 #define UTF8PROC_COMPOSE (1<<3) 88 #define UTF8PROC_DECOMPOSE (1<<4) 89 #define UTF8PROC_IGNORE (1<<5) 90 #define UTF8PROC_REJECTNA (1<<6) 91 #define UTF8PROC_NLF2LS (1<<7) 92 #define UTF8PROC_NLF2PS (1<<8) 93 #define UTF8PROC_NLF2LF (UTF8PROC_NLF2LS | UTF8PROC_NLF2PS) 94 #define UTF8PROC_STRIPCC (1<<9) 95 #define UTF8PROC_CASEFOLD (1<<10) 96 #define UTF8PROC_CHARBOUND (1<<11) 97 #define UTF8PROC_LUMP (1<<12) 98 #define UTF8PROC_STRIPMARK (1<<13) 137 #define UTF8PROC_ERROR_NOMEM -1 138 #define UTF8PROC_ERROR_OVERFLOW -2 139 #define UTF8PROC_ERROR_INVALIDUTF8 -3 140 #define UTF8PROC_ERROR_NOTASSIGNED -4 141 #define UTF8PROC_ERROR_INVALIDOPTS -5 152 typedef int16_t utf8proc_propval_t;
154 utf8proc_propval_t category;
155 utf8proc_propval_t combining_class;
156 utf8proc_propval_t bidi_class;
157 utf8proc_propval_t decomp_type;
158 const int32_t *decomp_mapping;
159 unsigned bidi_mirrored:1;
160 int32_t uppercase_mapping;
161 int32_t lowercase_mapping;
162 int32_t titlecase_mapping;
163 int32_t comb1st_index;
164 int32_t comb2nd_index;
165 unsigned comp_exclusion:1;
166 unsigned ignorable:1;
167 unsigned control_boundary:1;
169 const int32_t *casefold_mapping;
172 #define UTF8PROC_CATEGORY_LU 1 173 #define UTF8PROC_CATEGORY_LL 2 174 #define UTF8PROC_CATEGORY_LT 3 175 #define UTF8PROC_CATEGORY_LM 4 176 #define UTF8PROC_CATEGORY_LO 5 177 #define UTF8PROC_CATEGORY_MN 6 178 #define UTF8PROC_CATEGORY_MC 7 179 #define UTF8PROC_CATEGORY_ME 8 180 #define UTF8PROC_CATEGORY_ND 9 181 #define UTF8PROC_CATEGORY_NL 10 182 #define UTF8PROC_CATEGORY_NO 11 183 #define UTF8PROC_CATEGORY_PC 12 184 #define UTF8PROC_CATEGORY_PD 13 185 #define UTF8PROC_CATEGORY_PS 14 186 #define UTF8PROC_CATEGORY_PE 15 187 #define UTF8PROC_CATEGORY_PI 16 188 #define UTF8PROC_CATEGORY_PF 17 189 #define UTF8PROC_CATEGORY_PO 18 190 #define UTF8PROC_CATEGORY_SM 19 191 #define UTF8PROC_CATEGORY_SC 20 192 #define UTF8PROC_CATEGORY_SK 21 193 #define UTF8PROC_CATEGORY_SO 22 194 #define UTF8PROC_CATEGORY_ZS 23 195 #define UTF8PROC_CATEGORY_ZL 24 196 #define UTF8PROC_CATEGORY_ZP 25 197 #define UTF8PROC_CATEGORY_CC 26 198 #define UTF8PROC_CATEGORY_CF 27 199 #define UTF8PROC_CATEGORY_CS 28 200 #define UTF8PROC_CATEGORY_CO 29 201 #define UTF8PROC_CATEGORY_CN 30 202 #define UTF8PROC_BIDI_CLASS_L 1 203 #define UTF8PROC_BIDI_CLASS_LRE 2 204 #define UTF8PROC_BIDI_CLASS_LRO 3 205 #define UTF8PROC_BIDI_CLASS_R 4 206 #define UTF8PROC_BIDI_CLASS_AL 5 207 #define UTF8PROC_BIDI_CLASS_RLE 6 208 #define UTF8PROC_BIDI_CLASS_RLO 7 209 #define UTF8PROC_BIDI_CLASS_PDF 8 210 #define UTF8PROC_BIDI_CLASS_EN 9 211 #define UTF8PROC_BIDI_CLASS_ES 10 212 #define UTF8PROC_BIDI_CLASS_ET 11 213 #define UTF8PROC_BIDI_CLASS_AN 12 214 #define UTF8PROC_BIDI_CLASS_CS 13 215 #define UTF8PROC_BIDI_CLASS_NSM 14 216 #define UTF8PROC_BIDI_CLASS_BN 15 217 #define UTF8PROC_BIDI_CLASS_B 16 218 #define UTF8PROC_BIDI_CLASS_S 17 219 #define UTF8PROC_BIDI_CLASS_WS 18 220 #define UTF8PROC_BIDI_CLASS_ON 19 221 #define UTF8PROC_DECOMP_TYPE_FONT 1 222 #define UTF8PROC_DECOMP_TYPE_NOBREAK 2 223 #define UTF8PROC_DECOMP_TYPE_INITIAL 3 224 #define UTF8PROC_DECOMP_TYPE_MEDIAL 4 225 #define UTF8PROC_DECOMP_TYPE_FINAL 5 226 #define UTF8PROC_DECOMP_TYPE_ISOLATED 6 227 #define UTF8PROC_DECOMP_TYPE_CIRCLE 7 228 #define UTF8PROC_DECOMP_TYPE_SUPER 8 229 #define UTF8PROC_DECOMP_TYPE_SUB 9 230 #define UTF8PROC_DECOMP_TYPE_VERTICAL 10 231 #define UTF8PROC_DECOMP_TYPE_WIDE 11 232 #define UTF8PROC_DECOMP_TYPE_NARROW 12 233 #define UTF8PROC_DECOMP_TYPE_SMALL 13 234 #define UTF8PROC_DECOMP_TYPE_SQUARE 14 235 #define UTF8PROC_DECOMP_TYPE_FRACTION 15 236 #define UTF8PROC_DECOMP_TYPE_COMPAT 16 238 extern const int8_t utf8proc_utf8class[256];
240 const char *utf8proc_version(
void);
242 const char *utf8proc_errmsg(ssize_t errcode);
247 ssize_t utf8proc_iterate(
const uint8_t *str, ssize_t strlen, int32_t *dst);
258 bool utf8proc_codepoint_valid(int32_t uc);
263 ssize_t utf8proc_encode_char(int32_t uc, uint8_t *dst);
283 ssize_t utf8proc_decompose_char(
284 int32_t uc, int32_t *dst, ssize_t bufsize,
285 int options,
int *last_boundclass
311 ssize_t utf8proc_decompose(
312 const uint8_t *str, ssize_t strlen,
313 int32_t *buffer, ssize_t bufsize,
int options
329 ssize_t utf8proc_reencode(int32_t *buffer, ssize_t length,
int options);
352 ssize_t utf8proc_map(
353 const uint8_t *str, ssize_t strlen, uint8_t **dstptr,
int options
371 uint8_t *utf8proc_NFD(
const uint8_t *str);
372 uint8_t *utf8proc_NFC(
const uint8_t *str);
373 uint8_t *utf8proc_NFKD(
const uint8_t *str);
374 uint8_t *utf8proc_NFKC(
const uint8_t *str);
Definition: utf8proc.h:153
Provide printf() PRIxxx Constante Beyond Standards.