From 2417a54675011885c699dbe8a77a427effcb26c5 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 3 Mar 2020 20:03:56 +0100 Subject: core: split add_event() in two parts add_event() creates and adds an event from the given parameters. For undo, we want to do these separately, therefore split this function in two parts: create_event() and add_event_to_dc(). Keep the add_event() function for convenience. Moreover, keep the remember_event() call in there, so that undo-commands can call remember_event() once, not on every undo/redo action. Signed-off-by: Berthold Stoeger --- core/dive.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/dive.h') diff --git a/core/dive.h b/core/dive.h index 76eccb5e8..5bbce4b00 100644 --- a/core/dive.h +++ b/core/dive.h @@ -377,6 +377,8 @@ extern void copy_samples(const struct divecomputer *s, struct divecomputer *d); extern bool is_cylinder_used(const struct dive *dive, int idx); extern bool is_cylinder_prot(const struct dive *dive, int idx); extern void add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int time, int idx); +extern struct event *create_event(unsigned int time, int type, int flags, int value, const char *name); +extern void add_event_to_dc(struct divecomputer *dc, struct event *ev); extern struct event *add_event(struct divecomputer *dc, unsigned 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, const char *name); -- cgit v1.2.3-70-g09d2