Lines Matching defs:fp
134 static void xfwrite(void *buf, size_t size, FILE *fp, const char *filename)
136 if (fwrite(buf, 1, size, fp) != size)
299 FILE *fp;
306 fp = fopen(filename, "rb");
307 if (fp == NULL)
310 if (fstat(fileno(fp), &st) == -1)
317 if (ioctl(fileno(fp), BLKGETSIZE64, &st_size) == -1)
322 if (fread(buf, 1, st_size, fp) != st_size)
325 fclose(fp);
403 FILE *fp;
408 fp = fopen(filename, "rb");
409 if (fp == NULL)
412 if (fstat(fileno(fp), &st) == -1)
418 if (fread(image->buffer, 1, st.st_size, fp) != st.st_size)
422 fclose(fp);
428 FILE *fp;
430 fp = fopen(filename, "wb");
431 if (fp == NULL)
433 xfwrite(image->buffer, image->toc_e.size, fp, filename);
434 fclose(fp);
532 FILE *fp;
580 fp = fopen(filename, "wb");
581 if (fp == NULL)
587 xfwrite(buf, buf_size, fp, filename);
597 if (fseek(fp, image->toc_e.offset_address, SEEK_SET))
600 xfwrite(image->buffer, image->toc_e.size, fp, filename);
603 if (fseek(fp, entry_offset, SEEK_SET))
608 fputc(0x0, fp);
611 fclose(fp);