Meta File Format 1. Introduction This specification defines a user-level file format that allows items of meta data to be stored in the same physical file as the content to which it relates. 2. Member Format All numbers used in the file format will be unsigned integers of either 16 or 32 bits in length. These numbers will be stored in a big endian, "twos compliment" binary format. Conversions from host to big endian (or network) numbers can be performed using the htonl and htons standard library functions. Conversions from big endian (or network) to host numbers can be performed using the ntohl and ntols standard library functions. 3. File Format 3.1. Header 1 2 3 4 +---+---+---+---+ |VERNO |ISIZE | +---+---+---+---+ VERNO Unsigned, 16 bit integer: The version number of the Meta Archive file format, will be 1 when conforming to this specification. ISIZE Unsigned, 16 bit integer: Specifies the number of items of meta data stored in the index section of the file. 3.2. Index 1 ... 38 39 40 +---+-- / --+---+---+---+ |KEY1 \0|MSIZE1 | +---+-- / --+---+---+---+ | ... | ... | +---+-- / --+---+---+---+ |KEYn* \0|MSIZEn*| +---+-- / --+---+---+---+ * Where n is less than or equal to 2^16 KEY Zero terminated ASCII string upto 38 bytes in length (including terminator): used as a key for addressing an item of Meta Data, see section 3.4. MSIZE Unsigned, 16 bit integer: The size of the Meta Data item that follows. 3.3. User Data 1 2 3 4 ... 4+n* +---+---+---+---+===========+ |USIZE |UDATA | +---+---+---+---+===========+ * Where n is less than or equal to 2^32 USIZE Unsigned, 32 bit integer: The size of the User Data that follows. UDATA Array of bytes upto 2 ^ 32 in length: The User Data. 3.4. Meta Data ... a ... a+b ... a+b+c* +===========+===========+===========+ |MDATA1 | ... |MDATAn** | +===========+===========+===========+ * Where a, b and c are less than or equal to 2^16 ** Where n is less than or equal to 2^16 MDATA Array of bytes upto 2 ^ 16 in length: The Meta Data.