Main Page   Modules  

Database Primitives


Detailed Description

This module describes interfaces common to all database modules--mainly the macros concerned with manipulating database keys and the definition of the key structure.

The key may be any arbitrary pointer, including a pointer to a string. Everything that handles a key either copies the contents of the db_key_t 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.

Defines

#define DB_KEY_INIT(key, size)
 Database key static initializer.

#define dk_key(key)
 Database key accessor macro.

#define dk_len(key)
 Database key length accessor macro.

#define DB_FLAG_REVERSE
 Reverse flag.


Typedefs

typedef _db_key_s db_key_t
 Database key.


Define Documentation

#define DB_FLAG_REVERSE
 

This flag can be passed to ordered iterations to reverse the order of the iterations.

#define DB_KEY_INIT key,
size   
 

This macro allows a db_key_t to be initialized statically.

Parameters:
key  A pointer to the key.
size  Size of the key.

#define dk_key key   
 

This macro allows access to the key field of a db_key_t. It may be used as an lvalue in order to assign a key to a db_key_t.

Parameters:
key  A pointer to a db_key_t.
Returns:
A pointer to a key (void *).

#define dk_len key   
 

This macro allows access to the key length field of a db_key_t. It may be used as an lvalue in order to assign a length to a db_key_t.

Parameters:
key  A pointer to a db_key_t.
Returns:
An int describing the length of the key.


Typedef Documentation

typedef struct _db_key_s db_key_t
 

This structure is a generic key containing a void * pointer and a length parameter. It should be accessed with * dk_key() and dk_len().


Generated on Thu Dec 11 01:24:36 2003 for Database Primitives Library by doxygen1.2.18