Home | History | Annotate | Download | only in toolutil

Lines Matching refs:FILE

8 *   file name:  package.cpp
65 vfprintf((FILE *)context, fmt, args);
174 // file handling ----------------------------------------------------------- ***
202 getFileLength(FILE *f) {
212 * Turn tree separators and alternate file separators into normal file separators.
230 * Turn file separators into tree separators.
263 // make sure the path ends with a file separator
272 // turn the name into a filename, turn tree separators into file separators
301 *sep++=U_FILE_SEP_CHAR; // restore file separator character
308 FILE *file;
315 /* open the input file, get its length, allocate memory for it, read the file */
316 file=fopen(filename, "rb");
317 if(file==NULL) {
318 fprintf(stderr, "icupkg: unable to open input file \"%s\"\n", filename);
322 /* get the file length */
323 fileLength=getFileLength(file);
324 if(ferror(file) || fileLength<=0) {
325 fprintf(stderr, "icupkg: empty input file \"%s\"\n", filename);
326 fclose(file);
334 fclose(file);
339 /* read the file */
340 if(fileLength!=(int32_t)fread(data, 1, fileLength, file)) {
342 fclose(file);
347 /* pad the file to a multiple of 16 using the usual padding byte */
352 fclose(file);
358 fprintf(stderr, "icupkg: not an ICU data file: \"%s\"\n", filename);
372 // .dat package file representation ---------------------------------------- ***
451 /* read the file */
609 fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[i-1].name, filename);
622 fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[i-1].name, filename);
646 FILE *file;
704 // create the file and write its contents
705 file=fopen(filename, "wb");
706 if(file==NULL) {
707 fprintf(stderr, "icupkg: unable to create file \"%s\"\n", filename);
719 length=(int32_t)fwrite(header, 1, headerLength, file);
721 fprintf(stderr, "icupkg: unable to write complete header to file \"%s\"\n", filename);
774 length=(int32_t)fwrite(&outInt32, 1, 4, file);
776 fprintf(stderr, "icupkg: unable to write complete item count to file \"%s\"\n", filename);
792 length=(int32_t)fwrite(&entry, 1, 8, file);
794 fprintf(stderr, "icupkg: unable to write complete item entry %ld to file \"%s\"\n", (long)i, filename);
806 length=(int32_t)fwrite(outStrings, 1, outStringTop, file);
808 fprintf(stderr, "icupkg: unable to write complete item names to file \"%s\"\n", filename);
826 length=(int32_t)fwrite(pItem->data, 1, pItem->length, file);
828 fprintf(stderr, "icupkg: unable to write complete item %ld to file \"%s\"\n", (long)i, filename);
833 if(ferror(file)) {
834 fprintf(stderr, "icupkg: unable to write complete file \"%s\"\n", filename);
838 fclose(file);
1077 FILE *file;
1115 // create the file and write its contents
1117 file=fopen(filename, "wb");
1118 if(file==NULL) {
1119 fprintf(stderr, "icupkg: unable to create file \"%s\"\n", filename);
1122 fileLength=(int32_t)fwrite(pItem->data, 1, pItem->length, file);
1124 if(ferror(file) || fileLength!=pItem->length) {
1125 fprintf(stderr, "icupkg: unable to write complete file \"%s\"\n", filename);
1128 fclose(file);