Lines Matching refs:fp
135 static void xfwrite(void *buf, size_t size, FILE *fp, const char *filename) in xfwrite() argument
137 if (fwrite(buf, 1, size, fp) != size) in xfwrite()
300 FILE *fp; in parse_fip() local
307 fp = fopen(filename, "rb"); in parse_fip()
308 if (fp == NULL) in parse_fip()
311 if (fstat(fileno(fp), &st) == -1) in parse_fip()
318 if (ioctl(fileno(fp), BLKGETSIZE64, &st_size) == -1) in parse_fip()
323 if (fread(buf, 1, st_size, fp) != st_size) in parse_fip()
326 fclose(fp); in parse_fip()
404 FILE *fp; in read_image_from_file() local
409 fp = fopen(filename, "rb"); in read_image_from_file()
410 if (fp == NULL) in read_image_from_file()
413 if (fstat(fileno(fp), &st) == -1) in read_image_from_file()
419 if (fread(image->buffer, 1, st.st_size, fp) != st.st_size) in read_image_from_file()
423 fclose(fp); in read_image_from_file()
429 FILE *fp; in write_image_to_file() local
431 fp = fopen(filename, "wb"); in write_image_to_file()
432 if (fp == NULL) in write_image_to_file()
434 xfwrite(image->buffer, image->toc_e.size, fp, filename); in write_image_to_file()
435 fclose(fp); in write_image_to_file()
533 FILE *fp; in pack_images() local
581 fp = fopen(filename, "wb"); in pack_images()
582 if (fp == NULL) in pack_images()
588 xfwrite(buf, buf_size, fp, filename); in pack_images()
598 if (fseek(fp, image->toc_e.offset_address, SEEK_SET)) in pack_images()
601 xfwrite(image->buffer, image->toc_e.size, fp, filename); in pack_images()
604 if (fseek(fp, entry_offset, SEEK_SET)) in pack_images()
609 fputc(0x0, fp); in pack_images()
612 fclose(fp); in pack_images()