22 #include "opensync_internals.h" 49 user->homedir = g_get_home_dir();
50 user->username = g_get_user_name();
52 user->confdir = g_strdup_printf(
"%s/.opensync", user->homedir);
54 osync_trace(
TRACE_INTERNAL,
"Detected User:\nUID: %i\nGID: %i\nHome: %s\nOSyncDir: %s", user->uid, user->gid, user->homedir, user->confdir);
62 g_free(info->confdir);
80 g_free(user->confdir);
82 user->confdir = g_strdup(path);
OSyncUserInfo * osync_user_new(OSyncError **error)
This will create a new user.
void * osync_try_malloc0(unsigned int size, OSyncError **error)
Safely tries to malloc memory.
const char * osync_user_get_confdir(OSyncUserInfo *user)
This will get the configdir for the given user.
void osync_trace(OSyncTraceType type, const char *message,...)
Used for tracing the application.
void osync_user_set_confdir(OSyncUserInfo *user, const char *path)
This will set the configdir for the given user.