summaryrefslogtreecommitdiff
path: root/src/struct.h
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2014-12-25 18:07:59 -0500
committerAdrian Thurston <thurston@complang.org>2014-12-25 18:07:59 -0500
commitd8addd5e8f81d57d7f3746562c7a0fbed67111a7 (patch)
tree165b93961a6ad4d69c9d63319e346cae8c65fd96 /src/struct.h
parentc2049c9de73d3416a1d0f3a51f8fa04be65be6c8 (diff)
downloadcolm-d8addd5e8f81d57d7f3746562c7a0fbed67111a7.tar.gz
more function cleanup in struct fields
Diffstat (limited to 'src/struct.h')
-rw-r--r--src/struct.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/struct.h b/src/struct.h
index 1f5d87b6..a973b9ac 100644
--- a/src/struct.h
+++ b/src/struct.h
@@ -1,10 +1,13 @@
#ifndef _COLM_STRUCT_H
-#define colm_struct_val(obj, field) \
+struct colm_struct *colm_struct_new( struct colm_program *prg, int id );
+void colm_struct_delete( struct colm_program *prg, struct colm_tree **sp,
+ struct colm_struct *el );
+
+#define colm_struct_get_field(obj, field) \
((struct colm_tree**)(((struct colm_struct*)obj)+1))[field]
-struct colm_struct *colm_new_struct( struct colm_program *prg, int id );
-void colm_delete_struct( struct colm_program *prg, struct colm_tree **sp,
- struct colm_struct *el );
+#define colm_struct_set_field(obj, field, val) \
+ ((struct colm_tree**)(((struct colm_struct*)obj)+1))[field] = val
#endif