Closed lassik closed 3 months ago
Here's some Unix file(1) magic:
# Chibi-Scheme
0 string \a\achibi\n Chibi-Scheme memory image data
>8 ubyte >0 \b, big-endian
>>8 ubyte x \b, version %d.
>>10 ubyte x \b%d
>8 ubyte =0 \b, little-endian
>>9 ubyte x \b, version %d.
>>11 ubyte x \b%d,
>12 string x \b, ABI %s
Sample output:
chibi-srfi.img: Chibi-Scheme memory image data, little-endian, version 1.1, ABI cv-gm*uh
Yes, there's not an explicit endian flag in the header but the version won't match on the wrong endianness.
How are byte order differences handled when loading images?
It seems that the major and minor version are each meant to be restricted to one byte (1..255), and storing the number in a two-byte field (C short) will cause the reader to fail if the writer used a different endianness. Is this correct?