|int(*||cmp )(const void *p1, const void *p2)|
|void(*||key_logdump_txt )(int logmask, const void *p, const char *txt)|
|zint(*||getseq )(const void *p)|
isam.h - a generalized interface to the isam systems
The isam system consists of a number of isam lists. Physically it is stored in a file, or a group of related files. It is typically used for storing all the occurrences of a given word, storing the document number and position for each occurrence.
An isam list is indentified by an isam_position. This is a number (zint). It can be seen as a mapping from an isam_position to an ordered list of isam_ entries.
An isam list consists of one or more isam entries. We do not know the structure of those entries, but we know the (maximum) size of such, and that they can be memcpy'ed around.
The entries can be seen to consist of a key and a value, although we have no idea of their internal structure. We know that we have a compare function that can look at a part (or whole) of the isam entry (the 'key'). The part not looked at (if any) will count as 'value' or 'payload'.
The entries are stored in increasing order (as defined by the compare function), and no duplicates are allowed.
There is an effective mass-insert routine that takes a stream of values, each accompanied by an insert/delete flag.
For reading we have cursors, that can read through an isam list in order. They have a fast-forward function to skip values we are not interested in. key_control contains all there is to know about the keys (entries) stored in an isam, (and therefore operated by the rsets). Other than this info, all we assume is that all keys are the same size, and they can be memcpy'd around.
|int(* key_control::cmp)(const void *p1, const void *p2)|
|zint(* key_control::getseq)(const void *p)|
|void(* key_control::key_logdump_txt)(int logmask, const void *p, const char *txt)|