| OLD | NEW |
| 1 /* | 1 /* |
| 2 ********************************************************************** | 2 ********************************************************************** |
| 3 * Copyright (C) 2002-2009, International Business Machines | 3 * Copyright (C) 2002-2015, International Business Machines |
| 4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
| 5 ********************************************************************** | 5 ********************************************************************** |
| 6 * | 6 * |
| 7 * File genbrk.c | 7 * File genbrk.c |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 //-------------------------------------------------------------------- | 10 //-------------------------------------------------------------------- |
| 11 // | 11 // |
| 12 // Tool for generating RuleBasedBreakIterator data files (.brk files). | 12 // Tool for generating RuleBasedBreakIterator data files (.brk files). |
| 13 // .brk files contain the precompiled rules for standard types | 13 // .brk files contain the precompiled rules for standard types |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 static char *progName; | 49 static char *progName; |
| 50 static UOption options[]={ | 50 static UOption options[]={ |
| 51 UOPTION_HELP_H, /* 0 */ | 51 UOPTION_HELP_H, /* 0 */ |
| 52 UOPTION_HELP_QUESTION_MARK, /* 1 */ | 52 UOPTION_HELP_QUESTION_MARK, /* 1 */ |
| 53 UOPTION_VERBOSE, /* 2 */ | 53 UOPTION_VERBOSE, /* 2 */ |
| 54 { "rules", NULL, NULL, NULL, 'r', UOPT_REQUIRES_ARG, 0 }, /* 3 */ | 54 { "rules", NULL, NULL, NULL, 'r', UOPT_REQUIRES_ARG, 0 }, /* 3 */ |
| 55 { "out", NULL, NULL, NULL, 'o', UOPT_REQUIRES_ARG, 0 }, /* 4 */ | 55 { "out", NULL, NULL, NULL, 'o', UOPT_REQUIRES_ARG, 0 }, /* 4 */ |
| 56 UOPTION_ICUDATADIR, /* 5 */ | 56 UOPTION_ICUDATADIR, /* 5 */ |
| 57 UOPTION_DESTDIR, /* 6 */ | 57 UOPTION_DESTDIR, /* 6 */ |
| 58 UOPTION_COPYRIGHT, /* 7 */ | 58 UOPTION_COPYRIGHT, /* 7 */ |
| 59 UOPTION_QUIET, /* 8 */ |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 void usageAndDie(int retCode) { | 62 void usageAndDie(int retCode) { |
| 62 printf("Usage: %s [-v] [-options] -r rule-file -o output-file\n", progNa
me); | 63 printf("Usage: %s [-v] [-options] -r rule-file -o output-file\n", progNa
me); |
| 63 printf("\tRead in break iteration rules text and write out the binary da
ta\n" | 64 printf("\tRead in break iteration rules text and write out the binary da
ta\n" |
| 64 "options:\n" | 65 "options:\n" |
| 65 "\t-h or -? or --help this usage text\n" | 66 "\t-h or -? or --help this usage text\n" |
| 66 "\t-V or --version show a version message\n" | 67 "\t-V or --version show a version message\n" |
| 67 "\t-c or --copyright include a copyright notice\n" | 68 "\t-c or --copyright include a copyright notice\n" |
| 68 "\t-v or --verbose turn on verbose output\n" | 69 "\t-v or --verbose turn on verbose output\n" |
| 70 "\t-q or --quiet do not display warnings and progress\n" |
| 69 "\t-i or --icudatadir directory for locating any needed intermediat
e data files,\n" | 71 "\t-i or --icudatadir directory for locating any needed intermediat
e data files,\n" |
| 70 "\t followed by path, defaults to %s\n" | 72 "\t followed by path, defaults to %s\n" |
| 71 "\t-d or --destdir destination directory, followed by the path\n
", | 73 "\t-d or --destdir destination directory, followed by the path\n
", |
| 72 u_getDataDirectory()); | 74 u_getDataDirectory()); |
| 73 exit (retCode); | 75 exit (retCode); |
| 74 } | 76 } |
| 75 | 77 |
| 76 | 78 |
| 77 #if UCONFIG_NO_BREAK_ITERATION || UCONFIG_NO_FILE_IO | 79 #if UCONFIG_NO_BREAK_ITERATION || UCONFIG_NO_FILE_IO |
| 78 | 80 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 fprintf(stderr, "Error writing to output file \"%s\"\n", outFileName); | 333 fprintf(stderr, "Error writing to output file \"%s\"\n", outFileName); |
| 332 exit(-1); | 334 exit(-1); |
| 333 } | 335 } |
| 334 | 336 |
| 335 delete bi; | 337 delete bi; |
| 336 delete[] ruleSourceU; | 338 delete[] ruleSourceU; |
| 337 delete[] ruleBufferC; | 339 delete[] ruleBufferC; |
| 338 u_cleanup(); | 340 u_cleanup(); |
| 339 | 341 |
| 340 | 342 |
| 341 printf("genbrk: tool completed successfully.\n"); | 343 if(!options[8].doesOccur) { |
| 344 printf("genbrk: tool completed successfully.\n"); |
| 345 } |
| 342 return 0; | 346 return 0; |
| 343 | 347 |
| 344 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ | 348 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ |
| 345 } | 349 } |
| 346 | 350 |
| OLD | NEW |