diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-03-12 21:52:30 -0300 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-07-02 19:03:35 -0300 |
commit | 7d5dbf4a19ec6bbd36784f5d7307629b69dda873 (patch) | |
tree | 928645a70c029395f3735bbb2afd8e4cacafebc5 /lisp/internal.h | |
parent | 2f7992eaefb19f23c127e15624ba38208c03439b (diff) |
Add a generic hash table interface to replace the other implementations.
Diffstat (limited to 'lisp/internal.h')
-rw-r--r-- | lisp/internal.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/internal.h b/lisp/internal.h index b00db3e..2ca4991 100644 --- a/lisp/internal.h +++ b/lisp/internal.h @@ -39,6 +39,8 @@ #include "mp.h" #include "re.h" +#include "util.h" + /* * Defines */ @@ -110,14 +112,14 @@ typedef struct _LispMac LispMac; #define UPROTECT(key, list) LispUProtect(key, list) /* create a new unique static atom string */ -#define GETATOMID(string) LispGetAtomString(string, 1) +#define GETATOMID(string) LispGetAtomKey(string, 1) #define GCDisable() ++gcpro #define GCEnable() --gcpro /* pointer to something unique to all atoms with the same print representation */ -#define ATOMID(object) (object)->data.atom->string +#define ATOMID(object) (object)->data.atom->key @@ -432,7 +434,7 @@ typedef struct _LispMac LispMac; #define LispFileno(file) ((file)->descriptor) -#define STRFUN(builtin) ATOMID(builtin->symbol) +#define STRFUN(builtin) ATOMID(builtin->symbol)->value #define STROBJ(obj) LispStrObj(obj) /* fetch builtin function/macro argument value @@ -457,9 +459,9 @@ typedef struct _LispMac LispMac; #define ERROR_CHECK_SPECIAL_FORM(atom) \ - if (atom->property->fun.builtin->compile) \ + if ((atom)->property->fun.builtin->compile) \ LispDestroy("%s: the special form %s cannot be redefined", \ - STRFUN(builtin), atom->string) + STRFUN(builtin), (atom)->key->value) @@ -489,7 +491,7 @@ typedef struct _LispHashTable LispHashTable; /* Bytecode compiler data */ typedef struct _LispCom LispCom; -typedef char *Atom_id; +typedef hash_key *Atom_id; typedef enum _LispType { /* objects encoded in the LispObj pointer */ |