const char *system_default_directory(void) { static const char *path = NULL; if (!path) path = system_default_path_append(NULL); return path; }
const char *system_default_filename(void) { static const char *filename = "subsurface.xml"; static const char *path = NULL; if (!path) path = system_default_path_append(filename); return path; }
const char *system_default_filename(void) { static const char *path = NULL; if (!path) { const char *user = getenv("LOGNAME"); if (empty_string(user)) user = "******"; char *filename = calloc(strlen(user) + 5, 1); strcat(filename, user); strcat(filename, ".xml"); path = system_default_path_append(filename); free(filename); } return path; }