summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-12 20:26:29 -1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-13 21:33:30 -1000
commit713a4fcff6a580aab4a5036a5c3603ebce7ee830 (patch)
treeb47b4bd29cc692b1dfaa6890d108b422d1066ffa /dive.h
parentaba65736eb8cb85fa9bfa953095eab21f0668904 (diff)
downloadsubsurface-713a4fcff6a580aab4a5036a5c3603ebce7ee830.tar.gz
Add the ability to set a nickname for a dive computer
We maintain a list of dive computers that we know about (by deviceid) and their nicknames in our config. If the user downloads dive from a dive computer that we haven't seen before, we give them the option to set a nickname for that dive computer. That nickname is displayed in the profile (and stored in the XML file, assuming it is not the same as the model). This implementation attempts to make sure that it correctly deals with utf8 nicknames. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index 7927512b7..d504790ae 100644
--- a/dive.h
+++ b/dive.h
@@ -266,6 +266,7 @@ struct event {
struct divecomputer {
timestamp_t when;
const char *model;
+ const char *nickname;
uint32_t deviceid, diveid;
int samples, alloc_samples;
struct sample *sample;
@@ -524,6 +525,9 @@ extern int edit_multi_dive_info(struct dive *single_dive);
extern void dive_list_update_dives(void);
extern void flush_divelist(struct dive *dive);
+extern void set_dc_nickname(struct dive *dive);
+extern void remember_dc(uint32_t deviceid, const char *nickname, gboolean change_conf);
+
#define DIVE_ERROR_PARSE 1
const char *weekday(int wday);