diff options
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/parse-xml.c b/parse-xml.c index fe13f66f2..bd6e21bec 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -49,9 +49,19 @@ int trimspace(char *buffer) { } /* + * Clear a dive_table + */ +void clear_table(struct dive_table *table) +{ + for (int i = 0; i < table->nr; i++) + free(table->dives[i]); + table->nr = 0; +} + +/* * Add a dive into the dive_table array */ -static void record_dive_to_table(struct dive *dive, struct dive_table *table) +void record_dive_to_table(struct dive *dive, struct dive_table *table) { assert(table != NULL); int nr = table->nr, allocated = table->allocated; |