+extern int selected_dive;
+#define current_dive (get_dive(selected_dive))
+
+static inline struct dive *get_dive(unsigned int nr)
+{
+ if (nr >= dive_table.nr)
+ return NULL;
+ return dive_table.dives[nr];
+}
+
+extern void parse_xml_init(void);
+extern void parse_xml_file(const char *filename, GError **error);
+extern void set_filename(const char *filename);
+
+extern void show_dive_info(struct dive *);
+extern void flush_dive_info_changes(struct dive *);
+
+extern void show_dive_equipment(struct dive *);
+extern void flush_dive_equipment_changes(struct dive *);
+
+extern void update_dive(struct dive *new_dive);
+extern void save_dives(const char *filename);
+
+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, struct sample *sample);
+
+extern void report_dives(void);
+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);
+
+/* UI related protopypes */
+
+extern void init_ui(int argc, char **argv);
+
+extern void run_ui(void);
+
+extern void report_error(GError* error);
+
+extern void dive_list_update_dives(void);
+extern void flush_divelist(struct dive *dive);
+
+extern int open_import_file_dialog(char *filterpattern, char *filtertext,
+ void(* parse_function)(char *));
+#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"