From: Stefan Monnier Date: Sun, 7 Jul 2002 20:52:08 +0000 (+0000) Subject: (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX) X-Git-Tag: ttn-vms-21-2-B4~14268 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=141788b50c5c2d01ef3607885224d474be6bd138;p=emacs.git (HASH_KEY, HASH_VALUE, HASH_NEXT, HASH_HASH, HASH_INDEX) (HASH_TABLE_SIZE): Move from fns.c. --- diff --git a/src/lisp.h b/src/lisp.h index 6ae8a8d016b..dc38857e85e 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1025,6 +1025,32 @@ struct Lisp_Hash_Table } \ while (0) +/* Value is the key part of entry IDX in hash table H. */ + +#define HASH_KEY(H, IDX) AREF ((H)->key_and_value, 2 * (IDX)) + +/* Value is the value part of entry IDX in hash table H. */ + +#define HASH_VALUE(H, IDX) AREF ((H)->key_and_value, 2 * (IDX) + 1) + +/* Value is the index of the next entry following the one at IDX + in hash table H. */ + +#define HASH_NEXT(H, IDX) AREF ((H)->next, (IDX)) + +/* Value is the hash code computed for entry IDX in hash table H. */ + +#define HASH_HASH(H, IDX) AREF ((H)->hash, (IDX)) + +/* Value is the index of the element in hash table H that is the + start of the collision list at index IDX in the index vector of H. */ + +#define HASH_INDEX(H, IDX) AREF ((H)->index, (IDX)) + +/* Value is the size of hash table H. */ + +#define HASH_TABLE_SIZE(H) XVECTOR ((H)->next)->size + /* Default size for hash tables if not specified. */ #define DEFAULT_HASH_SIZE 65