Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

dbprim.h File Reference


Detailed Description

This header file contains the necessary structures, #define's, and function declarations to make use of the Database Primitives library.

Definition in file dbprim.h.

#include <dbprim/dbprim_err.h>
#include <dbprim/dbprim_version.h>

Include dependency graph for dbprim.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _db_key_s
 Database key structure. More...
struct  _link_head_s
 Linked list head structure. More...
struct  _link_elem_s
 Linked list element structure. More...
struct  _hash_table_s
 Hash table structure. More...
struct  _hash_entry_s
 Hash table entry structure. More...
struct  _smat_table_s
 Sparse matrix table structure. More...
struct  _smat_head_s
 Sparse matrix list head structure. More...
struct  _smat_entry_s
 Sparse matrix entry structure. More...
struct  _rb_tree_s
 Red-black tree structure. More...
struct  _rb_node_s
 Red-black tree node structure. More...

Defines

#define DBPRIM_BEGIN_C_DECLS
 Begin declaration in C namespace.
#define DBPRIM_END_C_DECLS
 End declaration in C namespace.
#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.
#define LINK_HEAD_MAGIC
 Linked list head magic number.
#define LINK_HEAD_INIT(extra)
 Linked list head static initializer.
#define ll_verify(list)
 Linked list head verification macro.
#define ll_count(list)
 Linked list count.
#define ll_first(list)
 First element in linked list.
#define ll_last(list)
 Last element in a linked list.
#define ll_extra(list)
 Extra pointer data in a linked list.
#define LINK_ELEM_MAGIC
 Linked list element magic number.
#define LINK_ELEM_INIT(obj)
 Linked list element static initializer.
#define le_verify(element)
 Linked list element verification macro.
#define le_next(elem)
 Linked list element next pointer.
#define le_prev(elem)
 Linked list element previous pointer.
#define le_object(elem)
 Linked list element object pointer.
#define le_head(elem)
 Linked list element head pointer.
#define le_flags(elem)
 Linked list element flags.
#define HASH_TABLE_MAGIC
 Hash table magic number.
#define HASH_FLAG_AUTOGROW
 Flag permitting a hash table to automatically grow.
#define HASH_FLAG_AUTOSHRINK
 Flag permitting a hash table to automatically shrink.
#define HASH_FLAG_MASK
 Hash table flags that may be set by the user.
#define HASH_FLAG_FREEZE
 Flag indicating hash table is frozen.
#define HASH_TABLE_INIT(flags, func, comp, resize, extra)
 Hash table static initializer.
#define ht_verify(table)
 Hash table verification macro.
#define ht_flags(table)
 Hash table flags.
#define ht_frozen(table)
 Determine if a hash table is frozen.
#define ht_modulus(table)
 Hash table modulus.
#define ht_count(table)
 Hash table count.
#define ht_func(table)
 Hash table hash function.
#define ht_comp(table)
 Hash table comparison function.
#define ht_rsize(table)
 Hash table resize callback function.
#define ht_extra(table)
 Extra pointer data in a hash table.
#define ht_size(table)
 Hash table memory size.
#define HASH_ENTRY_MAGIC
 Hash table entry magic number.
#define HASH_ENTRY_INIT(value)
 Hash table entry static initializer.
#define he_verify(entry)
 Hash table entry verification macro.
#define he_link(entry)
 Hash table entry linked list element.
#define he_flags(entry)
 Hash table entry flags.
#define he_table(entry)
 Hash table entry table pointer.
#define he_hash(entry)
 Hash table entry hash value.
#define he_key(entry)
 Hash table entry key pointer.
#define he_value(entry)
 Hash table entry value pointer.
#define _smat_ent(ent)
 Retrieve pointer to sparse matrix entry.
#define SMAT_TABLE_MAGIC
 Sparse matrix table magic number.
#define st_verify(table)
 Sparse matrix table verification macro.
#define st_flags(table)
 Sparse matrix table flags.
#define st_frozen(table)
 Determine if a sparse matrix is frozen.
#define st_modulus(table)
 Sparse matrix table modulus.
#define st_count(table)
 Sparse matrix table count.
#define st_rsize(table)
 Sparse matrix table resize callback function.
#define st_extra(table)
 Extra pointer data in a sparse matrix table.
#define st_size(table)
 Sparse matrix table memory size.
#define SMAT_HEAD_MAGIC
 Sparse matrix list head magic number.
#define SMAT_HEAD_INIT(elem, object)
 Sparse matrix list head static initializer.
#define sh_verify(head)
 Sparse matrix list head verification macro.
#define sh_elem(head)
 Sparse matrix list head element macro.
