A MemCom database consists of a UNIX file system directory containing several files:
header
The header file.
index[.old]
The binary index file. Any
extension designates a previous version.
data.x
The binary data file(s).
The MemCom database header file is a text file containing the top-level information. In the current version it contains the following parameters:
MEM-COM x.y z endian_flag address_size creation_date access_date header_size index_size data_size naddr taddr dstsz nentry nrsize cvties liq clt hmode set_name_size ndim_max nfdes descrl redncy
The table below describes all relevant parameters, some of them being either unused or obsolete.
x y z | Major, minor, and patch level numbers. |
endian_flag | Little/big endian flag: 1 means data are stored in little-endian format. 0 means that data are store i big-endian format. |
address_size | Database creator address size (4 or 8). Not used anymore, since MemCom stores address in 8 byte format. |
creation_date | Database creation time stamp. |
access_date | Database last access time stamp. |
header_size | Size of header in bytes. Not used anymore and set to 0. |
index_size | Number of rows of index. |
data_size | Size of data file in bytes + 1.
data_size designates the byte address where
data can be appended. Note that data_size
is not necessarily equal to the data file size. |
naddr | Total size of data section (in bytes). |
taddr | Not used. |
dstsz | Size of index table structure (in bytes). |
nentry | Number of entries in index table. |
nrsize | Number of entries in index table that triggers index table resize. |
cvties | Total size of cavities, i.e empty space, in data section (in bytes). |
liq | Last entry in index table queried. |
clt | Current index table length. Not used. |
hmode | Index table search method. Currently not used. |
set_name_size | Maximum set name size (in bytes). |
ndim_max | Maximum number of array dimensions of any set. |
nfdes | Not used. |
descrl | Default dataset descriptor size (in bytes). |
redncy | Not used. |
The file index
contains for each
dataset its attributes (name, type, size, address, etc.). These
attributes are stored in IEEE little-endian
format, and their layout corresponds to the following (packed)
C-structure:
/* * Dataset structure as read from and written to index file. */ struct dbsetsdb { char sname[SET_NAME_LENGTH+1]; /* Name of dataset */ char type[4]; /* Type of dataset (E, I, D, etc.) */ char desclgt[4]; /* Descriptor size (bytes) */ char dspos[8]; /* Byte address of descriptor */ char spos[8]; /* Byte address of data part */ char ndim[1]; /* Number of dimensions */ char dim[MAX_NDIM][8]; /* Size of each dimension */ char status[1]; /* Status (0 inactive, 1 active) */ char hidden[1]; /* Hidden subset (0 no, 1 yes) */ char unit[1]; /* File unit (not used yet) */ };
The length of the index (the number of entries) is stored in the header file.