mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: redo eventname handling
The eventname handling code was splattered all over the place. Collect it in a single source file and use C++ idioms to avoid nasty memory management. Provide a C-only interface, however. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ab7b9329c0
commit
0d3c9954f4
10 changed files with 94 additions and 70 deletions
11
core/event.h
11
core/event.h
|
|
@ -39,15 +39,6 @@ struct event {
|
|||
char name[];
|
||||
};
|
||||
|
||||
struct ev_select {
|
||||
char *ev_name;
|
||||
bool plot_ev;
|
||||
};
|
||||
|
||||
/* collect all event names and whether we display them */
|
||||
extern struct ev_select *ev_namelist;
|
||||
extern int evn_used;
|
||||
|
||||
extern int event_is_gaschange(const struct event *ev);
|
||||
extern bool event_is_divemodechange(const struct event *ev);
|
||||
extern struct event *clone_event(const struct event *src_ev);
|
||||
|
|
@ -55,8 +46,6 @@ extern void free_events(struct event *ev);
|
|||
extern struct event *create_event(unsigned int time, int type, int flags, int value, const char *name);
|
||||
extern struct event *clone_event_rename(const struct event *ev, const char *name);
|
||||
extern bool same_event(const struct event *a, const struct event *b);
|
||||
extern void remember_event(const char *eventname);
|
||||
extern void clear_events(void);
|
||||
|
||||
/* Since C doesn't have parameter-based overloading, two versions of get_next_event. */
|
||||
extern const struct event *get_next_event(const struct event *event, const char *name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue