Lines Matching defs:file
37 int firstFileNum; // argv index of the first file name
43 // Info regarding the file currently being processed
48 UChar *ucharBuf = 0; // Buffer, holds converted file. (Simple minded program, always reads
49 // the whole file at once.
51 char *charBuf = 0; // Buffer, for original, unconverted file data.
57 int lineStart; // Index of first char of the current line in the file buffer
134 // Loop through the lines of a file, trying to match the regex pattern on each.
221 int remainingArgs = argc-optInd; // pattern file ...
229 // More than one file to be processed. Display file names with match output.
243 printf("ugrep [options] pattern file...\n"
247 "-n, --line-number Prefix each line of output with the line number within its input file.\n"
254 // readFile Read a file into memory, and convert it to Unicode.
257 // of always reading the whole file at once. No intelligent buffering
264 // Initialize global file variables
271 // Open the file and determine its size.
273 FILE *file = fopen(name, "rb");
274 if (file == 0 ) {
275 fprintf(stderr, "ugrep: Could not open file \"%s\"\n", fileName);
278 fseek(file, 0, SEEK_END);
279 int rawFileLen = ftell(file);
280 fseek(file, 0, SEEK_SET);
284 // Read in the file
287 int t = fread(charBuf, 1, rawFileLen, file);
289 fprintf(stderr, "Error reading file \"%s\"\n", fileName);
290 fclose(file);
294 fclose(file);
315 // Open a converter to take the file to UTF-16
325 // Convert the file data to UChar.
355 // the rest of the processing will proceed for this file.
367 // specified position in the input file buffer, by
412 // Print out the line from the file with the match, after