00001
00002
00003
00004
00005
00006 #include "copyright.h"
00007
00008 #ifndef __HTAB_H
00009 #define __HTAB_H
00010
00011 #include "db.h"
00012 #include "svdhash.h"
00013
00014 typedef struct name_table NAMETAB;
00015 struct name_table
00016 {
00017 char *name;
00018 int minlen;
00019 int perm;
00020 int flag;
00021 };
00022
00023
00024
00025 typedef struct bque BQUE;
00026 struct bque
00027 {
00028 CLinearTimeAbsolute waittime;
00029 dbref executor;
00030 dbref caller;
00031 dbref enactor;
00032 dbref sem;
00033 int attr;
00034 int nargs;
00035 char *text;
00036 char *comm;
00037 char *env[NUM_ENV_VARS];
00038 char *scr[MAX_GLOBAL_REGS];
00039 bool IsTimed;
00040 };
00041
00042 class CBitField
00043 {
00044 unsigned int nBitsPer;
00045 unsigned int nShift;
00046 unsigned int nMask;
00047 unsigned int nMaximum;
00048 size_t nInts;
00049 UINT32 *pInts;
00050 UINT32 *pMasks;
00051
00052 public:
00053 CBitField(unsigned int max = 0);
00054 void Resize(unsigned int max);
00055 ~CBitField(void);
00056 void ClearAll(void);
00057 void Set(unsigned int i);
00058 void Clear(unsigned int i);
00059 bool IsSet(unsigned int i);
00060 };
00061
00062 void hashreset(CHashTable *);
00063 void *hashfindLEN(const void *pKey, size_t nKey, CHashTable *htab);
00064 int hashaddLEN(const void *pKey, size_t nKey, void *pData,
00065 CHashTable *htab);
00066 void hashdeleteLEN(const void *Str, size_t nStr, CHashTable *htab);
00067 void hashflush(CHashTable *);
00068 bool hashreplLEN(const void *Str, size_t nStr, void *hashdata,
00069 CHashTable *htab);
00070 void hashreplall(const void *, void *, CHashTable *);
00071 void *hash_nextentry(CHashTable *htab);
00072 void *hash_firstentry(CHashTable *htab);
00073 void *hash_firstkey(CHashTable *htab, int *, char **);
00074 void *hash_nextkey(CHashTable *htab, int *, char **);
00075
00076 extern NAMETAB powers_nametab[];
00077
00078 extern bool search_nametab(dbref, NAMETAB *, char *, int *);
00079 extern NAMETAB *find_nametab_ent(dbref, NAMETAB *, char *);
00080 extern void display_nametab(dbref, NAMETAB *, char *, bool);
00081 extern void interp_nametab(dbref, NAMETAB *, int, const char *, const char *, const char *);
00082 extern void listset_nametab(dbref, NAMETAB *, int, char *, bool);
00083
00084 #endif // !__HTAB_H