summaryrefslogtreecommitdiff
path: root/src/struct.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/struct.h')
-rw-r--r--src/struct.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/struct.h b/src/struct.h
index 392cd9f2..a5e49cb6 100644
--- a/src/struct.h
+++ b/src/struct.h
@@ -6,10 +6,17 @@ void colm_struct_delete( struct colm_program *prg, struct colm_tree **sp,
struct colm_struct *colm_struct_inbuilt( Program *prg, int size, void *destructor );
-#define colm_struct_get_field(obj, field) \
+#define colm_struct_get_field( obj, field ) \
((struct colm_tree**)(((struct colm_struct*)obj)+1))[field]
-#define colm_struct_set_field(obj, field, val) \
+#define colm_struct_set_field( obj, field, val ) \
((struct colm_tree**)(((struct colm_struct*)obj)+1))[field] = val
+#define colm_struct_get_field_type( obj, type, field ) \
+ ((type*)(((struct colm_struct*)obj)+1))[field]
+
+#define colm_struct_set_field_type( obj, type, field, val ) \
+ ((type*)(((struct colm_struct*)obj)+1))[field] = val
+
+
#endif