diff options
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,22 @@ +#include "match.h" + +#include <stdlib.h> + +struct leg *leg_init(int points, char *name) +{ + struct leg *l = calloc(1, sizeof(*l)); + l->name = name; + l->start = l->rem = points; + l->visits = calloc(1000, sizeof(*(l->visits))); // FIXME + + return l; +} + +void leg_free(struct leg *l) +{ + for (int i = 0; i < l->n_visits; ++i) + if (l->visits[i].darts) + free(l->visits[i].darts); + free(l->visits); + free(l); +} |