.TH "Database keys" 3 "6 Mar 2003" "dbprim" \" -*- nroff -*- .ad l .nh .SH NAME Database keys \- .SS "Defines" .in +1c .ti -1c .RI "#define \fBDB_KEY_INIT\fP(key, size)" .br .RI "\fIDatabase key static initializer.\fP" .ti -1c .RI "#define \fBdk_key\fP(key)" .br .RI "\fIDatabase key accessor macro.\fP" .ti -1c .RI "#define \fBdk_len\fP(key)" .br .RI "\fIDatabase key length accessor macro.\fP" .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef struct _db_key_s \fBdb_key_t\fP" .br .RI "\fIDatabase key.\fP" .in -1c .SH "DETAILED DESCRIPTION" .PP This module contains interfaces common to all database modules--mainly the macros concerned with manipulating database keys and the definition of the key structure. .PP 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. .SH "DEFINE DOCUMENTATION" .PP .SS "#define DB_KEY_INIT(key, size)" .PP .PP This macro allows a \fBdb_key_t\fP to be initialized statically. .PP \fBParameters: \fP .in +1c .TP \fB\fIkey\fP\fP A pointer to the key. .TP \fB\fIsize\fP\fP Size of the key. .SS "#define dk_key(key)" .PP .PP 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. .PP \fBParameters: \fP .in +1c .TP \fB\fIkey\fP\fP A pointer to a \fBdb_key_t\fP. .PP \fBReturns: \fP .in +1c A pointer to a key (\fCvoid *\fP). .SS "#define dk_len(key)" .PP .PP 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. .PP \fBParameters: \fP .in +1c .TP \fB\fIkey\fP\fP A pointer to a \fBdb_key_t\fP. .PP \fBReturns: \fP .in +1c An \fCint\fP describing the length of the key. .SH "TYPEDEF DOCUMENTATION" .PP .SS "typedef struct _db_key_s db_key_t" .PP .PP 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().