Reader
This commit is contained in:
26
src/hashtable.h
Normal file
26
src/hashtable.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef INCLUDED_HASHTABLE_H
|
||||
#define INCLUDED_HASHTABLE_H
|
||||
|
||||
#include "base.h"
|
||||
|
||||
struct HashTableBucket {
|
||||
uintptr_t hash;
|
||||
LispVal *key;
|
||||
LispVal *value;
|
||||
};
|
||||
|
||||
DEFOBJTYPE(HashTable, HASH_TABLE, HASH_TABLE_P, {
|
||||
LispVal *hash_fn;
|
||||
LispVal *eq_fn;
|
||||
struct HashTableBucket *data;
|
||||
size_t size;
|
||||
size_t count;
|
||||
});
|
||||
|
||||
DECLARE_FUNCTION(make_hash_table, (LispVal * hash_fn, LispVal *eq_fn));
|
||||
DECLARE_FUNCTION(gethash, (LispVal * ht, LispVal *key, LispVal *def));
|
||||
DECLARE_FUNCTION(puthash, (LispVal * ht, LispVal *key, LispVal *val));
|
||||
DECLARE_FUNCTION(remhash, (LispVal * ht, LispVal *key));
|
||||
DECLARE_FUNCTION(hash_table_count, (LispVal * ht));
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user