The map library defines two data structures: MapElement and Map. A Binding is a pointer to a MapElement. A map element is a table of bindings, where each binding is given by the pair <external key, internal id>. An external key is a variable length byte string, which typically is constructed from various fields in a message header. An internal id is a fixed-sized identifier (e.g., a 32 or 64-bit memory address) which is a pointer to a protocol or session object.
typedef struct mapelement {struct mapelement *next;
void *externalkey;
void *internalid;
} MapElement, *Binding;
typedef struct {
int nEntries;
int keySize;
MapElement *cache;
MapElement *freelist;
MapElement **table;
XkReturn (*resolve)();
Binding (*bind)();
XkReturn (*unbind)();
XkReturn (*remove)();
} *Map;