示例#1
0
文件: macos.c 项目: dirkhh/subsurface
const char *system_default_directory(void)
{
	static const char *path = NULL;
	if (!path)
		path = system_default_path_append(NULL);
	return path;
}
示例#2
0
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;
}
示例#3
0
文件: macos.c 项目: dirkhh/subsurface
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;
}