1.1 --- a/templates/progops.c Sun Oct 30 22:33:22 2016 +0100
1.2 +++ b/templates/progops.c Mon Oct 31 18:26:36 2016 +0100
1.3 @@ -21,6 +21,23 @@
1.4 return self;
1.5 }
1.6
1.7 +/* Generic internal data allocation. */
1.8 +
1.9 +__attr __newdata(__attr args[], unsigned int number)
1.10 +{
1.11 + __fragment *data = calloc(sizeof(__attr), number);
1.12 + __attr attr = {0, .data=data};
1.13 + unsigned int i, j;
1.14 +
1.15 + /* Copy the given number of values, starting from the second element. */
1.16 +
1.17 + for (i = 1, j = 0; i <= number; i++, j++)
1.18 + data->attrs[j] = args[i];
1.19 +
1.20 + data->size = number;
1.21 + return attr;
1.22 +}
1.23 +
1.24 /* Generic invocation operations. */
1.25
1.26 /* Invoke the given callable, supplying keyword argument details in the given