X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=dive.h;h=82b336e5356cadaaf447060ec1d7c51d756e3956;hb=c24fd4b82cf4476c6d9c863ee03f2d729b64e5f0;hp=c6c545dcc11e133a748113f8529fce9a5128aeb6;hpb=b176daf6d6d169bfa9b811687bd7696b1bb6063f;p=ext%2Fsubsurface.git diff --git a/dive.h b/dive.h index c6c545d..82b336e 100644 --- a/dive.h +++ b/dive.h @@ -4,6 +4,8 @@ #include #include +#include + /* * Some silly typedefs to make our units very explicit. * @@ -75,11 +77,13 @@ typedef struct { typedef struct { volume_t size; pressure_t workingpressure; + const char *description; /* "LP85", "AL72", "AL80", "HP100+" or whatever */ } cylinder_type_t; typedef struct { cylinder_type_t type; gasmix_t gasmix; + pressure_t start, end; } cylinder_t; static inline int to_feet(depth_t depth) @@ -107,10 +111,9 @@ struct sample { int cylinderindex; }; -#define MAX_CYLINDERS (4) +#define MAX_CYLINDERS (8) struct dive { - const char *name; time_t when; char *location; char *notes; @@ -118,7 +121,6 @@ struct dive { duration_t duration, surfacetime; depth_t visibility; temperature_t airtemp, watertemp; - pressure_t beginning_pressure, end_pressure; cylinder_t cylinder[MAX_CYLINDERS]; int samples; struct sample sample[]; @@ -141,7 +143,7 @@ static inline struct dive *get_dive(unsigned int nr) } extern void parse_xml_init(void); -extern void parse_xml_file(const char *filename); +extern void parse_xml_file(const char *filename, GError **error); extern void flush_dive_info_changes(void); extern void save_dives(const char *filename); @@ -154,4 +156,6 @@ static inline unsigned int dive_size(int samples) extern struct dive *fixup_dive(struct dive *dive); extern struct dive *try_to_merge(struct dive *a, struct dive *b); +#define DIVE_ERROR_PARSE 1 + #endif /* DIVE_H */