2 *******************************************************************************
4 * Copyright (C) 1998-2012, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 *******************************************************************************
11 * Modification History:
13 * Date Name Description
14 * 05/25/99 stephen Creation.
15 * 5/10/01 Ram removed ustdio dependency
16 *******************************************************************************
20 #include "unicode/uclean.h"
22 #include "ucmndata.h" /* TODO: for reading the pool bundle */
25 void processFile(const char *filename
, const char* cp
, const char *inputDir
, const char *outputDir
,
26 const char *packageName
, UBool omitBinaryCollation
, UErrorCode
*status
);
27 static char *make_res_filename(const char *filename
, const char *outputDir
,
28 const char *packageName
, UErrorCode
*status
);
31 #define RES_SUFFIX ".res"
32 #define COL_SUFFIX ".col"
34 static char theCurrentFileName
[2048];
35 const char *gCurrentFileName
= theCurrentFileName
;
53 /* PACKAGE_NAME, This option is deprecated and should not be used ever. */
69 UOPTION_HELP_QUESTION_MARK
,
79 /* UOPTION_PACKAGE_NAME, This option is deprecated and should not be used ever. */
81 UOPTION_DEF("write-xliff", 'x', UOPT_OPTIONAL_ARG
),
82 UOPTION_DEF("strict", 'k', UOPT_NO_ARG
), /* 14 */
83 UOPTION_DEF("noBinaryCollation", 'C', UOPT_NO_ARG
),/* 15 */
84 UOPTION_DEF("language", 'l', UOPT_REQUIRES_ARG
), /* 16 */
85 UOPTION_DEF("omitCollationRules", 'R', UOPT_NO_ARG
),/* 17 */
86 UOPTION_DEF("formatVersion", '\x01', UOPT_REQUIRES_ARG
),/* 18 */
87 UOPTION_DEF("writePoolBundle", '\x01', UOPT_NO_ARG
),/* 19 */
88 UOPTION_DEF("usePoolBundle", '\x01', UOPT_OPTIONAL_ARG
),/* 20 */
89 UOPTION_DEF("includeUnihanColl", '\x01', UOPT_NO_ARG
),/* 21 */ /* temporary, don't display in usage info */
92 static UBool write_java
= FALSE
;
93 static UBool write_xliff
= FALSE
;
94 static const char* outputEnc
="";
95 static const char* gPackageName
=NULL
;
96 static const char* bundleName
=NULL
;
97 static struct SRBRoot
*newPoolBundle
= NULL
;
98 UBool gIncludeUnihanColl
= FALSE
;
100 /* TODO: separate header file for ResFile? */
101 typedef struct ResFile
{
103 const int32_t *fIndexes
;
110 static ResFile poolBundle
= { NULL
};
113 static const char* language
= NULL
;
114 static const char* xliffOutputFileName
= NULL
;
119 UErrorCode status
= U_ZERO_ERROR
;
120 const char *arg
= NULL
;
121 const char *outputDir
= NULL
; /* NULL = no output directory, use current */
122 const char *inputDir
= NULL
;
123 const char *encoding
= "";
126 U_MAIN_INIT_ARGS(argc
, argv
);
128 argc
= u_parseArgs(argc
, argv
, (int32_t)(sizeof(options
)/sizeof(options
[0])), options
);
130 /* error handling, printing usage message */
132 fprintf(stderr
, "%s: error in command line argument \"%s\"\n", argv
[0], argv
[-argc
]);
136 if(options
[WRITE_POOL_BUNDLE
].doesOccur
&& options
[USE_POOL_BUNDLE
].doesOccur
) {
137 fprintf(stderr
, "%s: cannot combine --writePoolBundle and --usePoolBundle\n", argv
[0]);
140 if(options
[FORMAT_VERSION
].doesOccur
) {
141 const char *s
= options
[FORMAT_VERSION
].value
;
142 if(uprv_strlen(s
) != 1 || (s
[0] != '1' && s
[0] != '2')) {
143 fprintf(stderr
, "%s: unsupported --formatVersion %s\n", argv
[0], s
);
145 } else if(s
[0] == '1' &&
146 (options
[WRITE_POOL_BUNDLE
].doesOccur
|| options
[USE_POOL_BUNDLE
].doesOccur
)
148 fprintf(stderr
, "%s: cannot combine --formatVersion 1 with --writePoolBundle or --usePoolBundle\n", argv
[0]);
151 setFormatVersion(s
[0] - '0');
155 if(options
[VERSION
].doesOccur
) {
157 "%s version %s (ICU version %s).\n"
159 argv
[0], GENRB_VERSION
, U_ICU_VERSION
, U_COPYRIGHT_STRING
);
163 if(argc
<0 || options
[HELP1
].doesOccur
|| options
[HELP2
].doesOccur
) {
165 * Broken into chunks because the C89 standard says the minimum
166 * required supported string length is 509 bytes.
169 "Usage: %s [OPTIONS] [FILES]\n"
170 "\tReads the list of resource bundle source files and creates\n"
171 "\tbinary version of resource bundles (.res files)\n",
175 "\t-h or -? or --help this usage text\n"
176 "\t-q or --quiet do not display warnings\n"
177 "\t-v or --verbose print extra information when processing files\n"
178 "\t-V or --version prints out version number and exits\n"
179 "\t-c or --copyright include copyright notice\n");
181 "\t-e or --encoding encoding of source files\n"
182 "\t-d of --destdir destination directory, followed by the path, defaults to %s\n"
183 "\t-s or --sourcedir source directory for files followed by path, defaults to %s\n"
184 "\t-i or --icudatadir directory for locating any needed intermediate data files,\n"
185 "\t followed by path, defaults to %s\n",
186 u_getDataDirectory(), u_getDataDirectory(), u_getDataDirectory());
188 "\t-j or --write-java write a Java ListResourceBundle for ICU4J, followed by optional encoding\n"
189 "\t defaults to ASCII and \\uXXXX format.\n");
190 /* This option is deprecated and should not be used ever.
191 "\t-p or --package-name For ICU4J: package name for writing the ListResourceBundle for ICU4J,\n"
192 "\t defaults to com.ibm.icu.impl.data\n"); */
194 "\t-b or --bundle-name bundle name for writing the ListResourceBundle for ICU4J,\n"
195 "\t defaults to LocaleElements\n"
196 "\t-x or --write-xliff write an XLIFF file for the resource bundle. Followed by\n"
197 "\t an optional output file name.\n"
198 "\t-k or --strict use pedantic parsing of syntax\n"
200 "\t-l or --language for XLIFF: language code compliant with BCP 47.\n");
202 "\t-C or --noBinaryCollation do not generate binary collation image;\n"
203 "\t makes .res file smaller but collator instantiation much slower;\n"
204 "\t maintains ability to get tailoring rules\n"
205 "\t-R or --omitCollationRules do not include collation (tailoring) rules;\n"
206 "\t makes .res file smaller and maintains collator instantiation speed\n"
207 "\t but tailoring rules will not be available (they are rarely used)\n");
209 "\t --formatVersion write a .res file compatible with the requested formatVersion (single digit);\n"
210 "\t for example, --formatVersion 1\n");
212 "\t --writePoolBundle write a pool.res file with all of the keys of all input bundles\n"
213 "\t --usePoolBundle [path-to-pool.res] point to keys from the pool.res keys pool bundle if they are available there;\n"
214 "\t makes .res files smaller but dependent on the pool bundle\n"
215 "\t (--writePoolBundle and --usePoolBundle cannot be combined)\n");
217 return argc
< 0 ? U_ILLEGAL_ARGUMENT_ERROR
: U_ZERO_ERROR
;
220 if(options
[VERBOSE
].doesOccur
) {
224 if(options
[QUIET
].doesOccur
) {
225 setShowWarning(FALSE
);
227 if(options
[STRICT
].doesOccur
) {
230 if(options
[COPYRIGHT
].doesOccur
){
231 setIncludeCopyright(TRUE
);
234 if(options
[SOURCEDIR
].doesOccur
) {
235 inputDir
= options
[SOURCEDIR
].value
;
238 if(options
[DESTDIR
].doesOccur
) {
239 outputDir
= options
[DESTDIR
].value
;
241 /* This option is deprecated and should never be used.
242 if(options[PACKAGE_NAME].doesOccur) {
243 gPackageName = options[PACKAGE_NAME].value;
244 if(!strcmp(gPackageName, "ICUDATA"))
246 gPackageName = U_ICUDATA_NAME;
248 if(gPackageName[0] == 0)
254 if(options
[ENCODING
].doesOccur
) {
255 encoding
= options
[ENCODING
].value
;
258 if(options
[ICUDATADIR
].doesOccur
) {
259 u_setDataDirectory(options
[ICUDATADIR
].value
);
263 if (U_FAILURE(status
) && status
!= U_FILE_ACCESS_ERROR
) {
264 /* Note: u_init() will try to open ICU property data.
265 * failures here are expected when building ICU from scratch.
268 fprintf(stderr
, "%s: can not initialize ICU. status = %s\n",
269 argv
[0], u_errorName(status
));
272 status
= U_ZERO_ERROR
;
273 if(options
[WRITE_JAVA
].doesOccur
) {
275 outputEnc
= options
[WRITE_JAVA
].value
;
278 if(options
[BUNDLE_NAME
].doesOccur
) {
279 bundleName
= options
[BUNDLE_NAME
].value
;
282 if(options
[WRITE_XLIFF
].doesOccur
) {
284 if(options
[WRITE_XLIFF
].value
!= NULL
){
285 xliffOutputFileName
= options
[WRITE_XLIFF
].value
;
289 initParser(options
[NO_COLLATION_RULES
].doesOccur
);
292 if(options
[LANGUAGE
].doesOccur
) {
293 language
= options
[LANGUAGE
].value
;
296 if(options
[WRITE_POOL_BUNDLE
].doesOccur
) {
297 newPoolBundle
= bundle_open(NULL
, TRUE
, &status
);
298 if(U_FAILURE(status
)) {
299 fprintf(stderr
, "unable to create an empty bundle for the pool keys: %s\n", u_errorName(status
));
302 const char *poolResName
= "pool.res";
303 char *nameWithoutSuffix
= uprv_malloc(uprv_strlen(poolResName
) + 1);
304 if (nameWithoutSuffix
== NULL
) {
305 fprintf(stderr
, "out of memory error\n");
306 return U_MEMORY_ALLOCATION_ERROR
;
308 uprv_strcpy(nameWithoutSuffix
, poolResName
);
309 *uprv_strrchr(nameWithoutSuffix
, '.') = 0;
310 newPoolBundle
->fLocale
= nameWithoutSuffix
;
314 if(options
[USE_POOL_BUNDLE
].doesOccur
) {
315 const char *poolResName
= "pool.res";
316 FileStream
*poolFile
;
317 int32_t poolFileSize
;
320 * TODO: Consolidate inputDir/filename handling from main() and processFile()
321 * into a common function, and use it here as well.
322 * Try to create toolutil functions for dealing with dir/filenames and
323 * loading ICU data files without udata_open().
324 * Share code with icupkg?
325 * Also, make_res_filename() seems to be unused. Review and remove.
327 if (options
[USE_POOL_BUNDLE
].value
!=NULL
) {
328 uprv_strcpy(theCurrentFileName
, options
[USE_POOL_BUNDLE
].value
);
329 uprv_strcat(theCurrentFileName
, U_FILE_SEP_STRING
);
330 } else if (inputDir
) {
331 uprv_strcpy(theCurrentFileName
, inputDir
);
332 uprv_strcat(theCurrentFileName
, U_FILE_SEP_STRING
);
334 *theCurrentFileName
= 0;
336 uprv_strcat(theCurrentFileName
, poolResName
);
337 poolFile
= T_FileStream_open(theCurrentFileName
, "rb");
338 if (poolFile
== NULL
) {
339 fprintf(stderr
, "unable to open pool bundle file %s\n", theCurrentFileName
);
342 poolFileSize
= T_FileStream_size(poolFile
);
343 if (poolFileSize
< 32) {
344 fprintf(stderr
, "the pool bundle file %s is too small\n", theCurrentFileName
);
347 poolBundle
.fBytes
= (uint8_t *)uprv_malloc((poolFileSize
+ 15) & ~15);
348 if (poolFileSize
> 0 && poolBundle
.fBytes
== NULL
) {
349 fprintf(stderr
, "unable to allocate memory for the pool bundle file %s\n", theCurrentFileName
);
350 return U_MEMORY_ALLOCATION_ERROR
;
353 const DataHeader
*header
;
354 int32_t bytesRead
= T_FileStream_read(poolFile
, poolBundle
.fBytes
, poolFileSize
);
356 if (bytesRead
!= poolFileSize
) {
357 fprintf(stderr
, "unable to read the pool bundle file %s\n", theCurrentFileName
);
361 * Swap the pool bundle so that a single checked-in file can be used.
362 * The swapper functions also test that the data looks like
363 * a well-formed .res file.
365 ds
= udata_openSwapperForInputData(poolBundle
.fBytes
, bytesRead
,
366 U_IS_BIG_ENDIAN
, U_CHARSET_FAMILY
, &status
);
367 if (U_FAILURE(status
)) {
368 fprintf(stderr
, "udata_openSwapperForInputData(pool bundle %s) failed: %s\n",
369 theCurrentFileName
, u_errorName(status
));
372 ures_swap(ds
, poolBundle
.fBytes
, bytesRead
, poolBundle
.fBytes
, &status
);
373 udata_closeSwapper(ds
);
374 if (U_FAILURE(status
)) {
375 fprintf(stderr
, "ures_swap(pool bundle %s) failed: %s\n",
376 theCurrentFileName
, u_errorName(status
));
379 header
= (const DataHeader
*)poolBundle
.fBytes
;
380 if (header
->info
.formatVersion
[0]!=2) {
381 fprintf(stderr
, "invalid format of pool bundle file %s\n", theCurrentFileName
);
382 return U_INVALID_FORMAT_ERROR
;
384 poolBundle
.fKeys
= (const char *)header
+ header
->dataHeader
.headerSize
;
385 poolBundle
.fIndexes
= (const int32_t *)poolBundle
.fKeys
+ 1;
386 indexLength
= poolBundle
.fIndexes
[URES_INDEX_LENGTH
] & 0xff;
387 if (indexLength
<= URES_INDEX_POOL_CHECKSUM
) {
388 fprintf(stderr
, "insufficient indexes[] in pool bundle file %s\n", theCurrentFileName
);
389 return U_INVALID_FORMAT_ERROR
;
391 keysBottom
= (1 + indexLength
) * 4;
392 poolBundle
.fKeys
+= keysBottom
;
393 poolBundle
.fKeysLength
= (poolBundle
.fIndexes
[URES_INDEX_KEYS_TOP
] * 4) - keysBottom
;
394 poolBundle
.fChecksum
= poolBundle
.fIndexes
[URES_INDEX_POOL_CHECKSUM
];
396 for (i
= 0; i
< poolBundle
.fKeysLength
; ++i
) {
397 if (poolBundle
.fKeys
[i
] == 0) {
398 ++poolBundle
.fKeysCount
;
401 T_FileStream_close(poolFile
);
402 setUsePoolBundle(TRUE
);
405 if(options
[INCLUDE_UNIHAN_COLL
].doesOccur
) {
406 gIncludeUnihanColl
= TRUE
;
410 printf("genrb number of files: %d\n", argc
- 1);
412 /* generate the binary files */
413 for(i
= 1; i
< argc
; ++i
) {
414 status
= U_ZERO_ERROR
;
415 arg
= getLongPathname(argv
[i
]);
418 uprv_strcpy(theCurrentFileName
, inputDir
);
419 uprv_strcat(theCurrentFileName
, U_FILE_SEP_STRING
);
421 *theCurrentFileName
= 0;
423 uprv_strcat(theCurrentFileName
, arg
);
426 printf("Processing file \"%s\"\n", theCurrentFileName
);
428 processFile(arg
, encoding
, inputDir
, outputDir
, gPackageName
,
429 options
[NO_BINARY_COLLATION
].doesOccur
,
433 uprv_free(poolBundle
.fBytes
);
435 if(options
[WRITE_POOL_BUNDLE
].doesOccur
) {
436 char outputFileName
[256];
437 bundle_write(newPoolBundle
, outputDir
, NULL
, outputFileName
, sizeof(outputFileName
), &status
);
438 bundle_close(newPoolBundle
, &status
);
439 if(U_FAILURE(status
)) {
440 fprintf(stderr
, "unable to write the pool bundle: %s\n", u_errorName(status
));
444 /* Dont return warnings as a failure */
445 if (U_SUCCESS(status
)) {
455 const char *filename
, const char *cp
, const char *inputDir
, const char *outputDir
, const char *packageName
,
456 UBool omitBinaryCollation
, UErrorCode
*status
) {
457 /*FileStream *in = NULL;*/
458 struct SRBRoot
*data
= NULL
;
459 UCHARBUF
*ucbuf
= NULL
;
461 char *openFileName
= NULL
;
462 char *inputDirBuf
= NULL
;
464 char outputFileName
[256];
470 if (status
==NULL
|| U_FAILURE(*status
)) {
474 *status
=U_ILLEGAL_ARGUMENT_ERROR
;
477 filelen
= (int32_t)uprv_strlen(filename
);
480 if(inputDir
== NULL
) {
481 const char *filenameBegin
= uprv_strrchr(filename
, U_FILE_SEP_CHAR
);
482 openFileName
= (char *) uprv_malloc(dirlen
+ filelen
+ 2);
483 openFileName
[0] = '\0';
484 if (filenameBegin
!= NULL
) {
486 * When a filename ../../../data/root.txt is specified,
487 * we presume that the input directory is ../../../data
488 * This is very important when the resource file includes
489 * another file, like UCARules.txt or thaidict.brk.
491 int32_t filenameSize
= (int32_t)(filenameBegin
- filename
+ 1);
492 inputDirBuf
= uprv_strncpy((char *)uprv_malloc(filenameSize
), filename
, filenameSize
);
495 if(inputDirBuf
== NULL
) {
496 *status
= U_MEMORY_ALLOCATION_ERROR
;
500 inputDirBuf
[filenameSize
- 1] = 0;
501 inputDir
= inputDirBuf
;
502 dirlen
= (int32_t)uprv_strlen(inputDir
);
505 dirlen
= (int32_t)uprv_strlen(inputDir
);
507 if(inputDir
[dirlen
-1] != U_FILE_SEP_CHAR
) {
508 openFileName
= (char *) uprv_malloc(dirlen
+ filelen
+ 2);
511 if(openFileName
== NULL
) {
512 *status
= U_MEMORY_ALLOCATION_ERROR
;
516 openFileName
[0] = '\0';
518 * append the input dir to openFileName if the first char in
519 * filename is not file seperation char and the last char input directory is not '.'.
520 * This is to support :
521 * genrb -s. /home/icu/data
523 * The user cannot mix notations like
524 * genrb -s. /icu/data --- the absolute path specified. -s redundant
526 * genrb -s. icu/data --- start from CWD and look in icu/data dir
528 if( (filename
[0] != U_FILE_SEP_CHAR
) && (inputDir
[dirlen
-1] !='.')){
529 uprv_strcpy(openFileName
, inputDir
);
530 openFileName
[dirlen
] = U_FILE_SEP_CHAR
;
532 openFileName
[dirlen
+ 1] = '\0';
534 openFileName
= (char *) uprv_malloc(dirlen
+ filelen
+ 1);
537 if(openFileName
== NULL
) {
538 *status
= U_MEMORY_ALLOCATION_ERROR
;
542 uprv_strcpy(openFileName
, inputDir
);
547 uprv_strcat(openFileName
, filename
);
549 ucbuf
= ucbuf_open(openFileName
, &cp
,getShowWarning(),TRUE
, status
);
550 if(*status
== U_FILE_ACCESS_ERROR
) {
552 fprintf(stderr
, "couldn't open file %s\n", openFileName
== NULL
? filename
: openFileName
);
555 if (ucbuf
== NULL
|| U_FAILURE(*status
)) {
556 fprintf(stderr
, "An error occured processing file %s. Error: %s\n", openFileName
== NULL
? filename
: openFileName
,u_errorName(*status
));
559 /* auto detected popular encodings? */
560 if (cp
!=NULL
&& isVerbose()) {
561 printf("autodetected encoding %s\n", cp
);
563 /* Parse the data into an SRBRoot */
564 data
= parse(ucbuf
, inputDir
, outputDir
, !omitBinaryCollation
, status
);
566 if (data
== NULL
|| U_FAILURE(*status
)) {
567 fprintf(stderr
, "couldn't parse the file %s. Error:%s\n", filename
,u_errorName(*status
));
570 if(options
[WRITE_POOL_BUNDLE
].doesOccur
) {
571 int32_t newKeysLength
;
572 const char *newKeys
, *newKeysLimit
;
573 bundle_compactKeys(data
, status
);
574 newKeys
= bundle_getKeyBytes(data
, &newKeysLength
);
575 bundle_addKeyBytes(newPoolBundle
, newKeys
, newKeysLength
, status
);
576 if(U_FAILURE(*status
)) {
577 fprintf(stderr
, "bundle_compactKeys(%s) or bundle_getKeyBytes() failed: %s\n",
578 filename
, u_errorName(*status
));
581 /* count the number of just-added key strings */
582 for(newKeysLimit
= newKeys
+ newKeysLength
; newKeys
< newKeysLimit
; ++newKeys
) {
584 ++newPoolBundle
->fKeysCount
;
589 if(options
[USE_POOL_BUNDLE
].doesOccur
) {
590 data
->fPoolBundleKeys
= poolBundle
.fKeys
;
591 data
->fPoolBundleKeysLength
= poolBundle
.fKeysLength
;
592 data
->fPoolBundleKeysCount
= poolBundle
.fKeysCount
;
593 data
->fPoolChecksum
= poolBundle
.fChecksum
;
596 /* Determine the target rb filename */
597 rbname
= make_res_filename(filename
, outputDir
, packageName
, status
);
598 if(U_FAILURE(*status
)) {
599 fprintf(stderr
, "couldn't make the res fileName for bundle %s. Error:%s\n", filename
,u_errorName(*status
));
602 if(write_java
== TRUE
){
603 bundle_write_java(data
,outputDir
,outputEnc
, outputFileName
, sizeof(outputFileName
),packageName
,bundleName
,status
);
604 }else if(write_xliff
==TRUE
){
605 bundle_write_xml(data
,outputDir
,outputEnc
, filename
, outputFileName
, sizeof(outputFileName
),language
, xliffOutputFileName
,status
);
607 /* Write the data to the file */
608 bundle_write(data
, outputDir
, packageName
, outputFileName
, sizeof(outputFileName
), status
);
610 if (U_FAILURE(*status
)) {
611 fprintf(stderr
, "couldn't write bundle %s. Error:%s\n", outputFileName
,u_errorName(*status
));
613 bundle_close(data
, status
);
617 if (inputDirBuf
!= NULL
) {
618 uprv_free(inputDirBuf
);
621 if (openFileName
!= NULL
) {
622 uprv_free(openFileName
);
634 /* Generate the target .res file name from the input file name */
636 make_res_filename(const char *filename
,
637 const char *outputDir
,
638 const char *packageName
,
639 UErrorCode
*status
) {
644 int32_t pkgLen
= 0; /* length of package prefix */
647 if (U_FAILURE(*status
)) {
651 if(packageName
!= NULL
)
653 pkgLen
= (int32_t)(1 + uprv_strlen(packageName
));
657 basename
= dirname
= resName
= 0;
659 /* determine basename, and compiled file names */
660 basename
= (char*) uprv_malloc(sizeof(char) * (uprv_strlen(filename
) + 1));
662 *status
= U_MEMORY_ALLOCATION_ERROR
;
666 get_basename(basename
, filename
);
668 dirname
= (char*) uprv_malloc(sizeof(char) * (uprv_strlen(filename
) + 1));
670 *status
= U_MEMORY_ALLOCATION_ERROR
;
674 get_dirname(dirname
, filename
);
676 if (outputDir
== NULL
) {
677 /* output in same dir as .txt */
678 resName
= (char*) uprv_malloc(sizeof(char) * (uprv_strlen(dirname
)
680 + uprv_strlen(basename
)
681 + uprv_strlen(RES_SUFFIX
) + 8));
683 *status
= U_MEMORY_ALLOCATION_ERROR
;
687 uprv_strcpy(resName
, dirname
);
689 if(packageName
!= NULL
)
691 uprv_strcat(resName
, packageName
);
692 uprv_strcat(resName
, "_");
695 uprv_strcat(resName
, basename
);
698 int32_t dirlen
= (int32_t)uprv_strlen(outputDir
);
699 int32_t basenamelen
= (int32_t)uprv_strlen(basename
);
701 resName
= (char*) uprv_malloc(sizeof(char) * (dirlen
+ pkgLen
+ basenamelen
+ 8));
703 if (resName
== NULL
) {
704 *status
= U_MEMORY_ALLOCATION_ERROR
;
708 uprv_strcpy(resName
, outputDir
);
710 if(outputDir
[dirlen
] != U_FILE_SEP_CHAR
) {
711 resName
[dirlen
] = U_FILE_SEP_CHAR
;
712 resName
[dirlen
+ 1] = '\0';
715 if(packageName
!= NULL
)
717 uprv_strcat(resName
, packageName
);
718 uprv_strcat(resName
, "_");
721 uprv_strcat(resName
, basename
);
733 * indent-tabs-mode: nil