diff --git a/icu4c/source/tools/genprops/genprops.c b/icu4c/source/tools/genprops/genprops.c index 1322b8f369..95091d5241 100644 --- a/icu4c/source/tools/genprops/genprops.c +++ b/icu4c/source/tools/genprops/genprops.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1999-2002, International Business Machines +* Copyright (C) 1999-2003, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -13,8 +13,8 @@ * created on: 1999dec08 * created by: Markus W. Scherer * -* This program reads the Unicode character database text file, -* parses it, and extracts most of the properties for each character. +* This program reads several of the Unicode character database text files, +* parses them, and extracts most of the properties for each character. * It then writes a binary file containing the properties * that is designed to be used directly for random-access to * the properties of each Unicode character. @@ -24,6 +24,7 @@ #include #include "unicode/utypes.h" #include "unicode/uchar.h" +#include "unicode/uset.h" #include "unicode/putil.h" #include "cmemory.h" #include "cstring.h" @@ -41,6 +42,14 @@ U_CDECL_END UBool beVerbose=FALSE, haveCopyright=TRUE; +/* + * Unicode set collecting the case-sensitive characters; + * see uchar.h UCHAR_CASE_SENSITIVE. + * Add code points from case mappings/foldings in + * the root locale and with default options. + */ +static USet *caseSensitive; + /* prototypes --------------------------------------------------------------- */ static void @@ -79,7 +88,7 @@ main(int argc, char* argv[]) { /* preset then read command line options */ options[4].value=u_getDataDirectory(); options[5].value=""; - options[6].value="3.0.0"; + options[6].value=""; argc=u_parseArgs(argc, argv, sizeof(options)/sizeof(options[0]), options); /* error handling, printing usage message */ @@ -127,7 +136,10 @@ main(int argc, char* argv[]) { suffix=NULL; } - setUnicodeVersion(options[6].value); + if(options[6].doesOccur) { + setUnicodeVersion(options[6].value); + } + /* else use the default dataVersion in store.c */ /* prepare the filename beginning with the source dir */ uprv_strcpy(filename, srcDir); @@ -138,6 +150,7 @@ main(int argc, char* argv[]) { /* initialize */ initStore(); + caseSensitive=uset_open(1, 0); /* empty set (start>end) */ /* process BidiMirroring.txt */ writeUCDFilename(basename, "BidiMirroring", suffix); @@ -232,6 +245,18 @@ getTokenIndex(const char *const tokens[], int32_t countTokens, const char *s) { return -1; } +static void +_set_addAll(USet *set, const UChar *s, int32_t length) { + UChar32 c; + int32_t i; + + /* needs length>=0 */ + for(i=0; i