#
# 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
# 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|\
done
fi
+echo "Looking for binary suffixes.."
+
for i in $(pax -f $tar_file 2>/dev/null)
do
case $i in
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);
}
}
+U_CDECL_BEGIN
+
static const char * U_CALLCONV
_ISO2022getName(const UConverter* cnv){
if(cnv->extraInfo){
return NULL;
}
+U_CDECL_END
+
/*************** to unicode *******************/
/****************************************************************************
};
+U_CDECL_BEGIN
+
static UConverter * U_CALLCONV
_ISO_2022_SafeClone(
const UConverter *cnv,
return &localClone->cnv;
}
+U_CDECL_END
+
static void U_CALLCONV
_ISO_2022_GetUnicodeSet(const UConverter *cnv,
const USetAdder *sa,
# 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;
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;
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;
return NULL;
}
+U_CDECL_BEGIN
+
+
static int32_t U_CALLCONV
ucnv_io_countStandardAliases(UEnumeration *enumerator, UErrorCode * /*pErrorCode*/) {
int32_t value = 0;
uprv_free(enumerator);
}
+U_CDECL_END
+
/* Enumerate the aliases for the specified converter and standard tag */
static const UEnumeration gEnumAliases = {
NULL,
return NULL;
}
+U_CDECL_BEGIN
+
+
static int32_t U_CALLCONV
ucnv_io_countAllConverters(UEnumeration * /*enumerator*/, UErrorCode * /*pErrorCode*/) {
return gMainTable.converterListSize;
ucnv_io_resetAllConverters(UEnumeration *enumerator, UErrorCode * /*pErrorCode*/) {
*((uint16_t *)(enumerator->context)) = 0;
}
-
+U_CDECL_END
static const UEnumeration gEnumAllConverters = {
NULL,
NULL,
return myEnum;
}
-U_CFUNC uint16_t
+U_CAPI uint16_t
ucnv_io_countKnownConverters(UErrorCode *pErrorCode) {
if (haveAliasData(pErrorCode)) {
return (uint16_t)gMainTable.converterListSize;
/* alias table swapping ----------------------------------------------------- */
+U_CDECL_BEGIN
+
typedef char * U_CALLCONV StripForCompareFn(char *dst, const char *name);
+U_CDECL_END
+
/*
* row of a temporary array
* @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);
/**
* @param pErrorCode The error code
* @return the number of all aliases
*/
-U_CFUNC uint16_t
+U_CAPI uint16_t
ucnv_io_countKnownConverters(UErrorCode *pErrorCode);
/**
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,
#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) {
return cnv->sharedData->staticData->name;
}
}
+U_CDECL_END
+
/* MBCS-to-Unicode conversion functions ------------------------------------- */
// 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.
char* current;
} UKeywordsContext;
+U_CDECL_BEGIN
+
static void U_CALLCONV
uloc_kw_closeKeywords(UEnumeration *enumerator) {
uprv_free(((UKeywordsContext *)enumerator->context)->keywords);
((UKeywordsContext *)en->context)->current = ((UKeywordsContext *)en->context)->keywords;
}
+U_CDECL_END
+
+
static const UEnumeration gKeywordsEnum = {
NULL,
NULL,
return ures_getSize(&ctx->installed);
}
+U_CDECL_BEGIN
+
+
static const char * U_CALLCONV
ures_loc_nextLocale(UEnumeration* en,
int32_t* resultLength,
ures_resetIterator(res);
}
+U_CDECL_END
static const UEnumeration gLocalesEnum = {
NULL,