A XBIN file starts with a header. It is then followed by an undertermined number of data sections up to the end of file.
Header
In order to check the file format, one must find a header defined as follows:
- 4 (1-byte) characters ’XBIN’
- a big endian 2-byte integer of XBIN version number
- a 4-byte integer to check endianness (1234)
Data sections
Data sections are composed by
- a data header
- data arrays
- a 3-byte end of section (’END’ string)
Data header
A data header defines the data section. It includes
- a data section name
- XBIN data type
- user defined type
- real and integer size
- a set of (integer) parameters
- dimensions of data arrays (if needed)
- external string (if needed)
Data arrays
There can be defined as
- no data section
- ordered or indirect ordered arrays
- with integers or floating point reals
If ordered, only minimum and maximum indexes are given, otherwise, the data section starts with an array of index indirection. It is then followed by the data itself.