Lines Matching refs:fp
34 int do_byteswap(FILE *fp) in do_byteswap() argument
46 fseek(fp, 0L, SEEK_END); in do_byteswap()
47 bytes = ftell(fp); in do_byteswap()
51 if (fwrite(&pad, append_bytes, NUM_MEM_BLOCK, fp) in do_byteswap()
60 rewind(fp); in do_byteswap()
62 if ((fread(&upper_byte, sizeof(upper_byte), NUM_MEM_BLOCK, fp) in do_byteswap()
63 != NUM_MEM_BLOCK) && (feof(fp) == 0)) { in do_byteswap()
67 if ((fread(&lower_byte, sizeof(lower_byte), NUM_MEM_BLOCK, fp) in do_byteswap()
68 != NUM_MEM_BLOCK) && (feof(fp) == 0)) { in do_byteswap()
72 fseek(fp, -8L, SEEK_CUR); in do_byteswap()
75 if (fwrite(&lower_byte, sizeof(lower_byte), NUM_MEM_BLOCK, fp) in do_byteswap()
80 if (fwrite(&upper_byte, sizeof(upper_byte), NUM_MEM_BLOCK, fp) in do_byteswap()
95 FILE *fp = NULL; in main() local
103 fp = fopen(argv[1], "rb+"); in main()
104 if (fp == NULL) { in main()
110 ret = do_byteswap(fp); in main()
111 fclose(fp); in main()