#define sh_table(head)
 Sparse matrix list head table pointer.
#define sh_frozen(head)
 Determine if a sparse matrix is frozen.
#define sh_count(head)
 Sparse matrix list count.
#define _sh_first(head)
 Access the first element pointer in a smat_head_t.
#define sh_first(head)
 First element in sparse matrix list.
#define _sh_last(head)
 Access the last element pointer in a smat_head_t.
#define sh_last(head)
 Last element in sparse matrix list.
#define sh_object(head)
 Object represented by a sparse matrix list head.
#define sh_size(head)
 Sparse matrix list memory size.
#define SMAT_ENTRY_MAGIC
 Sparse matrix entry magic number.
#define se_verify(entry)
 Sparse matrix entry verification macro.
#define se_table(entry)
 Sparse matrix entry table.
#define _se_link(entry)
 Sparse matrix entry linked list element.
#define se_flags(entry)
 Sparse matrix entry flags.
#define se_hash(entry)
 Sparse matrix table entry hash value.
#define _se_next(entry, n)
 Access the next element pointer in a smat_entry_t.
#define se_next(entry, n)
 Next element in sparse matrix list.
#define _se_prev(entry, n)
 Access the previous element pointer in a smat_entry_t.
#define se_prev(entry, n)
 Previous element in sparse matrix list.
#define se_lflags(entry, n)
 Flags associated with an entry in a sparse matrix list.
#define se_object(entry, n)
 Object associated with an entry in a sparse matrix list.
#define RB_TREE_MAGIC
 Red-black tree magic number.
#define RBT_FLAG_FREEZE
 Flag indicating red-black tree is frozen.
#define RB_TREE_INIT(comp, extra)
 Red-black tree static initializer.
#define rt_verify(tree)
 Red-black tree verification macro.
#define rt_frozen(tree)
 Determine if a red-black tree is frozen.
#define rt_count(tree)
 Red-black tree count.
#define rt_root(tree)
 Red-black tree root node.
#define rt_comp(tree)
 Red-black tree comparison function.
#define rt_extra(tree)
 Extra pointer data in a red-black tree.
#define RBT_ORDER_PRE
 Preorder tree traversal method.
#define RBT_ORDER_IN
 Inorder tree traversal method.
#define RBT_ORDER_POST
 Postorder tree traversal method.
#define RBT_ORDER_MASK
 Tree traversal method mask.
#define rt_prev(tree, node_io, flags)
 Get the previous node.
#define RB_NODE_MAGIC
 Red-black tree node magic number.
#define RB_NODE_INIT(value)
 Red-black tree node static initializer.
#define rn_verify(node)
 Red-black tree node verification macro.
#define rn_color(node)
 Red-black tree node color.
#define rn_tree(node)
 Red-black tree node's tree pointer.
#define rn_parent(node)
 Red-black tree node's parent pointer.
#define rn_left(node)
 Red-black tree node's left pointer.
#define rn_right(node)
 Red-black tree node's right pointer.
#define rn_key(node)
 Red-black tree node's key pointer.
#define rn_value(node)
 Red-black tree node's value pointer.
#define rn_isblack(node)
 Test if a given node is black.
#define rn_isred(node)
 Test if a given node is red.
#define rn_isleft(node)
 Test if a given node is the left node of its parent.
#define rn_isright(node)
 Test if a given node is the right node of its parent.

Typedefs

typedef _db_key_s db_key_t
 Database key.
typedef _link_head_s link_head_t
 Linked list head.
typedef _link_elem_s link_elem_t
 Linked list element.
typedef _hash_table_s hash_table_t
 Hash table.
typedef _hash_entry_s hash_entry_t
 Hash table entry.
typedef _smat_table_s smat_table_t
 Sparse matrix table.
typedef _smat_head_s smat_head_t
 Sparse matrix list head.
typedef _smat_entry_s smat_entry_t
 Sparse matrix entry.
typedef _rb_tree_s rb_tree_t
 Red-black tree.
typedef _rb_node_s rb_node_t
 Red-black tree node.
typedef unsigned long(* link_iter_t )(link_head_t *list, link_elem_t *elem, void *extra)
 Linked list iteration callback.
typedef unsigned long(* link_comp_t )(db_key_t *key, void *obj)
 Linked list comparison callback.
typedef unsigned long(* hash_iter_t )(hash_table_t *table, hash_entry_t *ent, void *extra)
 Hash table iteration callback.
typedef unsigned long(* hash_func_t )(hash_table_t *table, db_key_t *key)
 Hash function callback.
