summaryrefslogtreecommitdiff
path: root/src/struct.h
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-01-04 18:11:00 -0500
committerAdrian Thurston <thurston@complang.org>2015-01-04 18:11:00 -0500
commit4accc36ee55e6ce863ec2e1940ca84b776442e1f (patch)
tree8abc854db7a25b7d14fee377a1b63e44a82fe6eb /src/struct.h
parentfab48262c6e559f1f6aabff0868cb41bfdb296bf (diff)
downloadcolm-4accc36ee55e6ce863ec2e1940ca84b776442e1f.tar.gz
work on using embedded list element pointers
Diffstat (limited to 'src/struct.h')
-rw-r--r--src/struct.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/struct.h b/src/struct.h
index 16161eed..47c7b0ce 100644
--- a/src/struct.h
+++ b/src/struct.h
@@ -52,16 +52,8 @@ typedef struct colm_stream
StreamImpl *impl;
} Stream;
-/* Must overlay colm_inbuilt. */
typedef struct colm_list_el
{
- short id;
- struct colm_struct *prev, *next;
-// colm_destructor_t destructor;
-//
-// void *buffer[8];
-//
- Tree *value;
struct colm_list_el *list_next;
struct colm_list_el *list_prev;
} ListEl;
@@ -107,6 +99,7 @@ typedef struct colm_map
GenericInfo *genericInfo;
} Map;
+struct colm_struct *colm_struct_new_size( struct colm_program *prg, int size );
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 );
@@ -117,6 +110,9 @@ struct colm_struct *colm_struct_inbuilt( struct colm_program *prg, int size,
#define colm_struct_get_field( obj, field ) \
((struct colm_tree**)(((struct colm_struct*)obj)+1))[field]
+#define colm_struct_get_addr( obj, field ) \
+ &(((struct colm_tree**)(((struct colm_struct*)obj)+1))[field])
+
#define colm_struct_set_field( obj, field, val ) \
((struct colm_tree**)(((struct colm_struct*)obj)+1))[field] = val