Home | History | Annotate | Download | only in toolutil

Lines Matching defs: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 ---------------------------------------- ***
462 /* read the file */
655 fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[i-1].name, filename);
668 fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[i-1].name, filename);
692 FILE *file;
750 // create the file and write its contents
751 file=fopen(filename, "wb");
752 if(file==NULL) {
753 fprintf(stderr, "icupkg: unable to create file \"%s\"\n", filename);
765 length=(int32_t)fwrite(header, 1, headerLength, file);
767 fprintf(stderr, "icupkg: unable to write complete header to file \"%s\"\n", filename);
829 length=(int32_t)fwrite(&outInt32, 1, 4, file);
831 fprintf(stderr, "icupkg: unable to write complete item count to file \"%s\"\n", filename);
847 length=(int32_t)fwrite(&entry, 1, 8, file);
849 fprintf(stderr, "icupkg: unable to write complete item entry %ld to file \"%s\"\n", (long)i, filename);
861 length=(int32_t)fwrite(outStrings, 1, outStringTop, file);
863 fprintf(stderr, "icupkg: unable to write complete item names to file \"%s\"\n", filename);
881 length=(int32_t)fwrite(pItem->data, 1, pItem->length, file);
883 fprintf(stderr, "icupkg: unable to write complete item %ld to file \"%s\"\n", (long)i, filename);
888 if(ferror(file)) {
889 fprintf(stderr, "icupkg: unable to write complete file \"%s\"\n", filename);
893 fclose(file);
1132 FILE *file;
1170 // create the file and write its contents
1172 file=fopen(filename, "wb");
1173 if(file==NULL) {
1174 fprintf(stderr, "icupkg: unable to create file \"%s\"\n", filename);
1177 fileLength=(int32_t)fwrite(pItem->data, 1, pItem->length, file);
1179 if(ferror(file) || fileLength!=pItem->length) {
1180 fprintf(stderr, "icupkg: unable to write complete file \"%s\"\n", filename);
1183 fclose(file);