Lines Matching refs:header
182 u8 *header;
190 header = &buf2[MAX_HDR_SIZE - TYPE1_HDR_SIZE];
191 header[0] = 'Z';
192 header[1] = 'V';
193 header[2] = 1;
194 header[3] = cs >> 8;
195 header[4] = cs & 0xff;
196 header[5] = us >> 8;
197 header[6] = us & 0xff;
202 header = &buf1[MAX_HDR_SIZE - TYPE0_HDR_SIZE];
203 header[0] = 'Z';
204 header[1] = 'V';
205 header[2] = 0;
206 header[3] = us >> 8;
207 header[4] = us & 0xff;
211 if (wwrite (to, header, len) == -1)
221 u8 header[MAX_HDR_SIZE];
231 rc = rread (from, header + over, MAX_HDR_SIZE - over);
241 if (!rc || header[0] == 0)
244 if (rc < MIN_HDR_SIZE || header[0] != 'Z' || header[1] != 'V')
246 fprintf (stderr, "%s: invalid data stream - magic not found or short header\n", imagename);
250 switch (header[2])
254 us = (header[3] << 8) | header[4];
255 p = &header[TYPE0_HDR_SIZE];
262 cs = (header[3] << 8) | header[4];
263 us = (header[5] << 8) | header[6];
264 p = &header[TYPE1_HDR_SIZE];
272 l = &header[rc] - p;
280 memmove (header, &p[bytes], over);