00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00145 #ifndef __UTF_OLD_H__
00146 #define __UTF_OLD_H__
00147
00159 #ifndef U_HIDE_OBSOLETE_UTF_OLD_H
00160 # define U_HIDE_OBSOLETE_UTF_OLD_H 0
00161 #endif
00162
00163 #if !defined(U_HIDE_DEPRECATED_API) && !U_HIDE_OBSOLETE_UTF_OLD_H
00164
00165 #include "unicode/utf.h"
00166 #include "unicode/utf8.h"
00167 #include "unicode/utf16.h"
00168
00169
00170
00171 #ifdef U_USE_UTF_DEPRECATES
00172
00179 typedef int32_t UTextOffset;
00180 #endif
00181
00183 #define UTF_SIZE 16
00184
00191 #define UTF_SAFE
00192
00193 #undef UTF_UNSAFE
00194
00195 #undef UTF_STRICT
00196
00211 #define UTF8_ERROR_VALUE_1 0x15
00212
00218 #define UTF8_ERROR_VALUE_2 0x9f
00219
00226 #define UTF_ERROR_VALUE 0xffff
00227
00234 #define UTF_IS_ERROR(c) \
00235 (((c)&0xfffe)==0xfffe || (c)==UTF8_ERROR_VALUE_1 || (c)==UTF8_ERROR_VALUE_2)
00236
00242 #define UTF_IS_VALID(c) \
00243 (UTF_IS_UNICODE_CHAR(c) && \
00244 (c)!=UTF8_ERROR_VALUE_1 && (c)!=UTF8_ERROR_VALUE_2)
00245
00250 #define UTF_IS_SURROGATE(uchar) (((uchar)&0xfffff800)==0xd800)
00251
00257 #define UTF_IS_UNICODE_NONCHAR(c) \
00258 ((c)>=0xfdd0 && \
00259 ((uint32_t)(c)<=0xfdef || ((c)&0xfffe)==0xfffe) && \
00260 (uint32_t)(c)<=0x10ffff)
00261
00277 #define UTF_IS_UNICODE_CHAR(c) \
00278 ((uint32_t)(c)<0xd800 || \
00279 ((uint32_t)(c)>0xdfff && \
00280 (uint32_t)(c)<=0x10ffff && \
00281 !UTF_IS_UNICODE_NONCHAR(c)))
00282
00283
00284
00296 #ifdef U_UTF8_IMPL
00297
00298 #elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
00299 U_CFUNC const uint8_t utf8_countTrailBytes[];
00300 #else
00301 U_CFUNC U_IMPORT const uint8_t utf8_countTrailBytes[];
00302 #endif
00303
00308 #define UTF8_COUNT_TRAIL_BYTES(leadByte) (utf8_countTrailBytes[(uint8_t)leadByte])
00309
00314 #define UTF8_MASK_LEAD_BYTE(leadByte, countTrailBytes) ((leadByte)&=(1<<(6-(countTrailBytes)))-1)
00315
00317 #define UTF8_IS_SINGLE(uchar) (((uchar)&0x80)==0)
00318
00319 #define UTF8_IS_LEAD(uchar) ((uint8_t)((uchar)-0xc0)<0x3e)
00320
00321 #define UTF8_IS_TRAIL(uchar) (((uchar)&0xc0)==0x80)
00322
00324 #define UTF8_NEED_MULTIPLE_UCHAR(c) ((uint32_t)(c)>0x7f)
00325
00339 #if 1
00340 # define UTF8_CHAR_LENGTH(c) \
00341 ((uint32_t)(c)<=0x7f ? 1 : \
00342 ((uint32_t)(c)<=0x7ff ? 2 : \
00343 ((uint32_t)((c)-0x10000)>0xfffff ? 3 : 4) \
00344 ) \
00345 )
00346 #else
00347 # define UTF8_CHAR_LENGTH(c) \
00348 ((uint32_t)(c)<=0x7f ? 1 : \
00349 ((uint32_t)(c)<=0x7ff ? 2 : \
00350 ((uint32_t)(c)<=0xffff ? 3 : \
00351 ((uint32_t)(c)<=0x10ffff ? 4 : \
00352 ((uint32_t)(c)<=0x3ffffff ? 5 : \
00353 ((uint32_t)(c)<=0x7fffffff ? 6 : 3) \
00354 ) \
00355 ) \
00356 ) \
00357 ) \
00358 )
00359 #endif
00360
00362 #define UTF8_MAX_CHAR_LENGTH 4
00363
00365 #define UTF8_ARRAY_SIZE(size) ((5*(size))/2)
00366
00368 #define UTF8_GET_CHAR_UNSAFE(s, i, c) { \
00369 int32_t _utf8_get_char_unsafe_index=(int32_t)(i); \
00370 UTF8_SET_CHAR_START_UNSAFE(s, _utf8_get_char_unsafe_index); \
00371 UTF8_NEXT_CHAR_UNSAFE(s, _utf8_get_char_unsafe_index, c); \
00372 }
00373
00375 #define UTF8_GET_CHAR_SAFE(s, start, i, length, c, strict) { \
00376 int32_t _utf8_get_char_safe_index=(int32_t)(i); \
00377 UTF8_SET_CHAR_START_SAFE(s, start, _utf8_get_char_safe_index); \
00378 UTF8_NEXT_CHAR_SAFE(s, _utf8_get_char_safe_index, length, c, strict); \
00379 }
00380
00382 #define UTF8_NEXT_CHAR_UNSAFE(s, i, c) { \
00383 (c)=(s)[(i)++]; \
00384 if((uint8_t)((c)-0xc0)<0x35) { \
00385 uint8_t __count=UTF8_COUNT_TRAIL_BYTES(c); \
00386 UTF8_MASK_LEAD_BYTE(c, __count); \
00387 switch(__count) { \
00388 \
00389 case 3: \
00390 (c)=((c)<<6)|((s)[(i)++]&0x3f); \
00391 case 2: \
00392 (c)=((c)<<6)|((s)[(i)++]&0x3f); \
00393 case 1: \
00394 (c)=((c)<<6)|((s)[(i)++]&0x3f); \
00395 \
00396 break; \
00397 } \
00398 } \
00399 }
00400
00402 #define UTF8_APPEND_CHAR_UNSAFE(s, i, c) { \
00403 if((uint32_t)(c)<=0x7f) { \
00404 (s)[(i)++]=(uint8_t)(c); \
00405 } else { \
00406 if((uint32_t)(c)<=0x7ff) { \
00407 (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); \
00408 } else { \
00409 if((uint32_t)(c)<=0xffff) { \
00410 (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); \
00411 } else { \
00412 (s)[(i)++]=(uint8_t)(((c)>>18)|0xf0); \
00413 (s)[(i)++]=(uint8_t)((((c)>>12)&0x3f)|0x80); \
00414 } \
00415 (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); \
00416 } \
00417 (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \
00418 } \
00419 }
00420
00422 #define UTF8_FWD_1_UNSAFE(s, i) { \
00423 (i)+=1+UTF8_COUNT_TRAIL_BYTES((s)[i]); \
00424 }
00425
00427 #define UTF8_FWD_N_UNSAFE(s, i, n) { \
00428 int32_t __N=(n); \
00429 while(__N>0) { \
00430 UTF8_FWD_1_UNSAFE(s, i); \
00431 --__N; \
00432 } \
00433 }
00434
00436 #define UTF8_SET_CHAR_START_UNSAFE(s, i) { \
00437 while(UTF8_IS_TRAIL((s)[i])) { --(i); } \
00438 }
00439
00441 #define UTF8_NEXT_CHAR_SAFE(s, i, length, c, strict) { \
00442 (c)=(s)[(i)++]; \
00443 if((c)>=0x80) { \
00444 if(UTF8_IS_LEAD(c)) { \
00445 (c)=utf8_nextCharSafeBody(s, &(i), (int32_t)(length), c, strict); \
00446 } else { \
00447 (c)=UTF8_ERROR_VALUE_1; \
00448 } \
00449 } \
00450 }
00451
00453 #define UTF8_APPEND_CHAR_SAFE(s, i, length, c) { \
00454 if((uint32_t)(c)<=0x7f) { \
00455 (s)[(i)++]=(uint8_t)(c); \
00456 } else { \
00457 (i)=utf8_appendCharSafeBody(s, (int32_t)(i), (int32_t)(length), c, NULL); \
00458 } \
00459 }
00460
00462 #define UTF8_FWD_1_SAFE(s, i, length) U8_FWD_1(s, i, length)
00463
00465 #define UTF8_FWD_N_SAFE(s, i, length, n) U8_FWD_N(s, i, length, n)
00466
00468 #define UTF8_SET_CHAR_START_SAFE(s, start, i) U8_SET_CP_START(s, start, i)
00469
00471 #define UTF8_PREV_CHAR_UNSAFE(s, i, c) { \
00472 (c)=(s)[--(i)]; \
00473 if(UTF8_IS_TRAIL(c)) { \
00474 uint8_t __b, __count=1, __shift=6; \
00475 \
00476 \
00477 (c)&=0x3f; \
00478 for(;;) { \
00479 __b=(s)[--(i)]; \
00480 if(__b>=0xc0) { \
00481 UTF8_MASK_LEAD_BYTE(__b, __count); \
00482 (c)|=(UChar32)__b<<__shift; \
00483 break; \
00484 } else { \
00485 (c)|=(UChar32)(__b&0x3f)<<__shift; \
00486 ++__count; \
00487 __shift+=6; \
00488 } \
00489 } \
00490 } \
00491 }
00492
00494 #define UTF8_BACK_1_UNSAFE(s, i) { \
00495 while(UTF8_IS_TRAIL((s)[--(i)])) {} \
00496 }
00497
00499 #define UTF8_BACK_N_UNSAFE(s, i, n) { \
00500 int32_t __N=(n); \
00501 while(__N>0) { \
00502 UTF8_BACK_1_UNSAFE(s, i); \
00503 --__N; \
00504 } \
00505 }
00506
00508 #define UTF8_SET_CHAR_LIMIT_UNSAFE(s, i) { \
00509 UTF8_BACK_1_UNSAFE(s, i); \
00510 UTF8_FWD_1_UNSAFE(s, i); \
00511 }
00512
00514 #define UTF8_PREV_CHAR_SAFE(s, start, i, c, strict) { \
00515 (c)=(s)[--(i)]; \
00516 if((c)>=0x80) { \
00517 if((c)<=0xbf) { \
00518 (c)=utf8_prevCharSafeBody(s, start, &(i), c, strict); \
00519 } else { \
00520 (c)=UTF8_ERROR_VALUE_1; \
00521 } \
00522 } \
00523 }
00524
00526 #define UTF8_BACK_1_SAFE(s, start, i) U8_BACK_1(s, start, i)
00527
00529 #define UTF8_BACK_N_SAFE(s, start, i, n) U8_BACK_N(s, start, i, n)
00530
00532 #define UTF8_SET_CHAR_LIMIT_SAFE(s, start, i, length) U8_SET_CP_LIMIT(s, start, i, length)
00533
00534
00535
00537 #define UTF_IS_FIRST_SURROGATE(uchar) (((uchar)&0xfffffc00)==0xd800)
00538
00540 #define UTF_IS_SECOND_SURROGATE(uchar) (((uchar)&0xfffffc00)==0xdc00)
00541
00543 #define UTF_IS_SURROGATE_FIRST(c) (((c)&0x400)==0)
00544
00546 #define UTF_SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000)
00547
00549 #define UTF16_GET_PAIR_VALUE(first, second) \
00550 (((first)<<10UL)+(second)-UTF_SURROGATE_OFFSET)
00551
00553 #define UTF_FIRST_SURROGATE(supplementary) (UChar)(((supplementary)>>10)+0xd7c0)
00554
00556 #define UTF_SECOND_SURROGATE(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00)
00557
00559 #define UTF16_LEAD(supplementary) UTF_FIRST_SURROGATE(supplementary)
00560
00562 #define UTF16_TRAIL(supplementary) UTF_SECOND_SURROGATE(supplementary)
00563
00565 #define UTF16_IS_SINGLE(uchar) !UTF_IS_SURROGATE(uchar)
00566
00568 #define UTF16_IS_LEAD(uchar) UTF_IS_FIRST_SURROGATE(uchar)
00569
00571 #define UTF16_IS_TRAIL(uchar) UTF_IS_SECOND_SURROGATE(uchar)
00572
00574 #define UTF16_NEED_MULTIPLE_UCHAR(c) ((uint32_t)(c)>0xffff)
00575
00577 #define UTF16_CHAR_LENGTH(c) ((uint32_t)(c)<=0xffff ? 1 : 2)
00578
00580 #define UTF16_MAX_CHAR_LENGTH 2
00581
00583 #define UTF16_ARRAY_SIZE(size) (size)
00584
00596 #define UTF16_GET_CHAR_UNSAFE(s, i, c) { \
00597 (c)=(s)[i]; \
00598 if(UTF_IS_SURROGATE(c)) { \
00599 if(UTF_IS_SURROGATE_FIRST(c)) { \
00600 (c)=UTF16_GET_PAIR_VALUE((c), (s)[(i)+1]); \
00601 } else { \
00602 (c)=UTF16_GET_PAIR_VALUE((s)[(i)-1], (c)); \
00603 } \
00604 } \
00605 }
00606
00608 #define UTF16_GET_CHAR_SAFE(s, start, i, length, c, strict) { \
00609 (c)=(s)[i]; \
00610 if(UTF_IS_SURROGATE(c)) { \
00611 uint16_t __c2; \
00612 if(UTF_IS_SURROGATE_FIRST(c)) { \
00613 if((i)+1<(length) && UTF_IS_SECOND_SURROGATE(__c2=(s)[(i)+1])) { \
00614 (c)=UTF16_GET_PAIR_VALUE((c), __c2); \
00615 \
00616 } else if(strict) {\
00617 \
00618 (c)=UTF_ERROR_VALUE; \
00619 } \
00620 } else { \
00621 if((i)-1>=(start) && UTF_IS_FIRST_SURROGATE(__c2=(s)[(i)-1])) { \
00622 (c)=UTF16_GET_PAIR_VALUE(__c2, (c)); \
00623 \
00624 } else if(strict) {\
00625 \
00626 (c)=UTF_ERROR_VALUE; \
00627 } \
00628 } \
00629 } else if((strict) && !UTF_IS_UNICODE_CHAR(c)) { \
00630 (c)=UTF_ERROR_VALUE; \
00631 } \
00632 }
00633
00635 #define UTF16_NEXT_CHAR_UNSAFE(s, i, c) { \
00636 (c)=(s)[(i)++]; \
00637 if(UTF_IS_FIRST_SURROGATE(c)) { \
00638 (c)=UTF16_GET_PAIR_VALUE((c), (s)[(i)++]); \
00639 } \
00640 }
00641
00643 #define UTF16_APPEND_CHAR_UNSAFE(s, i, c) { \
00644 if((uint32_t)(c)<=0xffff) { \
00645 (s)[(i)++]=(uint16_t)(c); \
00646 } else { \
00647 (s)[(i)++]=(uint16_t)(((c)>>10)+0xd7c0); \
00648 (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \
00649 } \
00650 }
00651
00653 #define UTF16_FWD_1_UNSAFE(s, i) { \
00654 if(UTF_IS_FIRST_SURROGATE((s)[(i)++])) { \
00655 ++(i); \
00656 } \
00657 }
00658
00660 #define UTF16_FWD_N_UNSAFE(s, i, n) { \
00661 int32_t __N=(n); \
00662 while(__N>0) { \
00663 UTF16_FWD_1_UNSAFE(s, i); \
00664 --__N; \
00665 } \
00666 }
00667
00669 #define UTF16_SET_CHAR_START_UNSAFE(s, i) { \
00670 if(UTF_IS_SECOND_SURROGATE((s)[i])) { \
00671 --(i); \
00672 } \
00673 }
00674
00676 #define UTF16_NEXT_CHAR_SAFE(s, i, length, c, strict) { \
00677 (c)=(s)[(i)++]; \
00678 if(UTF_IS_FIRST_SURROGATE(c)) { \
00679 uint16_t __c2; \
00680 if((i)<(length) && UTF_IS_SECOND_SURROGATE(__c2=(s)[(i)])) { \
00681 ++(i); \
00682 (c)=UTF16_GET_PAIR_VALUE((c), __c2); \
00683 \
00684 } else if(strict) {\
00685 \
00686 (c)=UTF_ERROR_VALUE; \
00687 } \
00688 } else if((strict) && !UTF_IS_UNICODE_CHAR(c)) { \
00689 \
00690 (c)=UTF_ERROR_VALUE; \
00691 } \
00692 }
00693
00695 #define UTF16_APPEND_CHAR_SAFE(s, i, length, c) { \
00696 if((uint32_t)(c)<=0xffff) { \
00697 (s)[(i)++]=(uint16_t)(c); \
00698 } else if((uint32_t)(c)<=0x10ffff) { \
00699 if((i)+1<(length)) { \
00700 (s)[(i)++]=(uint16_t)(((c)>>10)+0xd7c0); \
00701 (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \
00702 } else { \
00703 (s)[(i)++]=UTF_ERROR_VALUE; \
00704 } \
00705 } else { \
00706 (s)[(i)++]=UTF_ERROR_VALUE; \
00707 } \
00708 }
00709
00711 #define UTF16_FWD_1_SAFE(s, i, length) U16_FWD_1(s, i, length)
00712
00714 #define UTF16_FWD_N_SAFE(s, i, length, n) U16_FWD_N(s, i, length, n)
00715
00717 #define UTF16_SET_CHAR_START_SAFE(s, start, i) U16_SET_CP_START(s, start, i)
00718
00720 #define UTF16_PREV_CHAR_UNSAFE(s, i, c) { \
00721 (c)=(s)[--(i)]; \
00722 if(UTF_IS_SECOND_SURROGATE(c)) { \
00723 (c)=UTF16_GET_PAIR_VALUE((s)[--(i)], (c)); \
00724 } \
00725 }
00726
00728 #define UTF16_BACK_1_UNSAFE(s, i) { \
00729 if(UTF_IS_SECOND_SURROGATE((s)[--(i)])) { \
00730 --(i); \
00731 } \
00732 }
00733
00735 #define UTF16_BACK_N_UNSAFE(s, i, n) { \
00736 int32_t __N=(n); \
00737 while(__N>0) { \
00738 UTF16_BACK_1_UNSAFE(s, i); \
00739 --__N; \
00740 } \
00741 }
00742
00744 #define UTF16_SET_CHAR_LIMIT_UNSAFE(s, i) { \
00745 if(UTF_IS_FIRST_SURROGATE((s)[(i)-1])) { \
00746 ++(i); \
00747 } \
00748 }
00749
00751 #define UTF16_PREV_CHAR_SAFE(s, start, i, c, strict) { \
00752 (c)=(s)[--(i)]; \
00753 if(UTF_IS_SECOND_SURROGATE(c)) { \
00754 uint16_t __c2; \
00755 if((i)>(start) && UTF_IS_FIRST_SURROGATE(__c2=(s)[(i)-1])) { \
00756 --(i); \
00757 (c)=UTF16_GET_PAIR_VALUE(__c2, (c)); \
00758 \
00759 } else if(strict) {\
00760 \
00761 (c)=UTF_ERROR_VALUE; \
00762 } \
00763 } else if((strict) && !UTF_IS_UNICODE_CHAR(c)) { \
00764 \
00765 (c)=UTF_ERROR_VALUE; \
00766 } \
00767 }
00768
00770 #define UTF16_BACK_1_SAFE(s, start, i) U16_BACK_1(s, start, i)
00771
00773 #define UTF16_BACK_N_SAFE(s, start, i, n) U16_BACK_N(s, start, i, n)
00774
00776 #define UTF16_SET_CHAR_LIMIT_SAFE(s, start, i, length) U16_SET_CP_LIMIT(s, start, i, length)
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00796 #define UTF32_IS_SAFE(c, strict) \
00797 (!(strict) ? \
00798 (uint32_t)(c)<=0x10ffff : \
00799 UTF_IS_UNICODE_CHAR(c))
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00812 #define UTF32_IS_SINGLE(uchar) 1
00813
00814 #define UTF32_IS_LEAD(uchar) 0
00815
00816 #define UTF32_IS_TRAIL(uchar) 0
00817
00818
00819
00821 #define UTF32_NEED_MULTIPLE_UCHAR(c) 0
00822
00823 #define UTF32_CHAR_LENGTH(c) 1
00824
00825 #define UTF32_MAX_CHAR_LENGTH 1
00826
00827
00828
00830 #define UTF32_ARRAY_SIZE(size) (size)
00831
00833 #define UTF32_GET_CHAR_UNSAFE(s, i, c) { \
00834 (c)=(s)[i]; \
00835 }
00836
00838 #define UTF32_GET_CHAR_SAFE(s, start, i, length, c, strict) { \
00839 (c)=(s)[i]; \
00840 if(!UTF32_IS_SAFE(c, strict)) { \
00841 (c)=UTF_ERROR_VALUE; \
00842 } \
00843 }
00844
00845
00846
00848 #define UTF32_NEXT_CHAR_UNSAFE(s, i, c) { \
00849 (c)=(s)[(i)++]; \
00850 }
00851
00853 #define UTF32_APPEND_CHAR_UNSAFE(s, i, c) { \
00854 (s)[(i)++]=(c); \
00855 }
00856
00858 #define UTF32_FWD_1_UNSAFE(s, i) { \
00859 ++(i); \
00860 }
00861
00863 #define UTF32_FWD_N_UNSAFE(s, i, n) { \
00864 (i)+=(n); \
00865 }
00866
00868 #define UTF32_SET_CHAR_START_UNSAFE(s, i) { \
00869 }
00870
00872 #define UTF32_NEXT_CHAR_SAFE(s, i, length, c, strict) { \
00873 (c)=(s)[(i)++]; \
00874 if(!UTF32_IS_SAFE(c, strict)) { \
00875 (c)=UTF_ERROR_VALUE; \
00876 } \
00877 }
00878
00880 #define UTF32_APPEND_CHAR_SAFE(s, i, length, c) { \
00881 if((uint32_t)(c)<=0x10ffff) { \
00882 (s)[(i)++]=(c); \
00883 } else { \
00884 (s)[(i)++]=0xfffd; \
00885 } \
00886 }
00887
00889 #define UTF32_FWD_1_SAFE(s, i, length) { \
00890 ++(i); \
00891 }
00892
00894 #define UTF32_FWD_N_SAFE(s, i, length, n) { \
00895 if(((i)+=(n))>(length)) { \
00896 (i)=(length); \
00897 } \
00898 }
00899
00901 #define UTF32_SET_CHAR_START_SAFE(s, start, i) { \
00902 }
00903
00904
00905
00907 #define UTF32_PREV_CHAR_UNSAFE(s, i, c) { \
00908 (c)=(s)[--(i)]; \
00909 }
00910
00912 #define UTF32_BACK_1_UNSAFE(s, i) { \
00913 --(i); \
00914 }
00915
00917 #define UTF32_BACK_N_UNSAFE(s, i, n) { \
00918 (i)-=(n); \
00919 }
00920
00922 #define UTF32_SET_CHAR_LIMIT_UNSAFE(s, i) { \
00923 }
00924
00926 #define UTF32_PREV_CHAR_SAFE(s, start, i, c, strict) { \
00927 (c)=(s)[--(i)]; \
00928 if(!UTF32_IS_SAFE(c, strict)) { \
00929 (c)=UTF_ERROR_VALUE; \
00930 } \
00931 }
00932
00934 #define UTF32_BACK_1_SAFE(s, start, i) { \
00935 --(i); \
00936 }
00937
00939 #define UTF32_BACK_N_SAFE(s, start, i, n) { \
00940 (i)-=(n); \
00941 if((i)<(start)) { \
00942 (i)=(start); \
00943 } \
00944 }
00945
00947 #define UTF32_SET_CHAR_LIMIT_SAFE(s, i, length) { \
00948 }
00949
00950
00951
00957 #define UTF_ARRAY_SIZE(size) UTF16_ARRAY_SIZE(size)
00958
00960 #define UTF_GET_CHAR_UNSAFE(s, i, c) UTF16_GET_CHAR_UNSAFE(s, i, c)
00961
00963 #define UTF_GET_CHAR_SAFE(s, start, i, length, c, strict) UTF16_GET_CHAR_SAFE(s, start, i, length, c, strict)
00964
00965
00967 #define UTF_NEXT_CHAR_UNSAFE(s, i, c) UTF16_NEXT_CHAR_UNSAFE(s, i, c)
00968
00970 #define UTF_NEXT_CHAR_SAFE(s, i, length, c, strict) UTF16_NEXT_CHAR_SAFE(s, i, length, c, strict)
00971
00972
00974 #define UTF_APPEND_CHAR_UNSAFE(s, i, c) UTF16_APPEND_CHAR_UNSAFE(s, i, c)
00975
00977 #define UTF_APPEND_CHAR_SAFE(s, i, length, c) UTF16_APPEND_CHAR_SAFE(s, i, length, c)
00978
00979
00981 #define UTF_FWD_1_UNSAFE(s, i) UTF16_FWD_1_UNSAFE(s, i)
00982
00984 #define UTF_FWD_1_SAFE(s, i, length) UTF16_FWD_1_SAFE(s, i, length)
00985
00986
00988 #define UTF_FWD_N_UNSAFE(s, i, n) UTF16_FWD_N_UNSAFE(s, i, n)
00989
00991 #define UTF_FWD_N_SAFE(s, i, length, n) UTF16_FWD_N_SAFE(s, i, length, n)
00992
00993
00995 #define UTF_SET_CHAR_START_UNSAFE(s, i) UTF16_SET_CHAR_START_UNSAFE(s, i)
00996
00998 #define UTF_SET_CHAR_START_SAFE(s, start, i) UTF16_SET_CHAR_START_SAFE(s, start, i)
00999
01000
01002 #define UTF_PREV_CHAR_UNSAFE(s, i, c) UTF16_PREV_CHAR_UNSAFE(s, i, c)
01003
01005 #define UTF_PREV_CHAR_SAFE(s, start, i, c, strict) UTF16_PREV_CHAR_SAFE(s, start, i, c, strict)
01006
01007
01009 #define UTF_BACK_1_UNSAFE(s, i) UTF16_BACK_1_UNSAFE(s, i)
01010
01012 #define UTF_BACK_1_SAFE(s, start, i) UTF16_BACK_1_SAFE(s, start, i)
01013
01014
01016 #define UTF_BACK_N_UNSAFE(s, i, n) UTF16_BACK_N_UNSAFE(s, i, n)
01017
01019 #define UTF_BACK_N_SAFE(s, start, i, n) UTF16_BACK_N_SAFE(s, start, i, n)
01020
01021
01023 #define UTF_SET_CHAR_LIMIT_UNSAFE(s, i) UTF16_SET_CHAR_LIMIT_UNSAFE(s, i)
01024
01026 #define UTF_SET_CHAR_LIMIT_SAFE(s, start, i, length) UTF16_SET_CHAR_LIMIT_SAFE(s, start, i, length)
01027
01028
01029
01035 #define UTF_IS_SINGLE(uchar) U16_IS_SINGLE(uchar)
01036
01042 #define UTF_IS_LEAD(uchar) U16_IS_LEAD(uchar)
01043
01049 #define UTF_IS_TRAIL(uchar) U16_IS_TRAIL(uchar)
01050
01056 #define UTF_NEED_MULTIPLE_UCHAR(c) UTF16_NEED_MULTIPLE_UCHAR(c)
01057
01063 #define UTF_CHAR_LENGTH(c) U16_LENGTH(c)
01064
01070 #define UTF_MAX_CHAR_LENGTH U16_MAX_LENGTH
01071
01081 #define UTF_GET_CHAR(s, start, i, length, c) U16_GET(s, start, i, length, c)
01082
01094 #define UTF_NEXT_CHAR(s, i, length, c) U16_NEXT(s, i, length, c)
01095
01107 #define UTF_APPEND_CHAR(s, i, length, c) UTF16_APPEND_CHAR_SAFE(s, i, length, c)
01108
01118 #define UTF_FWD_1(s, i, length) U16_FWD_1(s, i, length)
01119
01129 #define UTF_FWD_N(s, i, length, n) U16_FWD_N(s, i, length, n)
01130
01145 #define UTF_SET_CHAR_START(s, start, i) U16_SET_CP_START(s, start, i)
01146
01158 #define UTF_PREV_CHAR(s, start, i, c) U16_PREV(s, start, i, c)
01159
01171 #define UTF_BACK_1(s, start, i) U16_BACK_1(s, start, i)
01172
01184 #define UTF_BACK_N(s, start, i, n) U16_BACK_N(s, start, i, n)
01185
01200 #define UTF_SET_CHAR_LIMIT(s, start, i, length) U16_SET_CP_LIMIT(s, start, i, length)
01201
01202 #endif // !U_HIDE_DEPRECATED_API && !U_HIDE_OBSOLETE_UTF_OLD_H
01203
01204 #endif