+static inline unsigned int dive_size(int samples)
+{
+ return sizeof(struct dive) + samples*sizeof(struct sample);
+}
+
+extern time_t utc_mktime(struct tm *tm);
+
+extern struct dive *alloc_dive(void);
+extern void record_dive(struct dive *dive);
+
+extern struct sample *prepare_sample(struct dive **divep);
+extern void finish_sample(struct dive *dive);
+
+extern void report_dives(gboolean imported);
+extern struct dive *fixup_dive(struct dive *dive);
+extern struct dive *try_to_merge(struct dive *a, struct dive *b);
+
+extern void renumber_dives(int nr);
+
+extern void add_event(struct dive *dive, int time, int type, int flags, int value, const char *name);
+
+/* UI related protopypes */
+
+extern void init_ui(int *argcp, char ***argvp);
+
+extern void run_ui(void);
+
+extern void report_error(GError* error);
+
+extern void add_cylinder_description(cylinder_type_t *);
+extern void add_people(const char *string);
+extern void add_location(const char *string);
+extern void remember_event(const char *eventname);
+extern void evn_foreach(void (*callback)(const char *, int *, void *), void *data);
+
+extern int edit_dive_info(struct dive *dive);
+extern void dive_list_update_dives(void);
+extern void flush_divelist(struct dive *dive);
+
+#define DIVE_ERROR_PARSE 1
+
+const char *weekday(int wday);
+const char *monthname(int mon);
+
+#define UTF8_DEGREE "\xc2\xb0"
+#define UTF8_SUBSCRIPT_2 "\xe2\x82\x82"
+#define UTF8_WHITESTAR "\xe2\x98\x86"
+#define UTF8_BLACKSTAR "\xe2\x98\x85"
+#define ZERO_STARS UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR
+#define ONE_STARS UTF8_BLACKSTAR UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR
+#define TWO_STARS UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_WHITESTAR UTF8_WHITESTAR UTF8_WHITESTAR
+#define THREE_STARS UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_WHITESTAR UTF8_WHITESTAR
+#define FOUR_STARS UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_WHITESTAR
+#define FIVE_STARS UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR
+extern const char *star_strings[];
+
+#define AIR_PERMILLE 209
+