diff options
author | kartofen <mladenovnasko0@gmail.com> | 2024-09-08 20:02:06 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2024-09-08 20:02:06 +0300 |
commit | f60047d4b013eb7f75ad4f5c63eda63153a4bf8e (patch) | |
tree | 2a3e9fd5fc1eb07b7e06797f74f5e7a31c313159 /src/value.h | |
parent | 4308cd4abe5a75fb8410df929eac687cbd04032b (diff) |
value is now opaque
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/value.h b/src/value.h index 264e083..f5f66d3 100644 --- a/src/value.h +++ b/src/value.h @@ -57,6 +57,21 @@ struct value { size_t refs; }; +#define vvalue_type(v) ((v)->type) +#define vvalue_refs(v) ((v)->refs) + +#define vvalue_atom(v) ((v)->value.atom) +#define vvalue_str(v) ((v)->value.str) +#define vvalue_num(v) ((v)->value.num) +#define vvalue_cons(v) ((v)->value.cons) +#define vvalue_proc(v) ((v)->value.proc) +#define vvalue_proc_builtin(v) ((v)->value.proc_builtin) + +#define value_set_type(v, type) (vvalue_type(v) = type) +#define value_set_refs(v, refs) (vvalue_refs(v) = refs) +#define value_inc_refs(v) (++vvalue_refs(v)) +#define value_dec_refs(v) (--vvalue_refs(v)) + value_t value_create(enum value_type type, void * value); void value_destroy(value_t value); |