staticint printHelp(int argc, char* argv[]){ /* * Broken into chucks because the C89 standard says the minimum * required supported string length is 509 bytes.
*/
fprintf(stderr, "Usage: %s [-options] [file_name]\n" "\n" "Read the files specified and\n" "create a binary file [package-name]_[bundle-name]." DATA_TYPE " with the StringPrep profile data\n" "\n",
argv[0]);
fprintf(stderr, "Options:\n" "\t-h or -? or --help print this usage text\n" "\t-v or --verbose verbose output\n" "\t-c or --copyright include a copyright notice\n");
fprintf(stderr, "\t-d or --destdir destination directory, followed by the path\n" "\t-s or --sourcedir source directory of ICU data, followed by the path\n" "\t-b or --bundle-name generate the output data file with the name specified\n" "\t-i or --icudatadir directory for locating any needed intermediate data files,\n" "\t followed by path, defaults to %s\n",
u_getDataDirectory());
fprintf(stderr, "\t-n or --normalize turn on the option for normalization and include mappings\n" "\t from NormalizationCorrections.txt from the given path,\n" "\t e.g: /test/icu/source/data/unidata\n");
fprintf(stderr, "\t-m or --norm-correction use NormalizationCorrections.txt from the given path\n" "\t when the input file contains a normalization directive.\n" "\t unlike -n/--normalize, this option does not force the\n" "\t normalization.\n");
fprintf(stderr, "\t-k or --check-bidi turn on the option for checking for BiDi in the profile\n" "\t-u or --unicode version of Unicode to be used with this profile followed by the version\n"
); return argc<0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
}
/* process the file */
uprv_strcpy(basename,inputFileName);
parseMappings(filename,false, &errorCode); if(U_FAILURE(errorCode)) {
fprintf(stderr, "Could not open file %s for reading. Error: %s \n", filename, u_errorName(errorCode)); return errorCode;
}
if(options[NORMALIZE].doesOccur){ /* this option might be set by @normalize;; in the source file */ /* set up directory for NormalizationCorrections.txt */
uprv_strcpy(filename,icuUniDataDir);
basename=filename+uprv_strlen(filename); if(basename>filename && *(basename-1)!=U_FILE_SEP_CHAR) {
*basename++=U_FILE_SEP_CHAR;
}
/* get the character code, field 0 */
code=(uint32_t)uprv_strtoul(fields[0][0], &end, 16); if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "gensprep: error parsing NormalizationCorrections.txt mapping at %s\n", fields[0][0]); exit(*pErrorCode);
} /* Original (erroneous) decomposition */
s = fields[1][0];
/* parse the mapping string */
length=u_parseCodePoints(s, mapping, sizeof(mapping)/4, pErrorCode);
/* get the character code, field 0 */
code=(uint32_t)uprv_strtoul(s, &end, 16); if(end<=s || end!=fields[0][1]) {
fprintf(stderr, "gensprep: syntax error in field 0 at %s\n", fields[0][0]);
*pErrorCode=U_PARSE_ERROR; exit(U_PARSE_ERROR);
}
/* parse the mapping string */
length=u_parseCodePoints(map, mapping, sizeof(mapping)/4, pErrorCode);
/* store the mapping */
storeMapping(code,mapping, length,USPREP_MAP, pErrorCode);
}else{
*pErrorCode = U_INVALID_FORMAT_ERROR;
}
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "gensprep error parsing %s line %s at %s. Error: %s\n",filename,
fields[0][0],fields[2][0],u_errorName(*pErrorCode)); exit(*pErrorCode);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.