Lines Matching refs:FILE
7 * File genctd.c
14 // Usage: genctd [options] -o output-file.ctd input-file
19 // The input file is a plain text file containing words, one per line.
22 // The file can be encoded as utf-8, or utf-16 (either endian), or
62 printf("Usage: %s [-v] [-options] -o output-file dictionary-file\n", progName);
150 fprintf(stderr, "input and output file must both be specified.\n");
162 /* Combine the directory with the file name */
179 /* write the dummy data file */
196 // Read in the dictionary source file
200 FILE *file;
203 file = fopen(wordFileName, "rb");
204 if( file == 0 ) {
205 fprintf(stderr, "Could not open file \"%s\"\n", wordFileName);
208 fseek(file, 0, SEEK_END);
209 wordFileSize = ftell(file);
210 fseek(file, 0, SEEK_SET);
213 result = (long)fread(wordBufferC, 1, wordFileSize, file);
215 fprintf(stderr, "Error reading file \"%s\"\n", wordFileName);
219 fclose(file);
222 // Look for a Unicode Signature (BOM) on the word file
237 // Open a converter to take the rule file to UTF-16
275 // Get rid of the original file buffer
360 // Create the output file
366 fprintf(stderr, "genctd: Could not open output file \"%s\", \"%s\"\n",
377 fprintf(stderr, "genctd: error \"%s\" writing the output file\n", u_errorName(status));
382 fprintf(stderr, "Error writing to output file \"%s\"\n", outFileName);