|
|
|
@@ -151,6 +151,8 @@ DefineList(string, String); |
|
|
|
#define __ArrayAsList(array) { .data=(array), .length=ArrayCount(array), .capacity=ArrayCount(array) } |
|
|
|
#define AsList(listtype, ...) (listtype)__ArrayAsList(((listtype##_underlying[])__VA_ARGS__)) |
|
|
|
|
|
|
|
// TODO(dledda): clone list |
|
|
|
// TODO(dledda): list back element accessor |
|
|
|
#define AppendList(list, element) \ |
|
|
|
if ((list)->length < (list)->capacity) { \ |
|
|
|
(list)->data[(list)->length++] = (element); \ |
|
|
|
|