aboutsummaryrefslogtreecommitdiff
path: root/src/value.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/value.h')
-rw-r--r--src/value.h15
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);