From 177d2c7098b052dc399a85ab630ad3d07df51727 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 10 Oct 2013 17:05:58 +0900 Subject: [PATCH] add pic_obj_value function --- include/picrin/value.h | 2 ++ src/value.c | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/value.c diff --git a/include/picrin/value.h b/include/picrin/value.h index 410f2b06..0ee56e30 100644 --- a/include/picrin/value.h +++ b/include/picrin/value.h @@ -35,4 +35,6 @@ struct pic_symbol { char *name; }; +pic_value pic_obj_value(struct pic_object *obj); + #endif diff --git a/src/value.c b/src/value.c new file mode 100644 index 00000000..778d2bc9 --- /dev/null +++ b/src/value.c @@ -0,0 +1,11 @@ +#include "picrin.h" + +pic_value +pic_obj_value(struct pic_object *obj) +{ + pic_value v; + + v.vtype = PIC_VTYPE_HEAP; + v.u.data = obj; + return v; +}