1 .TH "Database keys" 3 "6 Mar 2003" "dbprim" \" -*- nroff -*-
10 .RI "#define \fBDB_KEY_INIT\fP(key, size)"
12 .RI "\fIDatabase key static initializer.\fP"
14 .RI "#define \fBdk_key\fP(key)"
16 .RI "\fIDatabase key accessor macro.\fP"
18 .RI "#define \fBdk_len\fP(key)"
20 .RI "\fIDatabase key length accessor macro.\fP"
26 .RI "typedef struct _db_key_s \fBdb_key_t\fP"
28 .RI "\fIDatabase key.\fP"
30 .SH "DETAILED DESCRIPTION"
32 This module contains interfaces common to all database modules--mainly the macros concerned with manipulating database keys and the definition of the key structure.
34 The key may be any arbitrary pointer, including a pointer to a string. Everything that handles a key either copies the contents of the \fBdb_key_t\fP structure or passes it to a user-defined function. If required, as in the case of a string, a length may also be represented in the key structure.
35 .SH "DEFINE DOCUMENTATION"
37 .SS "#define DB_KEY_INIT(key, size)"
40 This macro allows a \fBdb_key_t\fP to be initialized statically.
50 .SS "#define dk_key(key)"
53 This macro allows access to the key field of a \fBdb_key_t\fP. It may be used as an lvalue in order to assign a key to a \fBdb_key_t\fP.
59 A pointer to a \fBdb_key_t\fP.
63 A pointer to a key (\fCvoid *\fP).
64 .SS "#define dk_len(key)"
67 This macro allows access to the key length field of a \fBdb_key_t\fP. It may be used as an lvalue in order to assign a length to a \fBdb_key_t\fP.
73 A pointer to a \fBdb_key_t\fP.
77 An \fCint\fP describing the length of the key.
78 .SH "TYPEDEF DOCUMENTATION"
80 .SS "typedef struct _db_key_s db_key_t"
83 This structure is a generic key containing a void * pointer and a length parameter. It should be accessed with * \fBdk_key\fP() and \fBdk_len\fP().