michael@0: diff --git a/intl/icu/source/tools/genrb/genrb.c b/intl/icu/source/tools/genrb/genrb.c michael@0: --- a/intl/icu/source/tools/genrb/genrb.c michael@0: +++ b/intl/icu/source/tools/genrb/genrb.c michael@0: @@ -1,7 +1,7 @@ michael@0: /* michael@0: ******************************************************************************* michael@0: * michael@0: -* Copyright (C) 1998-2012, International Business Machines michael@0: +* Copyright (C) 1998-2014, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: * michael@0: ******************************************************************************* michael@0: @@ -280,7 +280,7 @@ michael@0: } michael@0: } michael@0: michael@0: - initParser(options[NO_COLLATION_RULES].doesOccur); michael@0: + initParser(); michael@0: michael@0: /*added by Jing*/ michael@0: if(options[LANGUAGE].doesOccur) { michael@0: @@ -557,7 +557,8 @@ michael@0: printf("autodetected encoding %s\n", cp); michael@0: } michael@0: /* Parse the data into an SRBRoot */ michael@0: - data = parse(ucbuf, inputDir, outputDir, !omitBinaryCollation, status); michael@0: + data = parse(ucbuf, inputDir, outputDir, michael@0: + !omitBinaryCollation, options[NO_COLLATION_RULES].doesOccur, status); michael@0: michael@0: if (data == NULL || U_FAILURE(*status)) { michael@0: fprintf(stderr, "couldn't parse the file %s. Error:%s\n", filename,u_errorName(*status)); michael@0: diff --git a/intl/icu/source/tools/genrb/parse.cpp b/intl/icu/source/tools/genrb/parse.cpp michael@0: --- a/intl/icu/source/tools/genrb/parse.cpp michael@0: +++ b/intl/icu/source/tools/genrb/parse.cpp michael@0: @@ -85,10 +85,9 @@ michael@0: const char *outputdir; michael@0: uint32_t outputdirLength; michael@0: UBool makeBinaryCollation; michael@0: + UBool omitCollationRules; michael@0: } ParseState; michael@0: michael@0: -static UBool gOmitCollationRules = FALSE; michael@0: - michael@0: typedef struct SResource * michael@0: ParseResourceFunction(ParseState* state, char *tag, uint32_t startline, const struct UString* comment, UErrorCode *status); michael@0: michael@0: @@ -323,7 +322,7 @@ michael@0: } michael@0: uprv_strcat(filename, cs); michael@0: michael@0: - if(gOmitCollationRules) { michael@0: + if(state->omitCollationRules) { michael@0: return res_none(); michael@0: } michael@0: michael@0: @@ -771,7 +770,7 @@ michael@0: } michael@0: michael@0: /* Parse the data into an SRBRoot */ michael@0: - data = parse(ucbuf, genrbdata->inputDir, genrbdata->outputDir, FALSE, status); michael@0: + data = parse(ucbuf, genrbdata->inputDir, genrbdata->outputDir, FALSE, FALSE, status); michael@0: michael@0: root = data->fRoot; michael@0: collations = resLookup(root, "collations"); michael@0: @@ -1007,7 +1006,7 @@ michael@0: #endif michael@0: /* in order to achieve smaller data files, we can direct genrb */ michael@0: /* to omit collation rules */ michael@0: - if(gOmitCollationRules) { michael@0: + if(state->omitCollationRules) { michael@0: bundle_closeString(state->bundle, member); michael@0: } else { michael@0: table_add(result, member, line, status); michael@0: @@ -1839,7 +1838,7 @@ michael@0: {"reserved", NULL, NULL} michael@0: }; michael@0: michael@0: -void initParser(UBool omitCollationRules) michael@0: +void initParser() michael@0: { michael@0: U_STRING_INIT(k_type_string, "string", 6); michael@0: U_STRING_INIT(k_type_binary, "binary", 6); michael@0: @@ -1858,8 +1857,6 @@ michael@0: U_STRING_INIT(k_type_plugin_collation, "process(collation)", 18); michael@0: U_STRING_INIT(k_type_plugin_transliterator, "process(transliterator)", 23); michael@0: U_STRING_INIT(k_type_plugin_dependency, "process(dependency)", 19); michael@0: - michael@0: - gOmitCollationRules = omitCollationRules; michael@0: } michael@0: michael@0: static inline UBool isTable(enum EResourceType type) { michael@0: @@ -2039,8 +2036,8 @@ michael@0: michael@0: /* parse the top-level resource */ michael@0: struct SRBRoot * michael@0: -parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, UBool makeBinaryCollation, michael@0: - UErrorCode *status) michael@0: +parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, michael@0: + UBool makeBinaryCollation, UBool omitCollationRules, UErrorCode *status) michael@0: { michael@0: struct UString *tokenValue; michael@0: struct UString comment; michael@0: @@ -2064,6 +2061,7 @@ michael@0: state.outputdir = outputDir; michael@0: state.outputdirLength = (state.outputdir != NULL) ? (uint32_t)uprv_strlen(state.outputdir) : 0; michael@0: state.makeBinaryCollation = makeBinaryCollation; michael@0: + state.omitCollationRules = omitCollationRules; michael@0: michael@0: ustr_init(&comment); michael@0: expect(&state, TOK_STRING, &tokenValue, &comment, NULL, status); michael@0: diff --git a/intl/icu/source/tools/genrb/parse.h b/intl/icu/source/tools/genrb/parse.h michael@0: --- a/intl/icu/source/tools/genrb/parse.h michael@0: +++ b/intl/icu/source/tools/genrb/parse.h michael@0: @@ -1,7 +1,7 @@ michael@0: /* michael@0: ******************************************************************************* michael@0: * michael@0: -* Copyright (C) 1998-2011, International Business Machines michael@0: +* Copyright (C) 1998-2014, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: * michael@0: ******************************************************************************* michael@0: @@ -24,11 +24,11 @@ michael@0: michael@0: U_CDECL_BEGIN michael@0: /* One time parser initalisation */ michael@0: -void initParser(UBool omitCollationRules); michael@0: +void initParser(); michael@0: michael@0: /* Parse a ResourceBundle text file */ michael@0: struct SRBRoot* parse(UCHARBUF *buf, const char* inputDir, const char* outputDir, michael@0: - UBool omitBinaryCollation, UErrorCode *status); michael@0: + UBool makeBinaryCollation, UBool omitCollationRules, UErrorCode *status); michael@0: michael@0: U_CDECL_END michael@0: