Lines Matching refs:infile
121 int rnd_file(FILE * infile, int numlines, long seed);
122 int get_numlines(FILE * infile);
139 FILE *infile; in main() local
196 infile = stdin; in main()
202 if ((infile = fopen(argv[argc - 1], "r")) == NULL) { in main()
209 lsize = get_numlines(infile); in main()
212 rnd_file(infile, lsize, seed); in main()
247 int get_numlines(FILE *infile) in get_numlines() argument
252 while (fgets(line, MAX_LN_SZ, infile) != NULL) { in get_numlines()
257 fseek(infile, 0, SEEK_SET); in get_numlines()
270 int rnd_file(FILE *infile, in rnd_file() argument
304 while (!feof(infile)) { in rnd_file()
306 fseek(infile, coffset, SEEK_SET); in rnd_file()
307 coffset = ftell(infile); in rnd_file()
316 while (cnt < numlines && fgets(line, MAX_LN_SZ, infile) != NULL) { in rnd_file()
326 coffset = ftell(infile); in rnd_file()
339 fseek(infile, offsets[cnt].offset, SEEK_SET); in rnd_file()
340 if (fgets(line, MAX_LN_SZ, infile) == NULL) in rnd_file()
410 int rnd_stdin(FILE *infile, in rnd_stdin() argument
477 if ((rdsz = fread((void *)rdbuff, sztord, 1, infile)) == 0) { in rnd_stdin()