]> git.tdb.fi Git - ext/subsurface.git/blobdiff - dive.h
Add helper function for doing depth unit calculations
[ext/subsurface.git] / dive.h
diff --git a/dive.h b/dive.h
index bbc5c67ae36413fead1c033f136e7685aa001d6c..fc458d04d4292df0a36bf99428c84b66c169aad2 100644 (file)
--- a/dive.h
+++ b/dive.h
@@ -86,9 +86,16 @@ typedef struct {
        pressure_t start, end;
 } cylinder_t;
 
+extern double get_depth_units(unsigned int mm, int *frac, const char **units);
+
+static inline double mm_to_feet(int mm)
+{
+       return mm * 0.00328084;
+}
+
 static inline int to_feet(depth_t depth)
 {
-       return depth.mm * 0.00328084 + 0.5;
+       return mm_to_feet(depth.mm) + 0.5;
 }
 
 static double mkelvin_to_C(int mkelvin)
@@ -217,8 +224,27 @@ 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 update_air_info(char *buffer);
+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"
+
 #endif /* DIVE_H */