sourcepawn/compiler/sp_symhash.h
author Asher Baker <asherkin@gmail.com>
Sun Jul 29 02:51:50 2012 +0100 (2012-07-29)
changeset 3590 6908e80a69af
parent 3075 a86a7061c44c
permissions -rw-r--r--
Added some useful IDA scripts (NPOTB).
     1 /* vim: set ts=4 sw=4 tw=99 et: */
     2 #ifndef _INCLUDE_SPCOMP_SYMHASH_H_
     3 #define _INCLUDE_SPCOMP_SYMHASH_H_
     4 
     5 SC_FUNC uint32_t NameHash(const char *str);
     6 
     7 typedef struct HashEntry {
     8     symbol *sym;
     9     struct HashEntry *next;
    10 } HashEntry;
    11 
    12 struct HashTable {
    13     uint32_t nbuckets;
    14     uint32_t nused;
    15     uint32_t bucketmask;
    16     HashEntry **buckets;
    17 };
    18 
    19 SC_FUNC HashTable *NewHashTable();
    20 SC_FUNC void DestroyHashTable(HashTable *ht);
    21 SC_FUNC void AddToHashTable(HashTable *ht, symbol *sym);
    22 SC_FUNC void RemoveFromHashTable(HashTable *ht, symbol *sym);
    23 SC_FUNC symbol *FindInHashTable(HashTable *ht, const char *name, int fnumber);
    24 SC_FUNC symbol *FindTaggedInHashTable(HashTable *ht, const char *name, int fnumber,
    25                                       int *cmptag);
    26 
    27 #endif /* _INCLUDE_SPCOMP_SYMHASH_H_ */
    28