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

dbprim_int.h

Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 2002, 2006 by Kevin L. Mitchell <klmitch@mit.edu>
00003 **
00004 ** This library is free software; you can redistribute it and/or
00005 ** modify it under the terms of the GNU Library General Public
00006 ** License as published by the Free Software Foundation; either
00007 ** version 2 of the License, or (at your option) any later version.
00008 **
00009 ** This library is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 ** Library General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU Library General Public
00015 ** License along with this library; if not, write to the Free
00016 ** Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00017 ** MA 02111-1307, USA
00018 **
00019 ** @(#)$Id: dbprim_int.h,v 1.7 2006/07/15 18:06:18 klmitch Exp $
00020 */
00028 #ifndef __include_dbprim_int_h__
00029 #define __include_dbprim_int_h__
00030 
00031 #include "dbprim_err.h"
00032 #include "dbprim_version.h"
00033 
00034 #ifndef DBPRIM_DOXYGEN
00035 # ifdef __GNUC__
00036 #  if (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
00037 #   define __attribute__(A)
00038 #  endif
00039 # else
00040 #  define __attribute__(A)
00041 # endif
00042 #endif /* DBPRIM_DOXYGEN */
00043 
00050 #define RCSTAG(tag) static char rcsid[] __attribute__((unused)) = tag
00051 
00065 unsigned long _hash_prime(unsigned long start);
00066 
00079 #define _hash_rollover(mod)     (((mod) * 4) / 3)
00080 
00093 #define _hash_rollunder(mod)    (((mod) * 3) / 4)
00094 
00107 #define _hash_fuzz(mod)         (((mod) * 4) / 3)
00108 
00117 #define HASH_FNV_OFFSET         2166136261UL
00118 
00127 #define HASH_FNV_PRIME          16777619UL
00128 
00154 unsigned long _st_remove(smat_table_t *table, smat_entry_t *entry,
00155                          unsigned int remflag);
00156 
00165 #define ST_REM_FIRST    0x0001  /* remove from first list */
00166 
00175 #define ST_REM_SECOND   0x0002  /* remove from second list */
00176 
00184 #define ST_REM_HASH     0x0004  /* remove from hash table */
00185 
00193 #define ST_REM_FREE     0x0008  /* free the entry */
00194 
00207 smat_entry_t *_smat_alloc(void);
00208 
00220 void _smat_free(smat_entry_t *entry);
00221 
00235 unsigned long _smat_resize(hash_table_t *table, unsigned long new_mod);
00236 
00256 rb_node_t *_rb_locate(rb_tree_t *tree, rb_node_t *node, db_key_t *key);
00257 
00269 void _rb_rotate(rb_tree_t *tree, rb_node_t *child);
00270 
00271 #endif /* __include_dbprim_int_h__ */

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