Home | History | Annotate | Download | only in toolutil

Lines Matching defs:file

8 *   file name:  package.cpp
63 vfprintf((FILE *)context, fmt, args);
172 // file handling ----------------------------------------------------------- ***
200 getFileLength(FILE *f) {
210 * Turn tree separators and alternate file separators into normal file separators.
228 * Turn file separators into tree separators.
261 // make sure the path ends with a file separator
270 // turn the name into a filename, turn tree separators into file separators
299 *sep++=U_FILE_SEP_CHAR; // restore file separator character
306 FILE *file;
313 /* open the input file, get its length, allocate memory for it, read the file */
314 file=fopen(filename, "rb");
315 if(file==NULL) {
316 fprintf(stderr, "icupkg: unable to open input file \"%s\"\n", filename);
320 /* get the file length */
321 fileLength=getFileLength(file);
322 if(ferror(file) || fileLength<=0) {
323 fprintf(stderr, "icupkg: empty input file \"%s\"\n", filename);
324 fclose(file);
332 fclose(file);
337 /* read the file */
338 if(fileLength!=(int32_t)fread(data, 1, fileLength, file)) {
340 fclose(file);
345 /* pad the file to a multiple of 16 using the usual padding byte */
350 fclose(file);
356 fprintf(stderr, "icupkg: not an ICU data file: \"%s\"\n", filename);
370 // .dat package file representation ---------------------------------------- ***
460 /* read the file */
654 fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[i-1].name, filename);
667 fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[i-1].name, filename);
691 FILE *file;
749 // create the file and write its contents
750 file=fopen(filename, "wb");
751 if(file==NULL) {
752 fprintf(stderr, "icupkg: unable to create file \"%s\"\n", filename);
764 length=(int32_t)fwrite(header, 1, headerLength, file);
766 fprintf(stderr, "icupkg: unable to write complete header to file \"%s\"\n", filename);
828 length=(int32_t)fwrite(&outInt32, 1, 4, file);
830 fprintf(stderr, "icupkg: unable to write complete item count to file \"%s\"\n", filename);
846 length=(int32_t)fwrite(&entry, 1, 8, file);
848 fprintf(stderr, "icupkg: unable to write complete item entry %ld to file \"%s\"\n", (long)i, filename);
860 length=(int32_t)fwrite(outStrings, 1, outStringTop, file);
862 fprintf(stderr, "icupkg: unable to write complete item names to file \"%s\"\n", filename);
880 length=(int32_t)fwrite(pItem->data, 1, pItem->length, file);
882 fprintf(stderr, "icupkg: unable to write complete item %ld to file \"%s\"\n", (long)i, filename);
887 if(ferror(file)) {
888 fprintf(stderr, "icupkg: unable to write complete file \"%s\"\n", filename);
892 fclose(file);
1131 FILE *file;
1169 // create the file and write its contents
1171 file=fopen(filename, "wb");
1172 if(file==NULL) {
1173 fprintf(stderr, "icupkg: unable to create file \"%s\"\n", filename);
1176 fileLength=(int32_t)fwrite(pItem->data, 1, pItem->length, file);
1178 if(ferror(file) || fileLength!=pItem->length) {
1179 fprintf(stderr, "icupkg: unable to write complete file \"%s\"\n", filename);
1182 fclose(file);