Subject: Official File format for MyLittleBase database files. (.MLB) (http://www.mylittlebase.org) CopyRights: (C) ANIROM Multimedia (http://www.anirom.com) Marseille FRANCE April 2001 Anirom grants to anybody the right to use and distribute this file format freely, without modifying this file. Use it at your own risks. Remarks: 1- The type MLB_STRING is composed of a 4 BYTES LONG indicating the length in bytes of the string, followed by each character. It is NOT NULL terminated (no #0 char at end). 2- This format is made of blocks of data, each of them representing tables or additional blocks (custom data). 3- Additional blocks are data made of additional informations, for sample Huffman Tables if compressed data are supported. Each block is identified by the BLOCKID (block identifier), Tables' BLOCKID is allways 0. 4-The table ID and table names are used as reference to these tables, in Additional blocks or in the database library. Note that in version 2.0 of MyLittleBase no Additional block is used, and only the first table is read. Format: The file begins here [SIGNATURE = 3 chars : 'MLB'] [1 BYTE = MAJOR VERSION NUMBER] [1 BYTE = MINOR VERSION NUMBER] [1 BYTE = LITTLE_ENDIAN=0 BIG_ENDIAN=1] [2 BYTES INT = TABLECOUNT] (ALLWAYS 1 IN VERSION 2.0X) [2 BYTES INT = ADDITIONAL BLOCKS COUNT] for each table:: [2 BYTES INT = BLOCKID] (must be 0 for a table) [4 BYTES LONG = The length] (in bytes of the table begining with the TABLEID until the end of this table informations) [2 BYTES INT = TABLEID] [MLB_STRING = TABLE NAME] [4 BYTES LONG = FIELDS COUNT] [4 BYTES LONG = ROWS COUNT] for each FIELD{ [1 BYTE] identifying the type of data (0=STRING, 1=FLOAT) [MLB_STRING = FIELD NAME] } for each ROW{ [4 BYTES LONG=length in bytes] (length of the row beginning with the next byte) for each FIELD{ [MLB_STRING = DATA] (data are strings even for floats and integers) } } for each additional BLOCK:: [2 BYTES INT = BLOCKID] (must be set to 1 for an unknown or custom additional block that is not a table) [4 BYTES LONG = The length] (in bytes of the additional block begining with the next byte to the end of this block) [DATA]