Lines Matching defs:fp
35 FILE *fp;
39 fp = fopen(fname, "rb");
40 if (fp == NULL) {
45 fseek(fp, 0, SEEK_END);
46 size = ftell(fp);
50 fclose(fp);
54 rewind(fp);
59 fclose(fp);
63 if (fread(img, 1, IMG_SIZE, fp) != IMG_SIZE) {
65 fclose(fp);
69 fclose(fp);
76 FILE *fp;
78 fp = fopen(fname, "wb");
79 if (fp == NULL) {
84 if (fwrite(img, 1, IMG_SIZE, fp) != IMG_SIZE) {
86 fclose(fp);
94 FILE *fp;
96 fp = fopen(fname, "wb");
97 if (fp == NULL) {
102 if (fwrite(img+ROOTFS_START, 1, ROOTFS_SIZE, fp) != ROOTFS_SIZE) {
104 fclose(fp);
112 FILE *fp;
114 fp = fopen(fname, "wb");
115 if (fp == NULL) {
120 if (fwrite(img+KERNEL_START, 1, KERNEL_SIZE, fp) != KERNEL_SIZE) {
122 fclose(fp);
130 FILE *fp;
137 fp = fopen(fname, "rb");
138 if (fp == NULL) {
143 fseek(fp, 0, SEEK_END);
144 size = ftell(fp);
148 fclose(fp);
152 rewind(fp);
154 if (fread(img+ROOTFS_START, 1, size, fp) != size) {
156 fclose(fp);
160 fclose(fp);
167 FILE *fp;
174 fp = fopen(fname, "rb");
175 if (fp == NULL) {
180 fseek(fp, 0, SEEK_END);
181 size = ftell(fp);
185 fclose(fp);
189 rewind(fp);
191 if (fread(img+KERNEL_START, 1, size, fp) != size) {
193 fclose(fp);
197 fclose(fp);