src/rbtab.h

Go to the documentation of this file.
00001 
00002 /* htab.h - Structures and declarations needed for table hashing */
00003 
00004 /* $Id: htab.h,v 1.3 2005/08/08 09:43:07 murrayma Exp $ */
00005 
00006 #include "copyright.h"
00007 
00008 #ifndef __HTAB_H
00009 #define __HTAB_H
00010 
00011 #include "config.h"
00012 #include "db.h"
00013 #include "rbtree.h"
00014 #include "nametab.h"
00015 
00016 struct rbtable {
00017     long long checks, scans, max_scan, hits, entries, deletes, nulls;
00018     rbtree tree;
00019     void *last;
00020 };
00021 typedef struct rbtable HASHTAB;
00022 typedef struct rbtable RBTAB;
00023 typedef struct rbtable NHSHTAB;
00024 
00025 void hashinit(RBTAB *, int);
00026 
00027 void hashreset(RBTAB *);
00028 
00029 int hashval(char *, int);
00030 int get_hashmask(void *);
00031 void *hashfind(char *, RBTAB *);
00032 int hashadd(char *, void *, RBTAB *);
00033 void hashdelete(char *, RBTAB *);
00034 void hashflush(RBTAB *, int);
00035 int hashrepl(char *, void *, RBTAB *);
00036 void hashreplall(void *, void *, RBTAB *);
00037 char *hashinfo(const char *, RBTAB *);
00038 int search_nametab(dbref, NAMETAB *, char *);
00039 NAMETAB *find_nametab_ent(dbref, NAMETAB *, char *);
00040 void display_nametab(dbref, NAMETAB *, char *, int);
00041 void interp_nametab(dbref, NAMETAB *, int, char *, char *, char *);
00042 void listset_nametab(dbref, NAMETAB *, int, char *, int);
00043 void *hash_nextentry(RBTAB * htab);
00044 void *hash_firstentry(RBTAB * htab);
00045 char *hash_firstkey(RBTAB * htab);
00046 char *hash_nextkey(RBTAB * htab);
00047 
00048 void nhashinit(RBTAB *, int);
00049 void nhashreset(RBTAB *);
00050 void *nhash_nextentry(RBTAB * htab);
00051 void *nhash_firstentry(RBTAB * htab);
00052 char *nhashinfo(const char *, RBTAB *);
00053 void *nhashfind(int, RBTAB *);
00054 int nhashadd(int, void *, RBTAB *);
00055 void nhashdelete(int, RBTAB *);
00056 void nhashflush(RBTAB *, int);
00057 int nhashrepl(int, void *, RBTAB *);
00058 extern NAMETAB powers_nametab[];
00059 #endif

Generated on Mon May 28 04:25:25 2007 for BattletechMUX by  doxygen 1.4.7