typedef unsigned long(* hash_comp_t )(hash_table_t *table, db_key_t *key1, db_key_t *key2)
 Hash table comparison callback.
typedef unsigned long(* hash_resize_t )(hash_table_t *table, unsigned long new_mod)
 Hash table resize callback.
typedef unsigned long(* smat_resize_t )(smat_table_t *table, unsigned long new_mod)
 Sparse matrix table resize callback.
typedef unsigned long(* smat_iter_t )(smat_table_t *table, smat_entry_t *ent, void *extra)
 Sparse matrix iteration callback.
typedef unsigned long(* smat_comp_t )(db_key_t *key, smat_entry_t *ent)
 Sparse matrix comparison callback.
typedef unsigned long(* rb_iter_t )(rb_tree_t *tree, rb_node_t *node, void *extra)
 Red-black tree iteration callback.
typedef long(* rb_comp_t )(rb_tree_t *tree, db_key_t *key1, db_key_t *key2)
 Red-black tree comparison callback.
typedef enum _link_loc_e link_loc_t
 Linked list location.
typedef enum _smat_loc_e smat_loc_t
 Sparse matrix location.
typedef enum _rb_color_e rb_color_t
 Red-black tree node color.

Enumerations

enum  _link_loc_e { LINK_LOC_HEAD, LINK_LOC_TAIL, LINK_LOC_BEFORE, LINK_LOC_AFTER }
 Linked list location. More...
enum  _smat_loc_e { SMAT_LOC_FIRST, SMAT_LOC_SECOND }
 Sparse matrix location. More...
enum  _rb_color_e { RB_COLOR_NONE, RB_COLOR_RED, RB_COLOR_BLACK }
 Red-black tree node color. More...

Functions

unsigned long ll_init (link_head_t *list, void *extra)
 Dynamically initialize a linked list head.
unsigned long ll_add (link_head_t *list, link_elem_t *new, link_loc_t loc, link_elem_t *elem)
 Add an element to a linked list.
unsigned long ll_move (link_head_t *list, link_elem_t *elem, link_loc_t loc, link_elem_t *elem2)
 Move an element within a linked list.
unsigned long ll_remove (link_head_t *list, link_elem_t *elem)
 Remove an element from a linked list.
unsigned long ll_find (link_head_t *list, link_elem_t **elem_p, link_comp_t comp_func, link_elem_t *start, db_key_t *key)
 Find an element in a linked list.
unsigned long ll_iter (link_head_t *list, link_elem_t *start, link_iter_t iter_func, void *extra, unsigned long flags)
 Iterate over each entry in a linked list.
unsigned long ll_flush (link_head_t *list, link_iter_t flush_func, void *extra)
 Flush a linked list.
unsigned long le_init (link_elem_t *elem, void *object)
 Dynamically initialize a linked list element.
unsigned long hash_fnv1 (hash_table_t *table, db_key_t *key)
 FNV-1 hash function.
unsigned long hash_fnv1a (hash_table_t *table, db_key_t *key)
 FNV-1a hash function.
unsigned long hash_comp (hash_table_t *table, db_key_t *key1, db_key_t *key2)
 Hash comparison function.
unsigned long ht_init (hash_table_t *table, unsigned long flags, hash_func_t func, hash_comp_t comp, hash_resize_t resize, void *extra, unsigned long init_mod)
 Dynamically initialize a hash table.
unsigned long ht_add (hash_table_t *table, hash_entry_t *entry, db_key_t *key)
 Add an entry to a hash table.
unsigned long ht_move (hash_table_t *table, hash_entry_t *entry, db_key_t *key)
 Move an entry in the hash table.
unsigned long ht_remove (hash_table_t *table, hash_entry_t *entry)
 Remove an element from a hash table.
unsigned long ht_find (hash_table_t *table, hash_entry_t **entry_p, db_key_t *key)
 Find an entry in a hash table.
unsigned long ht_iter (hash_table_t *table, hash_iter_t iter_func, void *extra)
 Iterate over each entry in a hash table.
unsigned long ht_flush (hash_table_t *table, hash_iter_t flush_func, void *extra)
 Flush a hash table.
unsigned long ht_resize (hash_table_t *table, unsigned long new_size)
 Resize a hash table.
unsigned long ht_free (hash_table_t *table)
 Free memory used by an empty hash table.
unsigned long he_init (hash_entry_t *entry, void *value)
 Dynamically initialize a hash table entry.
unsigned long smat_cleanup (void)
 Clean up the smat free list.
unsigned long smat_freemem (void)
 Report how much memory is used by the free list.
