Lines Matching refs:fp
131 static void xfwrite(void *buf, size_t size, FILE *fp, const char *filename) in xfwrite() argument
133 if (fwrite(buf, 1, size, fp) != size) in xfwrite()
296 FILE *fp; in parse_fip() local
302 fp = fopen(filename, "rb"); in parse_fip()
303 if (fp == NULL) in parse_fip()
306 if (fstat(fileno(fp), &st) == -1) in parse_fip()
310 if (fread(buf, 1, st.st_size, fp) != st.st_size) in parse_fip()
313 fclose(fp); in parse_fip()
389 FILE *fp; in read_image_from_file() local
394 fp = fopen(filename, "rb"); in read_image_from_file()
395 if (fp == NULL) in read_image_from_file()
398 if (fstat(fileno(fp), &st) == -1) in read_image_from_file()
404 if (fread(image->buffer, 1, st.st_size, fp) != st.st_size) in read_image_from_file()
408 fclose(fp); in read_image_from_file()
414 FILE *fp; in write_image_to_file() local
416 fp = fopen(filename, "wb"); in write_image_to_file()
417 if (fp == NULL) in write_image_to_file()
419 xfwrite(image->buffer, image->toc_e.size, fp, filename); in write_image_to_file()
420 fclose(fp); in write_image_to_file()
510 FILE *fp; in pack_images() local
558 fp = fopen(filename, "wb"); in pack_images()
559 if (fp == NULL) in pack_images()
565 xfwrite(buf, buf_size, fp, filename); in pack_images()
575 if (fseek(fp, image->toc_e.offset_address, SEEK_SET)) in pack_images()
578 xfwrite(image->buffer, image->toc_e.size, fp, filename); in pack_images()
581 if (fseek(fp, entry_offset, SEEK_SET)) in pack_images()
586 fputc(0x0, fp); in pack_images()
589 fclose(fp); in pack_images()