00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef UNORM_H
00016 #define UNORM_H
00017
00018 #include "unicode/utypes.h"
00019
00020 #if !UCONFIG_NO_NORMALIZATION
00021
00022 #include "unicode/uiter.h"
00023
00127 typedef enum {
00129 UNORM_NONE = 1,
00131 UNORM_NFD = 2,
00133 UNORM_NFKD = 3,
00135 UNORM_NFC = 4,
00137 UNORM_DEFAULT = UNORM_NFC,
00139 UNORM_NFKC =5,
00141 UNORM_FCD = 6,
00142
00144 UNORM_MODE_COUNT
00145 } UNormalizationMode;
00146
00154 enum {
00161 UNORM_UNICODE_3_2=0x20
00162 };
00163
00179 #define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20
00180
00199 U_STABLE int32_t U_EXPORT2
00200 unorm_normalize(const UChar *source, int32_t sourceLength,
00201 UNormalizationMode mode, int32_t options,
00202 UChar *result, int32_t resultLength,
00203 UErrorCode *status);
00204 #endif
00205
00210 typedef enum UNormalizationCheckResult {
00214 UNORM_NO,
00218 UNORM_YES,
00223 UNORM_MAYBE
00224 } UNormalizationCheckResult;
00225 #if !UCONFIG_NO_NORMALIZATION
00226
00246 U_STABLE UNormalizationCheckResult U_EXPORT2
00247 unorm_quickCheck(const UChar *source, int32_t sourcelength,
00248 UNormalizationMode mode,
00249 UErrorCode *status);
00250
00267 U_STABLE UNormalizationCheckResult U_EXPORT2
00268 unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
00269 UNormalizationMode mode, int32_t options,
00270 UErrorCode *pErrorCode);
00271
00293 U_STABLE UBool U_EXPORT2
00294 unorm_isNormalized(const UChar *src, int32_t srcLength,
00295 UNormalizationMode mode,
00296 UErrorCode *pErrorCode);
00297
00315 U_STABLE UBool U_EXPORT2
00316 unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
00317 UNormalizationMode mode, int32_t options,
00318 UErrorCode *pErrorCode);
00319
00393 U_STABLE int32_t U_EXPORT2
00394 unorm_next(UCharIterator *src,
00395 UChar *dest, int32_t destCapacity,
00396 UNormalizationMode mode, int32_t options,
00397 UBool doNormalize, UBool *pNeededToNormalize,
00398 UErrorCode *pErrorCode);
00399
00426 U_STABLE int32_t U_EXPORT2
00427 unorm_previous(UCharIterator *src,
00428 UChar *dest, int32_t destCapacity,
00429 UNormalizationMode mode, int32_t options,
00430 UBool doNormalize, UBool *pNeededToNormalize,
00431 UErrorCode *pErrorCode);
00432
00470 U_STABLE int32_t U_EXPORT2
00471 unorm_concatenate(const UChar *left, int32_t leftLength,
00472 const UChar *right, int32_t rightLength,
00473 UChar *dest, int32_t destCapacity,
00474 UNormalizationMode mode, int32_t options,
00475 UErrorCode *pErrorCode);
00476
00482 #define UNORM_INPUT_IS_FCD 0x20000
00483
00489 #define U_COMPARE_IGNORE_CASE 0x10000
00490
00491 #ifndef U_COMPARE_CODE_POINT_ORDER
00492
00498 #define U_COMPARE_CODE_POINT_ORDER 0x8000
00499 #endif
00500
00567 U_STABLE int32_t U_EXPORT2
00568 unorm_compare(const UChar *s1, int32_t length1,
00569 const UChar *s2, int32_t length2,
00570 uint32_t options,
00571 UErrorCode *pErrorCode);
00572
00573 #endif
00574
00575 #endif