]> granicus.if.org Git - icu/commitdiff
ICU-12752 merge from branch; z porting changes
authorSteven R. Loomis <srl@icu-project.org>
Wed, 28 Sep 2016 17:30:09 +0000 (17:30 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Wed, 28 Sep 2016 17:30:09 +0000 (17:30 +0000)
X-SVN-Rev: 39385

icu4c/as_is/os390/unpax-icu.sh
icu4c/source/common/ucnv2022.cpp
icu4c/source/common/ucnv_io.cpp
icu4c/source/common/ucnv_io.h
icu4c/source/common/ucnvmbcs.cpp
icu4c/source/common/ucurr.cpp
icu4c/source/common/uloc.cpp
icu4c/source/common/uresbund.cpp

index 3571dba52d37969d34579e857a0f562975f3b346..3400793705be0351badf0df494ae674ce9b38a7c 100755 (executable)
 #
 # Set the following variable to the list of binary file suffixes (extensions)
 
-#binary_suffixes='ico ICO bmp BMP jpg JPG gif GIF brk BRK'
 #ICU specific binary files
-binary_suffixes='brk BRK bin BIN res RES cnv CNV dat DAT icu ICU spp SPP xml XML nrm NRM'
+#****************************************************************************
+binary_suffixes='brk BRK bin BIN res RES cnv CNV dat DAT icu ICU spp SPP xml XML nrm NRM utf16be UTF16BE'
+data_files='icu/source/data/brkitr/* icu/source/data/locales/* icu/source/data/coll/* icu/source/data/rbnf/* icu/source/data/mappings/* icu/source/data/misc/* icu/source/data/translit/* icu/source/data/unidata/* icu/source/test/testdata/*'
 
+#****************************************************************************
+# Function:     usage
+# Description:  Prints out text that describes how to call this script
+# Input:        None
+# Output:       None
+#****************************************************************************
 usage()
 {
     echo "Enter archive filename as a parameter: $0 icu-archive.tar"
 }
+
+#****************************************************************************
 # first make sure we at least one arg and it's a file we can read
+#****************************************************************************
+
+# check for no arguments
 if [ $# -eq 0 ]; then
     usage
     exit
@@ -41,14 +53,25 @@ echo ""
 # extract files while converting them to EBCDIC
 pax -rvf $tar_file -o to=IBM-1047,from=ISO8859-1 -o setfiletag
 
+#****************************************************************************
+# For files we have restored as CCSID 37, check the BOM to see if they    
+# should be processed as 819.  Also handle files with special paths. Files
+# that match will be added to binary files lists.  The lists will in turn
+# be processed to restore files as 819.
+#****************************************************************************
 echo ""
-echo "Determining binary files ..."
+echo "Determining binary files by BOM ..."
 echo ""
 
 # When building in ASCII mode, text files are converted as ASCII
 if [ "${ICU_ENABLE_ASCII_STRINGS}" -eq 1 ]; then
     binary_suffixes="$binary_suffixes txt TXT ucm UCM"
+elif [ -f icu/as_is/bomlist.txt ];
+then
+    echo 'Using icu/as_is/bomlist.txt'
+    binary_files=$(cat icu/as_is/bomlist.txt)
 else
+    echo "Analyzing files .."
        for file in `find ./icu \( -name \*.txt -print \) | sed -e 's/^\.\///'`; do
                bom8=`head -c 3 $file|\
                        od -t x1|\
@@ -64,6 +87,8 @@ else
        done
 fi
 
+echo "Looking for binary suffixes.."
+
 for i in $(pax -f $tar_file 2>/dev/null)
 do
        case $i in
index 195c56b18bea5535abddc91516a72250f702be69..9c0a06426bda5483483b7ecfb93061f82768b24e 100644 (file)
@@ -394,15 +394,20 @@ static void U_CALLCONV
 static void U_CALLCONV
 _ISO2022Reset(UConverter *converter, UConverterResetChoice choice);
 
+U_CDECL_BEGIN
 static const char * U_CALLCONV
 _ISO2022getName(const UConverter* cnv);
+U_CDECL_END
 
 static void  U_CALLCONV
 _ISO_2022_WriteSub(UConverterFromUnicodeArgs *args, int32_t offsetIndex, UErrorCode *err);
 
+U_CDECL_BEGIN
 static UConverter * U_CALLCONV
 _ISO_2022_SafeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status);
 
+U_CDECL_END
+
 #ifdef U_ENABLE_GENERIC_ISO_2022
 static void U_CALLCONV
 T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC(UConverterToUnicodeArgs* args, UErrorCode* err);
@@ -716,6 +721,8 @@ _ISO2022Reset(UConverter *converter, UConverterResetChoice choice) {
     }
 }
 
+U_CDECL_BEGIN
+
 static const char * U_CALLCONV
 _ISO2022getName(const UConverter* cnv){
     if(cnv->extraInfo){
@@ -725,6 +732,8 @@ _ISO2022getName(const UConverter* cnv){
     return NULL;
 }
 
+U_CDECL_END
+
 
 /*************** to unicode *******************/
 /****************************************************************************
@@ -3580,6 +3589,8 @@ struct cloneStruct
 };
 
 
+U_CDECL_BEGIN
+
 static UConverter * U_CALLCONV
 _ISO_2022_SafeClone(
             const UConverter *cnv,
@@ -3627,6 +3638,8 @@ _ISO_2022_SafeClone(
     return &localClone->cnv;
 }
 
+U_CDECL_END
+
 static void U_CALLCONV
 _ISO_2022_GetUnicodeSet(const UConverter *cnv,
                     const USetAdder *sa,
index d656a65066dfe426cdc89398cad781b0626d68a9..c3301e11af6edbc86b48b73e551796ec7b1654c3 100644 (file)
@@ -381,8 +381,9 @@ static const uint8_t ebcdicTypes[128] = {
 #   error U_CHARSET_FAMILY is not valid
 #endif
 
+
 /* @see ucnv_compareNames */
-U_CAPI char * U_EXPORT2
+U_CAPI char * U_CALLCONV
 ucnv_io_stripASCIIForCompare(char *dst, const char *name) {
     char *dstItr = dst;
     uint8_t type, nextType;
@@ -417,7 +418,7 @@ ucnv_io_stripASCIIForCompare(char *dst, const char *name) {
     return dst;
 }
 
-U_CAPI char * U_EXPORT2
+U_CAPI char * U_CALLCONV
 ucnv_io_stripEBCDICForCompare(char *dst, const char *name) {
     char *dstItr = dst;
     uint8_t type, nextType;
@@ -733,9 +734,7 @@ findTaggedConverterNum(const char *alias, const char *standard, UErrorCode *pErr
     return UINT32_MAX;
 }
 
-
-
-U_CFUNC const char *
+U_CAPI const char *
 ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *pErrorCode) {
     const char *aliasTmp = alias;
     int32_t i = 0;
@@ -766,6 +765,9 @@ ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *p
     return NULL;
 }
 
+U_CDECL_BEGIN
+
+
 static int32_t U_CALLCONV
 ucnv_io_countStandardAliases(UEnumeration *enumerator, UErrorCode * /*pErrorCode*/) {
     int32_t value = 0;
@@ -816,6 +818,8 @@ ucnv_io_closeUEnumeration(UEnumeration *enumerator) {
     uprv_free(enumerator);
 }
 
+U_CDECL_END
+
 /* Enumerate the aliases for the specified converter and standard tag */
 static const UEnumeration gEnumAliases = {
     NULL,
@@ -1012,6 +1016,9 @@ ucnv_getCanonicalName(const char *alias, const char *standard, UErrorCode *pErro
     return NULL;
 }
 
+U_CDECL_BEGIN
+
+
 static int32_t U_CALLCONV
 ucnv_io_countAllConverters(UEnumeration * /*enumerator*/, UErrorCode * /*pErrorCode*/) {
     return gMainTable.converterListSize;
@@ -1042,7 +1049,7 @@ static void U_CALLCONV
 ucnv_io_resetAllConverters(UEnumeration *enumerator, UErrorCode * /*pErrorCode*/) {
     *((uint16_t *)(enumerator->context)) = 0;
 }
-
+U_CDECL_END
 static const UEnumeration gEnumAllConverters = {
     NULL,
     NULL,
@@ -1077,7 +1084,7 @@ ucnv_openAllNames(UErrorCode *pErrorCode) {
     return myEnum;
 }
 
-U_CFUNC uint16_t
+U_CAPI uint16_t
 ucnv_io_countKnownConverters(UErrorCode *pErrorCode) {
     if (haveAliasData(pErrorCode)) {
         return (uint16_t)gMainTable.converterListSize;
@@ -1087,7 +1094,11 @@ ucnv_io_countKnownConverters(UErrorCode *pErrorCode) {
 
 /* alias table swapping ----------------------------------------------------- */
 
+U_CDECL_BEGIN
+
 typedef char * U_CALLCONV StripForCompareFn(char *dst, const char *name);
+U_CDECL_END
+
 
 /*
  * row of a temporary array
index c88247cab52e91d65707368bc21d28ec2a9338a7..8b3585786d32380c60609d927d949fbba27f4e40 100644 (file)
@@ -93,7 +93,7 @@ ucnv_io_stripEBCDICForCompare(char *dst, const char *name);
  * @param pErrorCode The error code
  * @return the converter name in mixed-case, return NULL if the alias is not found.
  */
-U_CFUNC const char *
+U_CAPI const char *
 ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *pErrorCode);
 
 /**
@@ -101,7 +101,7 @@ ucnv_io_getConverterName(const char *alias, UBool *containsOption, UErrorCode *p
  * @param pErrorCode The error code
  * @return the number of all aliases
  */
-U_CFUNC uint16_t
+U_CAPI uint16_t
 ucnv_io_countKnownConverters(UErrorCode *pErrorCode);
 
 /**
index d4fa574b56dc71f26cf8c979a5ce504a94053838..ffbb9af7c467da79e0a10839f650b6b61efec28b 100644 (file)
@@ -400,8 +400,10 @@ ucnv_MBCSGetStarters(const UConverter* cnv,
                  UBool starters[256],
                  UErrorCode *pErrorCode);
 
+U_CDECL_BEGIN
 static const char* U_CALLCONV
 ucnv_MBCSGetName(const UConverter *cnv);
+U_CDECL_END
 
 static void U_CALLCONV
 ucnv_MBCSWriteSub(UConverterFromUnicodeArgs *pArgs,
@@ -1982,6 +1984,8 @@ ucnv_MBCSOpen(UConverter *cnv,
 #endif
 }
 
+U_CDECL_BEGIN
+
 static const char* U_CALLCONV
 ucnv_MBCSGetName(const UConverter *cnv) {
     if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0 && cnv->sharedData->mbcs.swapLFNLName!=NULL) {
@@ -1990,6 +1994,8 @@ ucnv_MBCSGetName(const UConverter *cnv) {
         return cnv->sharedData->staticData->name;
     }
 }
+U_CDECL_END
+
 
 /* MBCS-to-Unicode conversion functions ------------------------------------- */
 
index c17a26106f468daba90f6cf225a44b6f267b2eb6..db381733e6664cb745a50f4c26b63b036c023937 100644 (file)
@@ -119,7 +119,7 @@ U_NAMESPACE_BEGIN
 
 // EquivIterator iterates over all strings that are equivalent to a given
 // string, s. Note that EquivIterator will never yield s itself.
-class EquivIterator : icu::UMemory {
+class EquivIterator : public icu::UMemory {
 public:
     // Constructor. hash stores the equivalence relationships; s is the string
     // for which we find equivalent strings.
index ec4a30a6229630423473d06ce859970e5589750b..2a02b27c5ba1f768cd5c2f87f0abcb0e7c620d89 100644 (file)
@@ -1474,6 +1474,8 @@ typedef struct UKeywordsContext {
     char* current;
 } UKeywordsContext;
 
+U_CDECL_BEGIN
+
 static void U_CALLCONV
 uloc_kw_closeKeywords(UEnumeration *enumerator) {
     uprv_free(((UKeywordsContext *)enumerator->context)->keywords);
@@ -1516,6 +1518,9 @@ uloc_kw_resetKeywords(UEnumeration* en,
     ((UKeywordsContext *)en->context)->current = ((UKeywordsContext *)en->context)->keywords;
 }
 
+U_CDECL_END
+
+
 static const UEnumeration gKeywordsEnum = {
     NULL,
     NULL,
index b4393ef4cffea66f3369c4aef25e8d1fab84d6d1..a32bfd132fea4d04e0cb4ee98910b18dd895625d 100644 (file)
@@ -2408,6 +2408,9 @@ ures_loc_countLocales(UEnumeration *en, UErrorCode * /*status*/) {
     return ures_getSize(&ctx->installed);
 }
 
+U_CDECL_BEGIN
+
+
 static const char * U_CALLCONV
 ures_loc_nextLocale(UEnumeration* en,
                     int32_t* resultLength,
@@ -2434,6 +2437,7 @@ ures_loc_resetLocales(UEnumeration* en,
     ures_resetIterator(res);
 }
 
+U_CDECL_END
 
 static const UEnumeration gLocalesEnum = {
     NULL,