diff --git a/icu4c/source/common/uenum.c b/icu4c/source/common/uenum.c index 0ec065a8e14..dbf1d709040 100644 --- a/icu4c/source/common/uenum.c +++ b/icu4c/source/common/uenum.c @@ -14,6 +14,7 @@ * created by: Vladimir Weinstein */ +#include "unicode/putil.h" #include "uenumimp.h" #include "cmemory.h" diff --git a/icu4c/source/common/unames.c b/icu4c/source/common/unames.c index 43b9ae05d01..1ff98ec7f79 100644 --- a/icu4c/source/common/unames.c +++ b/icu4c/source/common/unames.c @@ -15,6 +15,7 @@ */ #include "unicode/utypes.h" +#include "unicode/putil.h" #include "unicode/uchar.h" #include "unicode/udata.h" #include "ustr_imp.h" diff --git a/icu4c/source/common/unicode/putil.h b/icu4c/source/common/unicode/putil.h index 0adb59da70a..685df530ef3 100644 --- a/icu4c/source/common/unicode/putil.h +++ b/icu4c/source/common/unicode/putil.h @@ -134,4 +134,47 @@ U_INTERNAL const char* U_EXPORT2 uprv_getDefaultLocaleID(void); # define U_PATH_SEP_STRING ":" #endif +/** + * Convert char characters to UChar characters. + * This utility function is useful only for "invariant characters" + * that are encoded in the platform default encoding. + * They are a small, constant subset of the encoding and include + * just the latin letters, digits, and some punctuation. + * For details, see U_CHARSET_FAMILY. + * + * @param cs Input string, points to length + * character bytes from a subset of the platform encoding. + * @param us Output string, points to memory for length + * Unicode characters. + * @param length The number of characters to convert; this may + * include the terminating NUL. + * + * @see U_CHARSET_FAMILY + * @stable ICU 2.0 + */ +U_STABLE void U_EXPORT2 +u_charsToUChars(const char *cs, UChar *us, int32_t length); + +/** + * Convert UChar characters to char characters. + * This utility function is useful only for "invariant characters" + * that can be encoded in the platform default encoding. + * They are a small, constant subset of the encoding and include + * just the latin letters, digits, and some punctuation. + * For details, see U_CHARSET_FAMILY. + * + * @param us Input string, points to length + * Unicode characters that can be encoded with the + * codepage-invariant subset of the platform encoding. + * @param cs Output string, points to memory for length + * character bytes. + * @param length The number of characters to convert; this may + * include the terminating NUL. + * + * @see U_CHARSET_FAMILY + * @stable ICU 2.0 + */ +U_STABLE void U_EXPORT2 +u_UCharsToChars(const UChar *us, char *cs, int32_t length); + #endif diff --git a/icu4c/source/common/unicode/utypes.h b/icu4c/source/common/unicode/utypes.h index 4d778aa2df8..77513662d2e 100644 --- a/icu4c/source/common/unicode/utypes.h +++ b/icu4c/source/common/unicode/utypes.h @@ -124,49 +124,6 @@ # define U_CHARSET_FAMILY 0 #endif -/** - * Convert char characters to UChar characters. - * This utility function is useful only for "invariant characters" - * that are encoded in the platform default encoding. - * They are a small, constant subset of the encoding and include - * just the latin letters, digits, and some punctuation. - * For details, see U_CHARSET_FAMILY. - * - * @param cs Input string, points to length - * character bytes from a subset of the platform encoding. - * @param us Output string, points to memory for length - * Unicode characters. - * @param length The number of characters to convert; this may - * include the terminating NUL. - * - * @see U_CHARSET_FAMILY - * @stable ICU 2.0 - */ -U_STABLE void U_EXPORT2 -u_charsToUChars(const char *cs, UChar *us, int32_t length); - -/** - * Convert UChar characters to char characters. - * This utility function is useful only for "invariant characters" - * that can be encoded in the platform default encoding. - * They are a small, constant subset of the encoding and include - * just the latin letters, digits, and some punctuation. - * For details, see U_CHARSET_FAMILY. - * - * @param us Input string, points to length - * Unicode characters that can be encoded with the - * codepage-invariant subset of the platform encoding. - * @param cs Output string, points to memory for length - * character bytes. - * @param length The number of characters to convert; this may - * include the terminating NUL. - * - * @see U_CHARSET_FAMILY - * @stable ICU 2.0 - */ -U_STABLE void U_EXPORT2 -u_UCharsToChars(const UChar *us, char *cs, int32_t length); - /*===========================================================================*/ /* ICUDATA naming scheme */ /*===========================================================================*/ @@ -704,44 +661,44 @@ typedef enum UErrorCode { /* * The error codes in the range 0x10300-0x103ff are reserved for regular expression related errrs */ - U_REGEX_ERROR_START=0x10300, /**< Start of codes indicating Regexp failures */ - U_REGEX_INTERNAL_ERROR, /**< An internal error (bug) was detected. */ - U_REGEX_RULE_SYNTAX, /**< Syntax error in regexp pattern. */ - U_REGEX_INVALID_STATE, /**< RegexMatcher in invalid state for requested operation */ - U_REGEX_BAD_ESCAPE_SEQUENCE, /**< Unrecognized backslash escape sequence in pattern */ - U_REGEX_PROPERTY_SYNTAX, /**< Incorrect Unicode property */ - U_REGEX_UNIMPLEMENTED, /**< Use of regexp feature that is not yet implemented. */ - U_REGEX_MISMATCHED_PAREN, /**< Incorrectly nested parentheses in regexp pattern. */ - U_REGEX_NUMBER_TOO_BIG, /**< Decimal number is too large. */ - U_REGEX_BAD_INTERVAL, /**< Error in {min,max} interval */ - U_REGEX_MAX_LT_MIN, /**< In {min,max}, max is less than min. */ - U_REGEX_INVALID_BACK_REF, /**< Back-reference to a non-existent capture group. */ - U_REGEX_INVALID_FLAG, /**< Invalid value for match mode flags. */ - U_REGEX_LOOK_BEHIND_LIMIT, /**< Look-Behind pattern matches must have a bounded maximum length. */ - U_REGEX_SET_CONTAINS_STRING, /**< Regexps cannot have UnicodeSets containing strings.*/ - U_REGEX_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for regexp errors */ + U_REGEX_ERROR_START=0x10300, /**< Start of codes indicating Regexp failures */ + U_REGEX_INTERNAL_ERROR, /**< An internal error (bug) was detected. */ + U_REGEX_RULE_SYNTAX, /**< Syntax error in regexp pattern. */ + U_REGEX_INVALID_STATE, /**< RegexMatcher in invalid state for requested operation */ + U_REGEX_BAD_ESCAPE_SEQUENCE, /**< Unrecognized backslash escape sequence in pattern */ + U_REGEX_PROPERTY_SYNTAX, /**< Incorrect Unicode property */ + U_REGEX_UNIMPLEMENTED, /**< Use of regexp feature that is not yet implemented. */ + U_REGEX_MISMATCHED_PAREN, /**< Incorrectly nested parentheses in regexp pattern. */ + U_REGEX_NUMBER_TOO_BIG, /**< Decimal number is too large. */ + U_REGEX_BAD_INTERVAL, /**< Error in {min,max} interval */ + U_REGEX_MAX_LT_MIN, /**< In {min,max}, max is less than min. */ + U_REGEX_INVALID_BACK_REF, /**< Back-reference to a non-existent capture group. */ + U_REGEX_INVALID_FLAG, /**< Invalid value for match mode flags. */ + U_REGEX_LOOK_BEHIND_LIMIT, /**< Look-Behind pattern matches must have a bounded maximum length. */ + U_REGEX_SET_CONTAINS_STRING, /**< Regexps cannot have UnicodeSets containing strings.*/ + U_REGEX_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for regexp errors */ - /* - * The error code in the range 0x10400-0x104ff are reserved for IDNA related error codes - */ - U_IDNA_ERROR_START=0x10400, - U_IDNA_PROHIBITED_ERROR, - U_IDNA_UNASSIGNED_ERROR, - U_IDNA_CHECK_BIDI_ERROR, - U_IDNA_STD3_ASCII_RULES_ERROR, - U_IDNA_ACE_PREFIX_ERROR, - U_IDNA_VERIFICATION_ERROR, - U_IDNA_LABEL_TOO_LONG_ERROR, - U_IDNA_ERROR_LIMIT, - /* - * Aliases for StringPrep - */ - U_STRINGPREP_PROHIBITED_ERROR = U_IDNA_PROHIBITED_ERROR, - U_STRINGPREP_UNASSIGNED_ERROR = U_IDNA_UNASSIGNED_ERROR, - U_STRINGPREP_CHECK_BIDI_ERROR = U_IDNA_CHECK_BIDI_ERROR, + /* + * The error code in the range 0x10400-0x104ff are reserved for IDNA related error codes + */ + U_IDNA_ERROR_START=0x10400, + U_IDNA_PROHIBITED_ERROR, + U_IDNA_UNASSIGNED_ERROR, + U_IDNA_CHECK_BIDI_ERROR, + U_IDNA_STD3_ASCII_RULES_ERROR, + U_IDNA_ACE_PREFIX_ERROR, + U_IDNA_VERIFICATION_ERROR, + U_IDNA_LABEL_TOO_LONG_ERROR, + U_IDNA_ERROR_LIMIT, + /* + * Aliases for StringPrep + */ + U_STRINGPREP_PROHIBITED_ERROR = U_IDNA_PROHIBITED_ERROR, + U_STRINGPREP_UNASSIGNED_ERROR = U_IDNA_UNASSIGNED_ERROR, + U_STRINGPREP_CHECK_BIDI_ERROR = U_IDNA_CHECK_BIDI_ERROR, - U_ERROR_LIMIT=U_IDNA_ERROR_LIMIT /**< This must always be the last value to indicate the limit for UErrorCode (last error code +1) */ + U_ERROR_LIMIT=U_IDNA_ERROR_LIMIT /**< This must always be the last value to indicate the limit for UErrorCode (last error code +1) */ } UErrorCode; /* Use the following to determine if an UErrorCode represents */ diff --git a/icu4c/source/common/ures_cnv.c b/icu4c/source/common/ures_cnv.c index e7c5606f6b6..9326ef127be 100644 --- a/icu4c/source/common/ures_cnv.c +++ b/icu4c/source/common/ures_cnv.c @@ -17,6 +17,7 @@ */ #include "unicode/utypes.h" +#include "unicode/putil.h" #include "unicode/ustring.h" #include "unicode/ucnv.h" #include "unicode/ures.h" diff --git a/icu4c/source/common/uscript.c b/icu4c/source/common/uscript.c index 61ea2cd223f..797d15155c7 100644 --- a/icu4c/source/common/uscript.c +++ b/icu4c/source/common/uscript.c @@ -16,6 +16,7 @@ #include "unicode/uscript.h" #include "unicode/ures.h" #include "unicode/uchar.h" +#include "unicode/putil.h" #include "uprops.h" #include "cmemory.h" #include "cstring.h" diff --git a/icu4c/source/common/ustrenum.cpp b/icu4c/source/common/ustrenum.cpp index 3ddf3476849..dfc1ba1fc11 100644 --- a/icu4c/source/common/ustrenum.cpp +++ b/icu4c/source/common/ustrenum.cpp @@ -10,6 +10,7 @@ */ #include "unicode/ustring.h" #include "unicode/strenum.h" +#include "unicode/putil.h" #include "uenumimp.h" #include "ustrenum.h" #include "cstring.h" diff --git a/icu4c/source/common/ustring.c b/icu4c/source/common/ustring.c index 9d1a60ead99..8c49959c8c1 100644 --- a/icu4c/source/common/ustring.c +++ b/icu4c/source/common/ustring.c @@ -16,6 +16,7 @@ */ #include "unicode/utypes.h" +#include "unicode/putil.h" #include "unicode/ustring.h" #include "cstring.h" #include "cwchar.h" diff --git a/icu4c/source/extra/uconv/uwmsg.c b/icu4c/source/extra/uconv/uwmsg.c index e1c065c9e24..61e6c463719 100644 --- a/icu4c/source/extra/uconv/uwmsg.c +++ b/icu4c/source/extra/uconv/uwmsg.c @@ -18,6 +18,7 @@ #include "unicode/umsg.h" #include "unicode/uwmsg.h" #include "unicode/ures.h" +#include "unicode/putil.h" #include "cstring.h" #include diff --git a/icu4c/source/io/sprintf.c b/icu4c/source/io/sprintf.c index 87b533275dd..0d90b561bef 100644 --- a/icu4c/source/io/sprintf.c +++ b/icu4c/source/io/sprintf.c @@ -24,6 +24,7 @@ #include "unicode/ustdio.h" #include "unicode/ustring.h" +#include "unicode/putil.h" #include "uprintf.h" #include "locbund.h" diff --git a/icu4c/source/io/sscanf.c b/icu4c/source/io/sscanf.c index a8d564ddf38..eb0bedfb84e 100644 --- a/icu4c/source/io/sscanf.c +++ b/icu4c/source/io/sscanf.c @@ -19,6 +19,7 @@ #if !UCONFIG_NO_FORMATTING +#include "unicode/putil.h" #include "unicode/ustdio.h" #include "unicode/ustring.h" #include "uscanf.h" diff --git a/icu4c/source/io/uprintf.c b/icu4c/source/io/uprintf.c index 2f1a376b9d6..d95c02c671c 100644 --- a/icu4c/source/io/uprintf.c +++ b/icu4c/source/io/uprintf.c @@ -26,6 +26,7 @@ #include "unicode/ustring.h" #include "unicode/unum.h" #include "unicode/udat.h" +#include "unicode/putil.h" #include "uprintf.h" #include "ufile.h" diff --git a/icu4c/source/io/uscanf.c b/icu4c/source/io/uscanf.c index b6befe3eef8..5743f651991 100644 --- a/icu4c/source/io/uscanf.c +++ b/icu4c/source/io/uscanf.c @@ -20,6 +20,7 @@ #if !UCONFIG_NO_FORMATTING +#include "unicode/putil.h" #include "unicode/ustdio.h" #include "unicode/ustring.h" #include "uscanf.h" diff --git a/icu4c/source/test/cintltst/cintltst.h b/icu4c/source/test/cintltst/cintltst.h index 6f265e193ca..199496e0d3c 100644 --- a/icu4c/source/test/cintltst/cintltst.h +++ b/icu4c/source/test/cintltst/cintltst.h @@ -20,6 +20,7 @@ The main root for C API tests #define _CINTLTST #include "unicode/utypes.h" +#include "unicode/putil.h" #include "unicode/ctest.h" #ifndef U_USE_DEPRECATED_API diff --git a/icu4c/source/test/intltest/testidna.cpp b/icu4c/source/test/intltest/testidna.cpp index 626cfbe2b0b..6c9498538d6 100644 --- a/icu4c/source/test/intltest/testidna.cpp +++ b/icu4c/source/test/intltest/testidna.cpp @@ -28,6 +28,7 @@ #include "testidna.h" #include "idnaref.h" #include "nptrans.h" +#include "unicode/putil.h" static UChar unicodeIn[][41] ={ { diff --git a/icu4c/source/tools/genrb/ustr.c b/icu4c/source/tools/genrb/ustr.c index ff1344f3e8a..da0e40e7667 100644 --- a/icu4c/source/tools/genrb/ustr.c +++ b/icu4c/source/tools/genrb/ustr.c @@ -19,6 +19,7 @@ #include "cmemory.h" #include "cstring.h" #include "unicode/ustring.h" +#include "unicode/putil.h" /* Protos */ static void ustr_resize(struct UString *s, int32_t len, UErrorCode *status);