MCPcopy Create free account
hub / github.com/NetHack/NetHack / read_header

Function read_header

win/share/bmptiles.c:324–338  ·  view source on GitHub ↗

Read and decode the first header */

Source from the content-addressed store, hash-verified

322
323/* Read and decode the first header */
324static boolean
325read_header(FILE *fp, struct BitmapHeader *header)
326{
327 unsigned char buf[14];
328 size_t size;
329
330 size = fread(buf, 1, sizeof(buf), fp);
331 if (size < sizeof(buf)) return FALSE;
332
333 memcpy(header->magic, buf + 0, 2);
334 header->bmp_size = read_u32(buf + 2);
335 /* 6 and 8 are 16 bit integers giving the hotspot of a cursor */
336 header->img_offset = read_u32(buf + 10);
337 return TRUE;
338}
339
340/* Read and decode the second header */
341static boolean

Callers 1

read_bmp_tilesFunction · 0.70

Calls 2

freadFunction · 0.85
read_u32Function · 0.70

Tested by

no test coverage detected