unsigned long st_init (smat_table_t *table, unsigned long flags, smat_resize_t resize, void *extra, unsigned long init_mod)
 Dynamically initialize a sparse matrix table.
unsigned long st_add (smat_table_t *table, smat_entry_t **entry_p, smat_head_t *head1, link_loc_t loc1, smat_entry_t *ent1, smat_head_t *head2, link_loc_t loc2, smat_entry_t *ent2)
 Add an entry to a sparse matrix.
unsigned long st_remove (smat_table_t *table, smat_entry_t *entry)
 Remove an entry from a sparse matrix.
unsigned long st_find (smat_table_t *table, smat_entry_t **entry_p, smat_head_t *head1, smat_head_t *head2)
 Find an entry in a sparse matrix.
unsigned long st_iter (smat_table_t *table, smat_iter_t iter_func, void *extra)
 Iterate over each entry in a sparse matrix.
unsigned long st_flush (smat_table_t *table, smat_iter_t flush_func, void *extra)
 Flush a sparse matrix.
unsigned long st_resize (smat_table_t *table, unsigned long new_size)
 Resize a sparse matrix table.
unsigned long st_free (smat_table_t *table)
 Free memory used by an empty sparse matrix table.
unsigned long sh_init (smat_head_t *head, smat_loc_t elem, void *object)
 Dynamically initialize a sparse matrix row or column head.
unsigned long sh_move (smat_head_t *head, smat_entry_t *elem, link_loc_t loc, smat_entry_t *elem2)
 Move an entry within a row or column list.
unsigned long sh_find (smat_head_t *head, smat_entry_t **elem_p, smat_comp_t comp_func, smat_entry_t *start, db_key_t *key)
 Find an entry in a row or column of a sparse matrix.
unsigned long sh_iter (smat_head_t *head, smat_entry_t *start, smat_iter_t iter_func, void *extra, unsigned long flags)
 Iterate over each entry in a row or column of a sparse matrix.
unsigned long sh_flush (smat_head_t *head, smat_iter_t flush_func, void *extra)
 Flush a row or column of a sparse matrix.
long rbtree_comp (rb_tree_t *tree, db_key_t *key1, db_key_t *key2)
 Red-black tree comparison function.
unsigned long rt_init (rb_tree_t *tree, rb_comp_t comp, void *extra)
 Dynamically initialize a red-black tree.
unsigned long rt_add (rb_tree_t *tree, rb_node_t *node, db_key_t *key)
 Add a node to a red-black tree.
unsigned long rt_move (rb_tree_t *tree, rb_node_t *node, db_key_t *key)
 Move a node in a red-black tree.
unsigned long rt_remove (rb_tree_t *tree, rb_node_t *node)
 Remove a node from a red-black tree.
unsigned long rt_find (rb_tree_t *tree, rb_node_t **node_p, db_key_t *key)
 Find an entry in a red-black table.
unsigned long rt_next (rb_tree_t *tree, rb_node_t **node_io, unsigned long flags)
 Get the next node.
unsigned long rt_iter (rb_tree_t *tree, rb_node_t *start, rb_iter_t iter_func, void *extra, unsigned long flags)
 Iterate over each entry in a red-black tree.
unsigned long rt_flush (rb_tree_t *tree, rb_iter_t flush_func, void *extra)
 Flush a red-black tree.
unsigned long rn_init (rb_node_t *node, void *value)
 Dynamically initialize a red-black tree node.


Define Documentation

#define DBPRIM_BEGIN_C_DECLS
 

For internal use only.

This macro is defined to extern "C" { when compiling with a C++ compiler. See DBPRIM_END_C_DECLS.

Definition at line 236 of file dbprim.h.

#define DBPRIM_END_C_DECLS
 

For internal use only.

This macro is defined to } when compiling with a C++ compiler. See DBPRIM_BEGIN_C_DECLS.

Definition at line 237 of file dbprim.h.

#define HASH_FLAG_FREEZE
 

For internal use only.

This flag, if set on a hash table, indicates that the table is frozen and may not be modified.

Definition at line 1124 of file dbprim.h.

Referenced by ht_add(), ht_flush(), ht_free(), ht_iter(), ht_move(), ht_remove(), and ht_resize().

#define RBT_FLAG_FREEZE
 

For internal use only.

This flag, if set on a red-black tree, indicates that the tree is frozen and may not be modified.

Definition at line 2562 of file dbprim.h.

Referenced by rt_add(), rt_flush(), rt_iter(), rt_move(), and rt_remove().


Generated on Sat Jul 15 14:10:35 2006 for DatabasePrimitivesLibrary by  doxygen 1.4.4