X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/4388f060552cc537e71e957d32f35e9d75a61233..2ca993e82fb37b597a3c73ecd1586a139a6579c5:/icuSources/common/unicode/uidna.h diff --git a/icuSources/common/unicode/uidna.h b/icuSources/common/unicode/uidna.h index 9554eeab..decece1f 100644 --- a/icuSources/common/unicode/uidna.h +++ b/icuSources/common/unicode/uidna.h @@ -1,7 +1,7 @@ /* ******************************************************************************* * - * Copyright (C) 2003-2012, International Business Machines + * Copyright (C) 2003-2014, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -32,8 +32,10 @@ * * The C API functions which do take a UIDNA * service object pointer * implement UTS #46 and IDNA2008. + * + * IDNA2003 is obsolete. * The C API functions which do not take a service object pointer - * implement IDNA2003. + * implement IDNA2003. They are all deprecated. */ /* @@ -46,14 +48,16 @@ enum { * @stable ICU 2.6 */ UIDNA_DEFAULT=0, +#ifndef U_HIDE_DEPRECATED_API /** * Option to allow unassigned code points in domain names and labels. * For use in static worker and factory methods. *
This option is ignored by the UTS46 implementation. * (UTS #46 disallows unassigned code points.) - * @stable ICU 2.6 + * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA. */ UIDNA_ALLOW_UNASSIGNED=1, +#endif /* U_HIDE_DEPRECATED_API */ /** * Option to check whether the input conforms to the STD3 ASCII rules, * for example the restriction of labels to LDH characters @@ -96,7 +100,6 @@ enum { * @stable ICU 4.6 */ UIDNA_NONTRANSITIONAL_TO_UNICODE=0x20, -#ifndef U_HIDE_DRAFT_API /** * IDNA option to check for whether the input conforms to the CONTEXTO rules. * For use in static worker and factory methods. @@ -104,10 +107,9 @@ enum { * (The CONTEXTO check is new in IDNA2008.) *
This is for use by registries for IDNA2008 conformance. * UTS #46 does not require the CONTEXTO check. - * @draft ICU 49 + * @stable ICU 49 */ UIDNA_CHECK_CONTEXTO=0x40 -#endif /* U_HIDE_DRAFT_API */ }; /** @@ -134,7 +136,7 @@ typedef struct UIDNA UIDNA; /**< C typedef for struct UIDNA. @stable ICU 4.6 */ * @return the UTS #46 UIDNA instance, if successful * @stable ICU 4.6 */ -U_DRAFT UIDNA * U_EXPORT2 +U_STABLE UIDNA * U_EXPORT2 uidna_openUTS46(uint32_t options, UErrorCode *pErrorCode); /** @@ -142,7 +144,7 @@ uidna_openUTS46(uint32_t options, UErrorCode *pErrorCode); * @param idna UIDNA instance to be closed * @stable ICU 4.6 */ -U_DRAFT void U_EXPORT2 +U_STABLE void U_EXPORT2 uidna_close(UIDNA *idna); #if U_SHOW_CPLUSPLUS_API @@ -174,7 +176,7 @@ U_NAMESPACE_END * \endcode * @stable ICU 4.6 */ -struct UIDNAInfo { +typedef struct UIDNAInfo { /** sizeof(UIDNAInfo) @stable ICU 4.6 */ int16_t size; /** @@ -192,8 +194,7 @@ struct UIDNAInfo { uint32_t errors; int32_t reservedI2; /**< Reserved field, do not use. @internal */ int32_t reservedI3; /**< Reserved field, do not use. @internal */ -}; -typedef struct UIDNAInfo UIDNAInfo; +} UIDNAInfo; /** * Static initializer for a UIDNAInfo struct. @@ -227,7 +228,7 @@ typedef struct UIDNAInfo UIDNAInfo; * @return destination string length * @stable ICU 4.6 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uidna_labelToASCII(const UIDNA *idna, const UChar *label, int32_t length, UChar *dest, int32_t capacity, @@ -254,7 +255,7 @@ uidna_labelToASCII(const UIDNA *idna, * @return destination string length * @stable ICU 4.6 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uidna_labelToUnicode(const UIDNA *idna, const UChar *label, int32_t length, UChar *dest, int32_t capacity, @@ -283,7 +284,7 @@ uidna_labelToUnicode(const UIDNA *idna, * @return destination string length * @stable ICU 4.6 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uidna_nameToASCII(const UIDNA *idna, const UChar *name, int32_t length, UChar *dest, int32_t capacity, @@ -310,7 +311,7 @@ uidna_nameToASCII(const UIDNA *idna, * @return destination string length * @stable ICU 4.6 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uidna_nameToUnicode(const UIDNA *idna, const UChar *name, int32_t length, UChar *dest, int32_t capacity, @@ -335,7 +336,7 @@ uidna_nameToUnicode(const UIDNA *idna, * @return destination string length * @stable ICU 4.6 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uidna_labelToASCII_UTF8(const UIDNA *idna, const char *label, int32_t length, char *dest, int32_t capacity, @@ -358,7 +359,7 @@ uidna_labelToASCII_UTF8(const UIDNA *idna, * @return destination string length * @stable ICU 4.6 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uidna_labelToUnicodeUTF8(const UIDNA *idna, const char *label, int32_t length, char *dest, int32_t capacity, @@ -381,7 +382,7 @@ uidna_labelToUnicodeUTF8(const UIDNA *idna, * @return destination string length * @stable ICU 4.6 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uidna_nameToASCII_UTF8(const UIDNA *idna, const char *name, int32_t length, char *dest, int32_t capacity, @@ -404,7 +405,7 @@ uidna_nameToASCII_UTF8(const UIDNA *idna, * @return destination string length * @stable ICU 4.6 */ -U_DRAFT int32_t U_EXPORT2 +U_STABLE int32_t U_EXPORT2 uidna_nameToUnicodeUTF8(const UIDNA *idna, const char *name, int32_t length, char *dest, int32_t capacity, @@ -491,23 +492,23 @@ enum { * @stable ICU 4.6 */ UIDNA_ERROR_CONTEXTJ=0x1000, -#ifndef U_HIDE_DRAFT_API /** * A label does not meet the IDNA CONTEXTO requirements for punctuation characters. * Some punctuation characters "Would otherwise have been DISALLOWED" * but are allowed in certain contexts. (RFC 5892) - * @draft ICU 49 + * @stable ICU 49 */ UIDNA_ERROR_CONTEXTO_PUNCTUATION=0x2000, /** * A label does not meet the IDNA CONTEXTO requirements for digits. * Arabic-Indic Digits (U+066x) must not be mixed with Extended Arabic-Indic Digits (U+06Fx). - * @draft ICU 49 + * @stable ICU 49 */ UIDNA_ERROR_CONTEXTO_DIGITS=0x4000 -#endif /* U_HIDE_DRAFT_API */ }; +#ifndef U_HIDE_DEPRECATED_API + /* IDNA2003 API ------------------------------------------------------------- */ /** @@ -567,9 +568,9 @@ enum { * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough * @return The length of the result string, if successful - or in case of a buffer overflow, * in which case it will be greater than destCapacity. - * @stable ICU 2.6 + * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA. */ -U_STABLE int32_t U_EXPORT2 +U_DEPRECATED int32_t U_EXPORT2 uidna_toASCII(const UChar* src, int32_t srcLength, UChar* dest, int32_t destCapacity, int32_t options, @@ -615,9 +616,9 @@ uidna_toASCII(const UChar* src, int32_t srcLength, * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough * @return The length of the result string, if successful - or in case of a buffer overflow, * in which case it will be greater than destCapacity. - * @stable ICU 2.6 + * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA. */ -U_STABLE int32_t U_EXPORT2 +U_DEPRECATED int32_t U_EXPORT2 uidna_toUnicode(const UChar* src, int32_t srcLength, UChar* dest, int32_t destCapacity, int32_t options, @@ -666,9 +667,9 @@ uidna_toUnicode(const UChar* src, int32_t srcLength, * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough * @return The length of the result string, if successful - or in case of a buffer overflow, * in which case it will be greater than destCapacity. - * @stable ICU 2.6 + * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA. */ -U_STABLE int32_t U_EXPORT2 +U_DEPRECATED int32_t U_EXPORT2 uidna_IDNToASCII( const UChar* src, int32_t srcLength, UChar* dest, int32_t destCapacity, int32_t options, @@ -713,9 +714,9 @@ uidna_IDNToASCII( const UChar* src, int32_t srcLength, * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough * @return The length of the result string, if successful - or in case of a buffer overflow, * in which case it will be greater than destCapacity. - * @stable ICU 2.6 + * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA. */ -U_STABLE int32_t U_EXPORT2 +U_DEPRECATED int32_t U_EXPORT2 uidna_IDNToUnicode( const UChar* src, int32_t srcLength, UChar* dest, int32_t destCapacity, int32_t options, @@ -754,14 +755,16 @@ uidna_IDNToUnicode( const UChar* src, int32_t srcLength, * @param status ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return <0 or 0 or >0 as usual for string comparisons - * @stable ICU 2.6 + * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA. */ -U_STABLE int32_t U_EXPORT2 +U_DEPRECATED int32_t U_EXPORT2 uidna_compare( const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, int32_t options, UErrorCode* status); +#endif /* U_HIDE_DEPRECATED_API */ + #endif /* #if !UCONFIG_NO_IDNA */ #endif