Пример #1
0
boolean freerdp_detect_development_mode(rdpSettings* settings)
{
	int depth = 0;
	char* current_path;
	char* development_path = NULL;
	boolean development_mode = false;

	if (freerdp_check_file_exists(".git"))
	{
		depth = 0;
		development_mode = true;
	}
	else if (freerdp_check_file_exists(PARENT_PATH ".git"))
	{
		depth = 1;
		development_mode = true;
	}
	else if (freerdp_check_file_exists(PARENT_PATH PARENT_PATH ".git"))
	{
		depth = 2;
		development_mode = true;
	}

	current_path = freerdp_get_current_path(settings);

	if (development_mode)
		development_path = freerdp_get_parent_path(current_path, depth);

	settings->development_mode = development_mode;
	settings->development_path = development_path;

	return settings->development_mode;
}
Пример #2
0
char* freerdp_get_config_path(rdpSettings* settings)
{
	if (settings->config_path != NULL)
		return settings->config_path;

	settings->config_path = (char*) xmalloc(strlen(settings->home_path) + sizeof(FREERDP_CONFIG_DIR) + 2);
	sprintf(settings->config_path, "%s" PATH_SEPARATOR_STR "%s", settings->home_path, FREERDP_CONFIG_DIR);

	if (!freerdp_check_file_exists(settings->config_path))
		freerdp_mkdir(settings->config_path);

	return settings->config_path;
}
Пример #3
0
char* freerdp_get_config_path(rdpSettings* settings)
{
	char* path;

	path = (char*) xmalloc(strlen(settings->home_path) + sizeof(FREERDP_CONFIG_DIR) + 2);
	sprintf(path, "%s/%s", settings->home_path, FREERDP_CONFIG_DIR);

	if (!freerdp_check_file_exists(path))
		freerdp_mkdir(path);

	settings->config_path = path;

	return path;
}