Add a picture_list struct

Add a picture_list struct that will hold all the pictures relative to a
dive. Before we used to hold events for the pictures, but an event is a
much bigger struct so this will save a bit of memory, and we will also
stop to use magic flags and special treatment for pictures on the dive
profile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-06-02 16:40:31 -03:00 committed by Dirk Hohndel
parent eb9d6d0f94
commit 8e2ed59c83

8
dive.h
View file

@ -81,6 +81,13 @@ struct event {
char name[];
};
/* picture list and methods related to dive picture handling */
struct picture_list{
char *filename;
time_t timestamp;
struct picture_list *next;
};
extern int get_pressure_units(int mb, const char **units);
extern double get_depth_units(int mm, int *frac, const char **units);
extern double get_volume_units(unsigned int ml, int *frac, const char **units);
@ -278,6 +285,7 @@ struct dive {
struct tag_entry *tag_list;
struct divecomputer dc;
int id; // unique ID for this dive
struct picture_list *picture_list;
};
static inline int dive_has_gps_location(struct dive *dive)