diff options
-rw-r--r-- | dive.c | 14 | ||||
-rw-r--r-- | dive.h | 1 |
2 files changed, 15 insertions, 0 deletions
@@ -145,6 +145,20 @@ void update_event_name(struct dive *d, struct event *event, char *name) free(remove); } +void add_extra_data(struct divecomputer *dc, const char *key, const char *value) +{ + struct extra_data **ed = &dc->extra_data; + + while (*ed) + ed = &(*ed)->next; + *ed = malloc(sizeof(struct extra_data)); + if (*ed) { + (*ed)->key = strdup(key); + (*ed)->value = strdup(value); + (*ed)->next = NULL; + } +} + /* this returns a pointer to static variable - so use it right away after calling */ struct gasmix *get_gasmix_from_event(struct event *ev) { @@ -690,6 +690,7 @@ extern void add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int extern struct event *add_event(struct divecomputer *dc, int time, int type, int flags, int value, const char *name); extern void remove_event(struct event *event); extern void update_event_name(struct dive *d, struct event* event, char *name); +extern void add_extra_data(struct divecomputer *dc, const char *key, const char *value); extern void per_cylinder_mean_depth(struct dive *dive, struct divecomputer *dc, int *mean, int *duration); extern int get_cylinder_index(struct dive *dive, struct event *ev); extern int nr_cylinders(struct dive *dive); |