aboutsummaryrefslogtreecommitdiff
path: root/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'list.h')
-rw-r--r--list.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/list.h b/list.h
index 6eb17e9..949677c 100644
--- a/list.h
+++ b/list.h
@@ -20,6 +20,7 @@
size_t len; \
} T##List; \
void T##List_init(T##List *self); \
+ T##List T##List_create(); \
void T##List_free(T##List *self); \
T##List T##List_move(T##List *self); \
T##ListIter T##List_insert_before(T##List *self, T##ListIter iter, T val); \
@@ -48,6 +49,11 @@ LIST_DEF(Int);
self->vtail->prev = self->vhead; \
self->len = 0; \
} \
+ T##List T##List_create() { \
+ T##List self; \
+ T##List_init(&self); \
+ return self; \
+ } \
void T##List_free(T##List *self) { \
T##ListIter cur = self->vhead; \
while (cur != NULL) { \