diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2014-05-17 12:37:09 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2014-05-17 12:37:09 +0300 |
| commit | 2836fa60045bcdd8c1c8c5ed775d711cc7f385a9 (patch) | |
| tree | 7892216d6ae7f0c51bd6c147dadc0bb88f06070c /env.h | |
| parent | 6814f6b99562620e70538787b6f8d66c80f7b990 (diff) | |
| download | lispish-2836fa60045bcdd8c1c8c5ed775d711cc7f385a9.tar.gz lispish-2836fa60045bcdd8c1c8c5ed775d711cc7f385a9.zip | |
refactor code to use LIST from sys/queue.h
It's now easier and more natural to work with the code. :-P
Diffstat (limited to 'env.h')
| -rw-r--r-- | env.h | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -1,16 +1,19 @@ #ifndef ENV_H #define ENV_H -struct list; +#include <sys/queue.h> + +struct kv; +LIST_HEAD(env, kv); + struct atom; -struct list *env_new(); -struct atom *env_lookup(struct list *env, const char *symbol); -struct list *env_extend(struct list *env, int count, ...); //const char *symbol, struct atom *value -// struct list *env_extend_env(struct list *enva, struct list *envb); -int env_set(struct list *env, const char *symbol, +struct env *env_new(); +struct atom *env_lookup(struct env *env, const char *symbol); +struct env *env_extend(struct env *env, int count, ...); +int env_set(struct env *env, const char *symbol, struct atom *value); -void env_free(struct list *env); -struct list *env_clone(struct list *env); +void env_free(struct env *env); +struct env *env_clone(struct env *env); #endif |
