michael@0: /*
michael@0: *******************************************************************************
michael@0: *
michael@0: * Copyright (C) 2009-2013, International Business Machines
michael@0: * Corporation and others. All Rights Reserved.
michael@0: *
michael@0: *******************************************************************************
michael@0: * file name: unorm2.h
michael@0: * encoding: US-ASCII
michael@0: * tab size: 8 (not used)
michael@0: * indentation:4
michael@0: *
michael@0: * created on: 2009dec15
michael@0: * created by: Markus W. Scherer
michael@0: */
michael@0:
michael@0: #ifndef __UNORM2_H__
michael@0: #define __UNORM2_H__
michael@0:
michael@0: /**
michael@0: * \file
michael@0: * \brief C API: New API for Unicode Normalization.
michael@0: *
michael@0: * Unicode normalization functionality for standard Unicode normalization or
michael@0: * for using custom mapping tables.
michael@0: * All instances of UNormalizer2 are unmodifiable/immutable.
michael@0: * Instances returned by unorm2_getInstance() are singletons that must not be deleted by the caller.
michael@0: * For more details see the Normalizer2 C++ class.
michael@0: */
michael@0:
michael@0: #include "unicode/utypes.h"
michael@0: #include "unicode/localpointer.h"
michael@0: #include "unicode/uset.h"
michael@0:
michael@0: /**
michael@0: * Constants for normalization modes.
michael@0: * For details about standard Unicode normalization forms
michael@0: * and about the algorithms which are also used with custom mapping tables
michael@0: * see http://www.unicode.org/unicode/reports/tr15/
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: typedef enum {
michael@0: /**
michael@0: * Decomposition followed by composition.
michael@0: * Same as standard NFC when using an "nfc" instance.
michael@0: * Same as standard NFKC when using an "nfkc" instance.
michael@0: * For details about standard Unicode normalization forms
michael@0: * see http://www.unicode.org/unicode/reports/tr15/
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: UNORM2_COMPOSE,
michael@0: /**
michael@0: * Map, and reorder canonically.
michael@0: * Same as standard NFD when using an "nfc" instance.
michael@0: * Same as standard NFKD when using an "nfkc" instance.
michael@0: * For details about standard Unicode normalization forms
michael@0: * see http://www.unicode.org/unicode/reports/tr15/
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: UNORM2_DECOMPOSE,
michael@0: /**
michael@0: * "Fast C or D" form.
michael@0: * If a string is in this form, then further decomposition without reordering
michael@0: * would yield the same form as DECOMPOSE.
michael@0: * Text in "Fast C or D" form can be processed efficiently with data tables
michael@0: * that are "canonically closed", that is, that provide equivalent data for
michael@0: * equivalent text, without having to be fully normalized.
michael@0: * Not a standard Unicode normalization form.
michael@0: * Not a unique form: Different FCD strings can be canonically equivalent.
michael@0: * For details see http://www.unicode.org/notes/tn5/#FCD
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: UNORM2_FCD,
michael@0: /**
michael@0: * Compose only contiguously.
michael@0: * Also known as "FCC" or "Fast C Contiguous".
michael@0: * The result will often but not always be in NFC.
michael@0: * The result will conform to FCD which is useful for processing.
michael@0: * Not a standard Unicode normalization form.
michael@0: * For details see http://www.unicode.org/notes/tn5/#FCC
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: UNORM2_COMPOSE_CONTIGUOUS
michael@0: } UNormalization2Mode;
michael@0:
michael@0: /**
michael@0: * Result values for normalization quick check functions.
michael@0: * For details see http://www.unicode.org/reports/tr15/#Detecting_Normalization_Forms
michael@0: * @stable ICU 2.0
michael@0: */
michael@0: typedef enum UNormalizationCheckResult {
michael@0: /**
michael@0: * The input string is not in the normalization form.
michael@0: * @stable ICU 2.0
michael@0: */
michael@0: UNORM_NO,
michael@0: /**
michael@0: * The input string is in the normalization form.
michael@0: * @stable ICU 2.0
michael@0: */
michael@0: UNORM_YES,
michael@0: /**
michael@0: * The input string may or may not be in the normalization form.
michael@0: * This value is only returned for composition forms like NFC and FCC,
michael@0: * when a backward-combining character is found for which the surrounding text
michael@0: * would have to be analyzed further.
michael@0: * @stable ICU 2.0
michael@0: */
michael@0: UNORM_MAYBE
michael@0: } UNormalizationCheckResult;
michael@0:
michael@0: /**
michael@0: * Opaque C service object type for the new normalization API.
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: struct UNormalizer2;
michael@0: typedef struct UNormalizer2 UNormalizer2; /**< C typedef for struct UNormalizer2. @stable ICU 4.4 */
michael@0:
michael@0: #if !UCONFIG_NO_NORMALIZATION
michael@0:
michael@0: /**
michael@0: * Returns a UNormalizer2 instance for Unicode NFC normalization.
michael@0: * Same as unorm2_getInstance(NULL, "nfc", UNORM2_COMPOSE, pErrorCode).
michael@0: * Returns an unmodifiable singleton instance. Do not delete it.
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return the requested Normalizer2, if successful
michael@0: * @stable ICU 49
michael@0: */
michael@0: U_STABLE const UNormalizer2 * U_EXPORT2
michael@0: unorm2_getNFCInstance(UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Returns a UNormalizer2 instance for Unicode NFD normalization.
michael@0: * Same as unorm2_getInstance(NULL, "nfc", UNORM2_DECOMPOSE, pErrorCode).
michael@0: * Returns an unmodifiable singleton instance. Do not delete it.
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return the requested Normalizer2, if successful
michael@0: * @stable ICU 49
michael@0: */
michael@0: U_STABLE const UNormalizer2 * U_EXPORT2
michael@0: unorm2_getNFDInstance(UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Returns a UNormalizer2 instance for Unicode NFKC normalization.
michael@0: * Same as unorm2_getInstance(NULL, "nfkc", UNORM2_COMPOSE, pErrorCode).
michael@0: * Returns an unmodifiable singleton instance. Do not delete it.
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return the requested Normalizer2, if successful
michael@0: * @stable ICU 49
michael@0: */
michael@0: U_STABLE const UNormalizer2 * U_EXPORT2
michael@0: unorm2_getNFKCInstance(UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Returns a UNormalizer2 instance for Unicode NFKD normalization.
michael@0: * Same as unorm2_getInstance(NULL, "nfkc", UNORM2_DECOMPOSE, pErrorCode).
michael@0: * Returns an unmodifiable singleton instance. Do not delete it.
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return the requested Normalizer2, if successful
michael@0: * @stable ICU 49
michael@0: */
michael@0: U_STABLE const UNormalizer2 * U_EXPORT2
michael@0: unorm2_getNFKDInstance(UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Returns a UNormalizer2 instance for Unicode NFKC_Casefold normalization.
michael@0: * Same as unorm2_getInstance(NULL, "nfkc_cf", UNORM2_COMPOSE, pErrorCode).
michael@0: * Returns an unmodifiable singleton instance. Do not delete it.
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return the requested Normalizer2, if successful
michael@0: * @stable ICU 49
michael@0: */
michael@0: U_STABLE const UNormalizer2 * U_EXPORT2
michael@0: unorm2_getNFKCCasefoldInstance(UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Returns a UNormalizer2 instance which uses the specified data file
michael@0: * (packageName/name similar to ucnv_openPackage() and ures_open()/ResourceBundle)
michael@0: * and which composes or decomposes text according to the specified mode.
michael@0: * Returns an unmodifiable singleton instance. Do not delete it.
michael@0: *
michael@0: * Use packageName=NULL for data files that are part of ICU's own data.
michael@0: * Use name="nfc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode standard NFC/NFD.
michael@0: * Use name="nfkc" and UNORM2_COMPOSE/UNORM2_DECOMPOSE for Unicode standard NFKC/NFKD.
michael@0: * Use name="nfkc_cf" and UNORM2_COMPOSE for Unicode standard NFKC_CF=NFKC_Casefold.
michael@0: *
michael@0: * @param packageName NULL for ICU built-in data, otherwise application data package name
michael@0: * @param name "nfc" or "nfkc" or "nfkc_cf" or name of custom data file
michael@0: * @param mode normalization mode (compose or decompose etc.)
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return the requested UNormalizer2, if successful
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE const UNormalizer2 * U_EXPORT2
michael@0: unorm2_getInstance(const char *packageName,
michael@0: const char *name,
michael@0: UNormalization2Mode mode,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Constructs a filtered normalizer wrapping any UNormalizer2 instance
michael@0: * and a filter set.
michael@0: * Both are aliased and must not be modified or deleted while this object
michael@0: * is used.
michael@0: * The filter set should be frozen; otherwise the performance will suffer greatly.
michael@0: * @param norm2 wrapped UNormalizer2 instance
michael@0: * @param filterSet USet which determines the characters to be normalized
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return the requested UNormalizer2, if successful
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE UNormalizer2 * U_EXPORT2
michael@0: unorm2_openFiltered(const UNormalizer2 *norm2, const USet *filterSet, UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Closes a UNormalizer2 instance from unorm2_openFiltered().
michael@0: * Do not close instances from unorm2_getInstance()!
michael@0: * @param norm2 UNormalizer2 instance to be closed
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE void U_EXPORT2
michael@0: unorm2_close(UNormalizer2 *norm2);
michael@0:
michael@0: #if U_SHOW_CPLUSPLUS_API
michael@0:
michael@0: U_NAMESPACE_BEGIN
michael@0:
michael@0: /**
michael@0: * \class LocalUNormalizer2Pointer
michael@0: * "Smart pointer" class, closes a UNormalizer2 via unorm2_close().
michael@0: * For most methods see the LocalPointerBase base class.
michael@0: *
michael@0: * @see LocalPointerBase
michael@0: * @see LocalPointer
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_DEFINE_LOCAL_OPEN_POINTER(LocalUNormalizer2Pointer, UNormalizer2, unorm2_close);
michael@0:
michael@0: U_NAMESPACE_END
michael@0:
michael@0: #endif
michael@0:
michael@0: /**
michael@0: * Writes the normalized form of the source string to the destination string
michael@0: * (replacing its contents) and returns the length of the destination string.
michael@0: * The source and destination strings must be different buffers.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param src source string
michael@0: * @param length length of the source string, or -1 if NUL-terminated
michael@0: * @param dest destination string; its contents is replaced with normalized src
michael@0: * @param capacity number of UChars that can be written to dest
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return dest
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm2_normalize(const UNormalizer2 *norm2,
michael@0: const UChar *src, int32_t length,
michael@0: UChar *dest, int32_t capacity,
michael@0: UErrorCode *pErrorCode);
michael@0: /**
michael@0: * Appends the normalized form of the second string to the first string
michael@0: * (merging them at the boundary) and returns the length of the first string.
michael@0: * The result is normalized if the first string was normalized.
michael@0: * The first and second strings must be different buffers.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param first string, should be normalized
michael@0: * @param firstLength length of the first string, or -1 if NUL-terminated
michael@0: * @param firstCapacity number of UChars that can be written to first
michael@0: * @param second string, will be normalized
michael@0: * @param secondLength length of the source string, or -1 if NUL-terminated
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return first
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm2_normalizeSecondAndAppend(const UNormalizer2 *norm2,
michael@0: UChar *first, int32_t firstLength, int32_t firstCapacity,
michael@0: const UChar *second, int32_t secondLength,
michael@0: UErrorCode *pErrorCode);
michael@0: /**
michael@0: * Appends the second string to the first string
michael@0: * (merging them at the boundary) and returns the length of the first string.
michael@0: * The result is normalized if both the strings were normalized.
michael@0: * The first and second strings must be different buffers.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param first string, should be normalized
michael@0: * @param firstLength length of the first string, or -1 if NUL-terminated
michael@0: * @param firstCapacity number of UChars that can be written to first
michael@0: * @param second string, should be normalized
michael@0: * @param secondLength length of the source string, or -1 if NUL-terminated
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return first
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm2_append(const UNormalizer2 *norm2,
michael@0: UChar *first, int32_t firstLength, int32_t firstCapacity,
michael@0: const UChar *second, int32_t secondLength,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Gets the decomposition mapping of c.
michael@0: * Roughly equivalent to normalizing the String form of c
michael@0: * on a UNORM2_DECOMPOSE UNormalizer2 instance, but much faster, and except that this function
michael@0: * returns a negative value and does not write a string
michael@0: * if c does not have a decomposition mapping in this instance's data.
michael@0: * This function is independent of the mode of the UNormalizer2.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param c code point
michael@0: * @param decomposition String buffer which will be set to c's
michael@0: * decomposition mapping, if there is one.
michael@0: * @param capacity number of UChars that can be written to decomposition
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return the non-negative length of c's decomposition, if there is one; otherwise a negative value
michael@0: * @stable ICU 4.6
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm2_getDecomposition(const UNormalizer2 *norm2,
michael@0: UChar32 c, UChar *decomposition, int32_t capacity,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Gets the raw decomposition mapping of c.
michael@0: *
michael@0: * This is similar to the unorm2_getDecomposition() function but returns the
michael@0: * raw decomposition mapping as specified in UnicodeData.txt or
michael@0: * (for custom data) in the mapping files processed by the gennorm2 tool.
michael@0: * By contrast, unorm2_getDecomposition() returns the processed,
michael@0: * recursively-decomposed version of this mapping.
michael@0: *
michael@0: * When used on a standard NFKC Normalizer2 instance,
michael@0: * unorm2_getRawDecomposition() returns the Unicode Decomposition_Mapping (dm) property.
michael@0: *
michael@0: * When used on a standard NFC Normalizer2 instance,
michael@0: * it returns the Decomposition_Mapping only if the Decomposition_Type (dt) is Canonical (Can);
michael@0: * in this case, the result contains either one or two code points (=1..4 UChars).
michael@0: *
michael@0: * This function is independent of the mode of the UNormalizer2.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param c code point
michael@0: * @param decomposition String buffer which will be set to c's
michael@0: * raw decomposition mapping, if there is one.
michael@0: * @param capacity number of UChars that can be written to decomposition
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return the non-negative length of c's raw decomposition, if there is one; otherwise a negative value
michael@0: * @stable ICU 49
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm2_getRawDecomposition(const UNormalizer2 *norm2,
michael@0: UChar32 c, UChar *decomposition, int32_t capacity,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Performs pairwise composition of a & b and returns the composite if there is one.
michael@0: *
michael@0: * Returns a composite code point c only if c has a two-way mapping to a+b.
michael@0: * In standard Unicode normalization, this means that
michael@0: * c has a canonical decomposition to a+b
michael@0: * and c does not have the Full_Composition_Exclusion property.
michael@0: *
michael@0: * This function is independent of the mode of the UNormalizer2.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param a A (normalization starter) code point.
michael@0: * @param b Another code point.
michael@0: * @return The non-negative composite code point if there is one; otherwise a negative value.
michael@0: * @stable ICU 49
michael@0: */
michael@0: U_STABLE UChar32 U_EXPORT2
michael@0: unorm2_composePair(const UNormalizer2 *norm2, UChar32 a, UChar32 b);
michael@0:
michael@0: /**
michael@0: * Gets the combining class of c.
michael@0: * The default implementation returns 0
michael@0: * but all standard implementations return the Unicode Canonical_Combining_Class value.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param c code point
michael@0: * @return c's combining class
michael@0: * @stable ICU 49
michael@0: */
michael@0: U_STABLE uint8_t U_EXPORT2
michael@0: unorm2_getCombiningClass(const UNormalizer2 *norm2, UChar32 c);
michael@0:
michael@0: /**
michael@0: * Tests if the string is normalized.
michael@0: * Internally, in cases where the quickCheck() method would return "maybe"
michael@0: * (which is only possible for the two COMPOSE modes) this method
michael@0: * resolves to "yes" or "no" to provide a definitive result,
michael@0: * at the cost of doing more work in those cases.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param s input string
michael@0: * @param length length of the string, or -1 if NUL-terminated
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return TRUE if s is normalized
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE UBool U_EXPORT2
michael@0: unorm2_isNormalized(const UNormalizer2 *norm2,
michael@0: const UChar *s, int32_t length,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Tests if the string is normalized.
michael@0: * For the two COMPOSE modes, the result could be "maybe" in cases that
michael@0: * would take a little more work to resolve definitively.
michael@0: * Use spanQuickCheckYes() and normalizeSecondAndAppend() for a faster
michael@0: * combination of quick check + normalization, to avoid
michael@0: * re-checking the "yes" prefix.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param s input string
michael@0: * @param length length of the string, or -1 if NUL-terminated
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return UNormalizationCheckResult
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE UNormalizationCheckResult U_EXPORT2
michael@0: unorm2_quickCheck(const UNormalizer2 *norm2,
michael@0: const UChar *s, int32_t length,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Returns the end of the normalized substring of the input string.
michael@0: * In other words, with end=spanQuickCheckYes(s, ec);
michael@0: * the substring UnicodeString(s, 0, end)
michael@0: * will pass the quick check with a "yes" result.
michael@0: *
michael@0: * The returned end index is usually one or more characters before the
michael@0: * "no" or "maybe" character: The end index is at a normalization boundary.
michael@0: * (See the class documentation for more about normalization boundaries.)
michael@0: *
michael@0: * When the goal is a normalized string and most input strings are expected
michael@0: * to be normalized already, then call this method,
michael@0: * and if it returns a prefix shorter than the input string,
michael@0: * copy that prefix and use normalizeSecondAndAppend() for the remainder.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param s input string
michael@0: * @param length length of the string, or -1 if NUL-terminated
michael@0: * @param pErrorCode Standard ICU error code. Its input value must
michael@0: * pass the U_SUCCESS() test, or else the function returns
michael@0: * immediately. Check for U_FAILURE() on output or use with
michael@0: * function chaining. (See User Guide for details.)
michael@0: * @return "yes" span end index
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE int32_t U_EXPORT2
michael@0: unorm2_spanQuickCheckYes(const UNormalizer2 *norm2,
michael@0: const UChar *s, int32_t length,
michael@0: UErrorCode *pErrorCode);
michael@0:
michael@0: /**
michael@0: * Tests if the character always has a normalization boundary before it,
michael@0: * regardless of context.
michael@0: * For details see the Normalizer2 base class documentation.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param c character to test
michael@0: * @return TRUE if c has a normalization boundary before it
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE UBool U_EXPORT2
michael@0: unorm2_hasBoundaryBefore(const UNormalizer2 *norm2, UChar32 c);
michael@0:
michael@0: /**
michael@0: * Tests if the character always has a normalization boundary after it,
michael@0: * regardless of context.
michael@0: * For details see the Normalizer2 base class documentation.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param c character to test
michael@0: * @return TRUE if c has a normalization boundary after it
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE UBool U_EXPORT2
michael@0: unorm2_hasBoundaryAfter(const UNormalizer2 *norm2, UChar32 c);
michael@0:
michael@0: /**
michael@0: * Tests if the character is normalization-inert.
michael@0: * For details see the Normalizer2 base class documentation.
michael@0: * @param norm2 UNormalizer2 instance
michael@0: * @param c character to test
michael@0: * @return TRUE if c is normalization-inert
michael@0: * @stable ICU 4.4
michael@0: */
michael@0: U_STABLE UBool U_EXPORT2
michael@0: unorm2_isInert(const UNormalizer2 *norm2, UChar32 c);
michael@0:
michael@0: #endif /* !UCONFIG_NO_NORMALIZATION */
michael@0: #endif /* __UNORM2_H__ */