Lines Matching refs:fp
40 static int count_lines(cups_file_t *fp);
55 cups_file_t *fp; /* File pointer */ in main() local
129 if ((fp = cupsFileOpen("../data/media.defs", "r")) == NULL) in main()
139 if ((count = count_lines(fp)) != 201) in main()
149 if (cupsFileRewind(fp) != 0) in main()
159 if ((count = count_lines(fp)) != 201) in main()
169 cupsFileClose(fp); in main()
208 if ((fp = cupsFileOpen(argv[1], "r")) == NULL) in main()
217 while (cupsFileGets(fp, line, sizeof(line))) in main()
220 if (!cupsFileEOF(fp)) in main()
223 cupsFileClose(fp); in main()
230 while ((bytes = cupsFileRead(fp, line, sizeof(line))) > 0) in main()
233 if (cupsFileEOF(fp)) in main()
238 cupsFileClose(fp); in main()
251 count_lines(cups_file_t *fp) /* I - File to read from */ in count_lines() argument
257 for (count = 0; cupsFileGets(fp, line, sizeof(line)); count ++); in count_lines()
277 cups_file_t *fp; /* File */ in random_tests() local
294 if ((fp = cupsFileOpen("testfile.dat", "a")) == NULL) in random_tests()
310 if ((pos = cupsFileTell(fp)) != (off_t)expected) in random_tests()
328 if (cupsFileWrite(fp, buffer, sizeof(buffer)) < (ssize_t)sizeof(buffer)) in random_tests()
348 if ((pos = cupsFileTell(fp)) != (off_t)expected) in random_tests()
358 cupsFileClose(fp); in random_tests()
366 if ((fp = cupsFileOpen("testfile.dat", "r")) == NULL) in random_tests()
399 if ((pos = cupsFileSeek(fp, expected)) != expected) in random_tests()
408 if (cupsFileRead(fp, buffer, sizeof(buffer)) != sizeof(buffer)) in random_tests()
428 cupsFileClose(fp); in random_tests()
453 cups_file_t *fp; /* File */ in read_write_tests() local
488 fp = cupsFileOpen(compression ? "testfile.dat.gz" : "testfile.dat", in read_write_tests()
490 if (fp) in read_write_tests()
500 if (cupsFileCompression(fp) == compression) in read_write_tests()
504 printf("FAIL (Got %d, expected %d)\n", cupsFileCompression(fp), in read_write_tests()
515 if (cupsFilePuts(fp, "# Hello, World\n") > 0) in read_write_tests()
530 if (cupsFilePrintf(fp, "TestLine %03d\n", i) < 0) in read_write_tests()
548 if (cupsFilePutChar(fp, i) < 0) in read_write_tests()
566 if (cupsFileWrite(fp, (char *)writebuf, sizeof(writebuf)) < 0) in read_write_tests()
583 if (cupsFilePuts(fp, partial_line) > 0) in read_write_tests()
597 if ((length = cupsFileTell(fp)) == 81933283) in read_write_tests()
611 if (!cupsFileClose(fp)) in read_write_tests()
631 fp = cupsFileOpen(compression ? "testfile.dat.gz" : "testfile.dat", "r"); in read_write_tests()
632 if (fp) in read_write_tests()
642 if (cupsFileGets(fp, line, sizeof(line))) in read_write_tests()
664 if (cupsFileCompression(fp) == compression) in read_write_tests()
668 printf("FAIL (Got %d, expected %d)\n", cupsFileCompression(fp), in read_write_tests()
682 if (!cupsFileGetConf(fp, line, sizeof(line), &value, &linenum)) in read_write_tests()
709 if ((byte = cupsFileGetChar(fp)) != i) in read_write_tests()
732 if ((bytes = cupsFileRead(fp, (char *)readbuf, sizeof(readbuf))) < 0) in read_write_tests()
763 if ((byte = cupsFileGetChar(fp)) < 0) in read_write_tests()
782 if ((length = cupsFileTell(fp)) == 81933283) in read_write_tests()
796 if (!cupsFileClose(fp)) in read_write_tests()