diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-04-17 11:34:21 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-04-17 08:37:31 -0700 |
commit | 95984628302bee02af3e82ac305b5e3bb4842533 (patch) | |
tree | 56b104b93b6786e4314e88d4a9164d4eaae67178 /dive.c | |
parent | f14c14c383763c73de1a6ec681b017517235f2f6 (diff) | |
download | subsurface-95984628302bee02af3e82ac305b5e3bb4842533.tar.gz |
Removed the globals 'userid' and 'save_userid_local' variables
This is a preferences setting, it should belong to the preferences
structure.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r-- | dive.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -2,6 +2,7 @@ /* maintains the internal dive list structure */ #include <string.h> #include <stdio.h> +#include <stdlib.h> #include <limits.h> #include "gettext.h" #include "dive.h" @@ -2188,3 +2189,17 @@ timestamp_t get_times() } return dive->when; } + +#define MAX_USERID_SIZE 32 +void set_save_userid_local(short value) +{ + prefs.save_userid_local = value; +} + +void set_userid(char *rUserId) +{ + prefs.userid = (char *) malloc(MAX_USERID_SIZE); + if (prefs.userid && rUserId) + strcpy(prefs.userid, rUserId); +} +#undef MAX_USERID_SIZE
\ No newline at end of file |