summaryrefslogtreecommitdiff
path: root/uscript/val.h
diff options
context:
space:
mode:
Diffstat (limited to 'uscript/val.h')
-rw-r--r--uscript/val.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/uscript/val.h b/uscript/val.h
index 5140fc2..8ea91dd 100644
--- a/uscript/val.h
+++ b/uscript/val.h
@@ -28,6 +28,10 @@
#define proto_add_byte(func, op) da_append(u8, &(func)->bytecode, op)
+#define cfunc_add_upval(c, v) da_append(struct us_val, &c->upvals, v)
+#define cfunc_set_upval(c, i, v) (c->upvals[i] = (v))
+#define cfunc_get_upval(c, i) (c->upvals[i])
+
enum val_type {
VAL_NUM,
VAL_BOOL,
@@ -90,6 +94,7 @@ struct us_cfunc {
struct us_obj header;
us_cfunc_sig c;
const struct us_str *name;
+ struct us_val *upvals;
int argc;
};