summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-18 05:39:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-18 05:39:48 -0700
commitb25e08a3328ffa4bf29a8a8651973d88ae79b90c (patch)
tree859aba874523d6e0598198ff285337e2c813b8b7 /struct.c
parent8656383c44f2080e59c526ff3b7fb7ac4c2301a9 (diff)
downloadtxr-b25e08a3328ffa4bf29a8a8651973d88ae79b90c.tar.gz
txr-b25e08a3328ffa4bf29a8a8651973d88ae79b90c.tar.bz2
txr-b25e08a3328ffa4bf29a8a8651973d88ae79b90c.zip
New function to access slot list of struct type.
* struct.c (slots): New function. * struct.h (slots): Declared.
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/struct.c b/struct.c
index 559dbb0e..54631098 100644
--- a/struct.c
+++ b/struct.c
@@ -1085,6 +1085,12 @@ val static_slot_p(val type, val sym)
return nil;
}
+val slots(val stype)
+{
+ struct struct_type *st = stype_handle(&stype, lit("static-slot-p"));
+ return st->slots;
+}
+
val structp(val obj)
{
return tnil(cobjp(obj) && obj->co.ops == &struct_inst_ops);