44
44
#include "utf8proc_data.c"
45
45
46
46
47
- DLLEXPORT const int8_t utf8proc_utf8class [256 ] = {
47
+ UTF8PROC_DLLEXPORT const int8_t utf8proc_utf8class [256 ] = {
48
48
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
49
49
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
50
50
1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
@@ -87,11 +87,11 @@ DLLEXPORT const int8_t utf8proc_utf8class[256] = {
87
87
be different, being based on ABI compatibility.): */
88
88
#define STRINGIZEx (x ) #x
89
89
#define STRINGIZE (x ) STRINGIZEx(x)
90
- DLLEXPORT const char * utf8proc_version (void ) {
90
+ UTF8PROC_DLLEXPORT const char * utf8proc_version (void ) {
91
91
return STRINGIZE (UTF8PROC_VERSION_MAJOR ) "." STRINGIZE (UTF8PROC_VERSION_MINOR ) "." STRINGIZE (UTF8PROC_VERSION_PATCH ) "" ;
92
92
}
93
93
94
- DLLEXPORT const char * utf8proc_errmsg (ssize_t errcode ) {
94
+ UTF8PROC_DLLEXPORT const char * utf8proc_errmsg (ssize_t errcode ) {
95
95
switch (errcode ) {
96
96
case UTF8PROC_ERROR_NOMEM :
97
97
return "Memory for processing UTF-8 data could not be allocated." ;
@@ -108,7 +108,7 @@ DLLEXPORT const char *utf8proc_errmsg(ssize_t errcode) {
108
108
}
109
109
}
110
110
111
- DLLEXPORT ssize_t utf8proc_iterate (
111
+ UTF8PROC_DLLEXPORT ssize_t utf8proc_iterate (
112
112
const uint8_t * str , ssize_t strlen , int32_t * dst
113
113
) {
114
114
int length ;
@@ -148,14 +148,14 @@ DLLEXPORT ssize_t utf8proc_iterate(
148
148
return length ;
149
149
}
150
150
151
- DLLEXPORT bool utf8proc_codepoint_valid (int32_t uc ) {
151
+ UTF8PROC_DLLEXPORT bool utf8proc_codepoint_valid (int32_t uc ) {
152
152
if (uc < 0 || uc >= 0x110000 ||
153
153
((uc & 0xFFFF ) >= 0xFFFE ) || (uc >= 0xD800 && uc < 0xE000 ) ||
154
154
(uc >= 0xFDD0 && uc < 0xFDF0 )) return false;
155
155
else return true;
156
156
}
157
157
158
- DLLEXPORT ssize_t utf8proc_encode_char (int32_t uc , uint8_t * dst ) {
158
+ UTF8PROC_DLLEXPORT ssize_t utf8proc_encode_char (int32_t uc , uint8_t * dst ) {
159
159
if (uc < 0x00 ) {
160
160
return 0 ;
161
161
} else if (uc < 0x80 ) {
@@ -195,7 +195,7 @@ static const utf8proc_property_t *get_property(int32_t uc) {
195
195
);
196
196
}
197
197
198
- DLLEXPORT const utf8proc_property_t * utf8proc_get_property (int32_t uc ) {
198
+ UTF8PROC_DLLEXPORT const utf8proc_property_t * utf8proc_get_property (int32_t uc ) {
199
199
return uc < 0 || uc >= 0x110000 ? utf8proc_properties : get_property (uc );
200
200
}
201
201
@@ -226,22 +226,22 @@ static bool grapheme_break(int lbc, int tbc) {
226
226
}
227
227
228
228
/* return whether there is a grapheme break between codepoints c1 and c2 */
229
- DLLEXPORT bool utf8proc_grapheme_break (int32_t c1 , int32_t c2 ) {
229
+ UTF8PROC_DLLEXPORT bool utf8proc_grapheme_break (int32_t c1 , int32_t c2 ) {
230
230
return grapheme_break (utf8proc_get_property (c1 )-> boundclass ,
231
231
utf8proc_get_property (c2 )-> boundclass );
232
232
}
233
233
234
234
/* return a character width analogous to wcwidth (except portable and
235
235
hopefully less buggy than most system wcwidth functions). */
236
- DLLEXPORT int utf8proc_charwidth (int32_t c ) {
236
+ UTF8PROC_DLLEXPORT int utf8proc_charwidth (int32_t c ) {
237
237
return utf8proc_get_property (c )-> charwidth ;
238
238
}
239
239
240
- DLLEXPORT utf8proc_category_t utf8proc_category (int32_t c ) {
240
+ UTF8PROC_DLLEXPORT utf8proc_category_t utf8proc_category (int32_t c ) {
241
241
return utf8proc_get_property (c )-> category ;
242
242
}
243
243
244
- DLLEXPORT const char * utf8proc_category_string (int32_t c ) {
244
+ UTF8PROC_DLLEXPORT const char * utf8proc_category_string (int32_t c ) {
245
245
static const char s [][3 ] = {"Cn" ,"Lu" ,"Ll" ,"Lt" ,"Lm" ,"Lo" ,"Mn" ,"Mc" ,"Me" ,"Nd" ,"Nl" ,"No" ,"Pc" ,"Pd" ,"Ps" ,"Pe" ,"Pi" ,"Pf" ,"Po" ,"Sm" ,"Sc" ,"Sk" ,"So" ,"Zs" ,"Zl" ,"Zp" ,"Cc" ,"Cf" ,"Cs" ,"Co" };
246
246
return s [utf8proc_category (c )];
247
247
}
@@ -250,7 +250,7 @@ DLLEXPORT const char *utf8proc_category_string(int32_t c) {
250
250
return utf8proc_decompose_char((replacement_uc), dst, bufsize, \
251
251
options & ~UTF8PROC_LUMP, last_boundclass)
252
252
253
- DLLEXPORT ssize_t utf8proc_decompose_char (int32_t uc , int32_t * dst , ssize_t bufsize , utf8proc_option_t options , int * last_boundclass ) {
253
+ UTF8PROC_DLLEXPORT ssize_t utf8proc_decompose_char (int32_t uc , int32_t * dst , ssize_t bufsize , utf8proc_option_t options , int * last_boundclass ) {
254
254
const utf8proc_property_t * property ;
255
255
utf8proc_propval_t category ;
256
256
int32_t hangul_sindex ;
@@ -354,7 +354,7 @@ DLLEXPORT ssize_t utf8proc_decompose_char(int32_t uc, int32_t *dst, ssize_t bufs
354
354
return 1 ;
355
355
}
356
356
357
- DLLEXPORT ssize_t utf8proc_decompose (
357
+ UTF8PROC_DLLEXPORT ssize_t utf8proc_decompose (
358
358
const uint8_t * str , ssize_t strlen ,
359
359
int32_t * buffer , ssize_t bufsize , utf8proc_option_t options
360
360
) {
@@ -416,7 +416,7 @@ DLLEXPORT ssize_t utf8proc_decompose(
416
416
return wpos ;
417
417
}
418
418
419
- DLLEXPORT ssize_t utf8proc_reencode (int32_t * buffer , ssize_t length , utf8proc_option_t options ) {
419
+ UTF8PROC_DLLEXPORT ssize_t utf8proc_reencode (int32_t * buffer , ssize_t length , utf8proc_option_t options ) {
420
420
/* UTF8PROC_NULLTERM option will be ignored, 'length' is never ignored
421
421
ASSERT: 'buffer' has one spare byte of free space at the end! */
422
422
if (options & (UTF8PROC_NLF2LS | UTF8PROC_NLF2PS | UTF8PROC_STRIPCC )) {
@@ -531,7 +531,7 @@ DLLEXPORT ssize_t utf8proc_reencode(int32_t *buffer, ssize_t length, utf8proc_op
531
531
}
532
532
}
533
533
534
- DLLEXPORT ssize_t utf8proc_map (
534
+ UTF8PROC_DLLEXPORT ssize_t utf8proc_map (
535
535
const uint8_t * str , ssize_t strlen , uint8_t * * dstptr , utf8proc_option_t options
536
536
) {
537
537
int32_t * buffer ;
@@ -560,28 +560,28 @@ DLLEXPORT ssize_t utf8proc_map(
560
560
return result ;
561
561
}
562
562
563
- DLLEXPORT uint8_t * utf8proc_NFD (const uint8_t * str ) {
563
+ UTF8PROC_DLLEXPORT uint8_t * utf8proc_NFD (const uint8_t * str ) {
564
564
uint8_t * retval ;
565
565
utf8proc_map (str , 0 , & retval , UTF8PROC_NULLTERM | UTF8PROC_STABLE |
566
566
UTF8PROC_DECOMPOSE );
567
567
return retval ;
568
568
}
569
569
570
- DLLEXPORT uint8_t * utf8proc_NFC (const uint8_t * str ) {
570
+ UTF8PROC_DLLEXPORT uint8_t * utf8proc_NFC (const uint8_t * str ) {
571
571
uint8_t * retval ;
572
572
utf8proc_map (str , 0 , & retval , UTF8PROC_NULLTERM | UTF8PROC_STABLE |
573
573
UTF8PROC_COMPOSE );
574
574
return retval ;
575
575
}
576
576
577
- DLLEXPORT uint8_t * utf8proc_NFKD (const uint8_t * str ) {
577
+ UTF8PROC_DLLEXPORT uint8_t * utf8proc_NFKD (const uint8_t * str ) {
578
578
uint8_t * retval ;
579
579
utf8proc_map (str , 0 , & retval , UTF8PROC_NULLTERM | UTF8PROC_STABLE |
580
580
UTF8PROC_DECOMPOSE | UTF8PROC_COMPAT );
581
581
return retval ;
582
582
}
583
583
584
- DLLEXPORT uint8_t * utf8proc_NFKC (const uint8_t * str ) {
584
+ UTF8PROC_DLLEXPORT uint8_t * utf8proc_NFKC (const uint8_t * str ) {
585
585
uint8_t * retval ;
586
586
utf8proc_map (str , 0 , & retval , UTF8PROC_NULLTERM | UTF8PROC_STABLE |
587
587
UTF8PROC_COMPOSE | UTF8PROC_COMPAT );
0 commit comments