[sword-cvs] icu-sword/source/tools/genprops genprops.c,1.4,1.5 genprops.vcproj,1.1,1.2 props2.c,1.1,1.2 store.c,1.3,1.4
sword@www.crosswire.org
sword@www.crosswire.org
Tue, 6 Apr 2004 03:10:49 -0700
Update of /cvs/core/icu-sword/source/tools/genprops
In directory www:/tmp/cvs-serv8911/source/tools/genprops
Modified Files:
genprops.c genprops.vcproj props2.c store.c
Log Message:
ICU 2.8 sync
Index: genprops.c
===================================================================
RCS file: /cvs/core/icu-sword/source/tools/genprops/genprops.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- genprops.c 10 Sep 2003 02:42:57 -0000 1.4
+++ genprops.c 6 Apr 2004 10:10:07 -0000 1.5
@@ -26,6 +26,7 @@
#include "unicode/uchar.h"
#include "unicode/uset.h"
#include "unicode/putil.h"
+#include "unicode/uclean.h"
#include "cmemory.h"
#include "cstring.h"
#include "unewdata.h"
@@ -66,6 +67,20 @@
/* -------------------------------------------------------------------------- */
+
+enum
+{
+ HELP_H,
+ HELP_QUESTION_MARK,
+ VERBOSE,
+ COPYRIGHT,
+ DESTDIR,
+ SOURCEDIR,
+ UNICODE_VERSION,
+ ICUDATADIR
+};
+
+/* Keep these values in sync with the above enums */
static UOption options[]={
UOPTION_HELP_H,
UOPTION_HELP_QUESTION_MARK,
@@ -73,7 +88,8 @@
UOPTION_COPYRIGHT,
UOPTION_DESTDIR,
UOPTION_SOURCEDIR,
- { "unicode", NULL, NULL, NULL, 'u', UOPT_REQUIRES_ARG, 0 }
+ { "unicode", NULL, NULL, NULL, 'u', UOPT_REQUIRES_ARG, 0 },
+ UOPTION_ICUDATADIR
};
extern int
@@ -86,9 +102,10 @@
U_MAIN_INIT_ARGS(argc, argv);
/* preset then read command line options */
- options[4].value=u_getDataDirectory();
- options[5].value="";
- options[6].value="";
+ options[DESTDIR].value=u_getDataDirectory();
+ options[SOURCEDIR].value="";
+ options[UNICODE_VERSION].value="";
+ options[ICUDATADIR].value=u_getDataDirectory();
argc=u_parseArgs(argc, argv, sizeof(options)/sizeof(options[0]), options);
/* error handling, printing usage message */
@@ -97,7 +114,7 @@
"error in command line argument \"%s\"\n",
argv[-argc]);
}
- if(argc<0 || options[0].doesOccur || options[1].doesOccur) {
+ if(argc<0 || options[HELP_H].doesOccur || options[HELP_QUESTION_MARK].doesOccur) {
/*
* Broken into chucks because the C89 standard says the minimum
* required supported string length is 509 bytes.
@@ -118,17 +135,20 @@
fprintf(stderr,
"\t-d or --destdir destination directory, followed by the path\n"
"\t-s or --sourcedir source directory, followed by the path\n"
+ "\t-i or --icudatadir directory for locating any needed intermediate data files,\n"
+ "\t followed by path, defaults to %s\n"
"\tsuffix suffix that is to be appended with a '-'\n"
"\t to the source file basenames before opening;\n"
- "\t 'genprops new' will read UnicodeData-new.txt etc.\n");
+ "\t 'genprops new' will read UnicodeData-new.txt etc.\n",
+ u_getDataDirectory());
return argc<0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
}
/* get the options values */
- beVerbose=options[2].doesOccur;
- haveCopyright=options[3].doesOccur;
- srcDir=options[5].value;
- destDir=options[4].value;
+ beVerbose=options[VERBOSE].doesOccur;
+ haveCopyright=options[COPYRIGHT].doesOccur;
+ srcDir=options[SOURCEDIR].value;
+ destDir=options[DESTDIR].value;
if(argc>=2) {
suffix=argv[1];
@@ -136,11 +156,15 @@
suffix=NULL;
}
- if(options[6].doesOccur) {
- setUnicodeVersion(options[6].value);
+ if(options[UNICODE_VERSION].doesOccur) {
+ setUnicodeVersion(options[UNICODE_VERSION].value);
}
/* else use the default dataVersion in store.c */
+ if (options[ICUDATADIR].doesOccur) {
+ u_setDataDirectory(options[ICUDATADIR].value);
+ }
+
/* prepare the filename beginning with the source dir */
uprv_strcpy(filename, srcDir);
basename=filename+uprv_strlen(filename);
@@ -178,17 +202,18 @@
generateData(destDir);
}
+ u_cleanup();
return errorCode;
}
U_CFUNC void
writeUCDFilename(char *basename, const char *filename, const char *suffix) {
- int32_t length=uprv_strlen(filename);
+ int32_t length=(int32_t)uprv_strlen(filename);
uprv_strcpy(basename, filename);
if(suffix!=NULL) {
basename[length++]='-';
uprv_strcpy(basename+length, suffix);
- length+=uprv_strlen(suffix);
+ length+=(int32_t)uprv_strlen(suffix);
}
uprv_strcpy(basename+length, ".txt");
}
@@ -1031,3 +1056,4 @@
* End:
*
*/
+
Index: genprops.vcproj
===================================================================
RCS file: /cvs/core/icu-sword/source/tools/genprops/genprops.vcproj,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- genprops.vcproj 10 Sep 2003 02:42:57 -0000 1.1
+++ genprops.vcproj 6 Apr 2004 10:10:08 -0000 1.2
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="7.00"
+ Version="7.10"
Name="genprops"
SccProjectName=""
SccLocalPath="">
@@ -37,9 +37,9 @@
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"
- CommandLine="copy $(TargetPath) ..\..\..\bin
+ CommandLine="copy "$(TargetPath)" ..\..\..\bin
"
- Outputs="..\..\..\bin\$(InputName).exe"/>
+ Outputs="..\..\..\bin\$(TargetFileName)"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
@@ -66,7 +66,13 @@
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
@@ -97,9 +103,9 @@
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"
- CommandLine="copy $(TargetPath) ..\..\..\bin
+ CommandLine="copy "$(TargetPath)" ..\..\..\bin
"
- Outputs="..\..\..\bin\$(InputName).exe"/>
+ Outputs="..\..\..\bin\$(TargetFileName)"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
@@ -127,9 +133,17 @@
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
+ <References>
+ </References>
<Files>
<Filter
Name="Source Files"
Index: props2.c
===================================================================
RCS file: /cvs/core/icu-sword/source/tools/genprops/props2.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- props2.c 10 Sep 2003 02:42:57 -0000 1.1
+++ props2.c 6 Apr 2004 10:10:08 -0000 1.2
@@ -470,7 +470,7 @@
/* parse EastAsianWidth.txt */
parseSingleEnumFile(filename, basename, suffix, &eawSingleEnum, pErrorCode);
- trie=utrie_open(NULL, NULL, 50000, 0, TRUE);
+ trie=utrie_open(NULL, NULL, 50000, 0, 0, TRUE);
if(trie==NULL) {
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
upvec_close(pv);
@@ -666,7 +666,7 @@
/* parse bidi class */
s=trimTerminateField(fields[1][0], fields[1][1]);
value=u_getPropertyValueEnum(UCHAR_BIDI_CLASS, s);
- if(value<0) {
+ if((int32_t)value<0) {
fprintf(stderr, "genprops error: unknown bidi class in DerivedBidiClass.txt field 1 at %s\n", s);
exit(U_PARSE_ERROR);
}
Index: store.c
===================================================================
RCS file: /cvs/core/icu-sword/source/tools/genprops/store.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- store.c 10 Sep 2003 02:42:57 -0000 1.3
+++ store.c 6 Apr 2004 10:10:08 -0000 1.4
@@ -341,7 +341,7 @@
extern void
initStore() {
- pTrie=utrie_open(NULL, NULL, MAX_PROPS_COUNT, 0, TRUE);
+ pTrie=utrie_open(NULL, NULL, MAX_PROPS_COUNT, 0, 0, TRUE);
if(pTrie==NULL) {
fprintf(stderr, "error: unable to create a UNewTrie\n");
exit(U_MEMORY_ALLOCATION_ERROR);