Exemplo n.º 1
0
void sc_GetUserAppSupportDirectory(char *str, int size)
{
	// XDG support according to http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
	const char * xdg_data_home = getenv("XDG_DATA_HOME");
	if (xdg_data_home) {
		strncpy(str, xdg_data_home, size);
		sc_AppendToPath(str, size, "SuperCollider");
		return;
	}

#if defined(_WIN32)
	win32_GetKnownFolderPath(CSIDL_LOCAL_APPDATA, str, size);
	sc_AppendToPath(str, size, "SuperCollider");
#else

	sc_GetUserHomeDirectory(str, size);

#if defined(SC_IPHONE)
	sc_AppendToPath(str, size, "Documents");
#elif defined(__APPLE__)
	// Get the main bundle name for the app
	sc_AppendToPath(str, size, "Library/Application Support");
	sc_AppendBundleName(str, size);
#else
	sc_AppendToPath(str, size, ".local/share/SuperCollider");
#endif

#endif
}
Exemplo n.º 2
0
void sc_GetUserAppSupportDirectory(char *str, int size)
{
	// XDG support according to http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
	const char * xdg_data_home = getenv("XDG_DATA_HOME");
	if (xdg_data_home) {
		strncpy(str, xdg_data_home, size);
		sc_AppendToPath(str, size, "SuperCollider");
		return;
	}

#if defined(_WIN32)
	ITEMIDLIST * pidl;
	char buf[MAX_PATH];
	SHGetFolderLocation(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, &pidl);
	SHGetPathFromIDList( pidl, buf );
	ILFree(pidl);
	strncpy(str, buf, size);
	sc_AppendToPath(str, size, "SuperCollider");
#else

	sc_GetUserHomeDirectory(str, size);

#if defined(SC_IPHONE)
	sc_AppendToPath(str, size, "Documents");
#elif defined(__APPLE__)
	// Get the main bundle name for the app
	sc_AppendToPath(str, size, "Library/Application Support");
	sc_AppendBundleName(str, size);
#else
	sc_AppendToPath(str, size, ".local/share/SuperCollider");
#endif

#endif
}
Exemplo n.º 3
0
void sc_GetSystemAppSupportDirectory(char *str, int size)
{
#ifdef _WIN32
	win32_GetKnownFolderPath(CSIDL_COMMON_APPDATA, str, size);
	sc_AppendToPath(str, size, "SuperCollider");
#else

	strncpy(str,
#if defined(SC_DATA_DIR)
			SC_DATA_DIR,
#elif defined(SC_IPHONE)
			"/",
#elif defined(__APPLE__)
			"/Library/Application Support",
#else
			"/usr/local/share/SuperCollider",
#endif
			size);

#if defined(__APPLE__)
	// Get the main bundle name for the app from the enclosed Info.plist 
	sc_AppendBundleName(str, size);
#endif

#endif
}
Exemplo n.º 4
0
void sc_GetSystemAppSupportDirectory(char *str, int size)
{
#ifdef _WIN32
	ITEMIDLIST * pidl;
	char buf[MAX_PATH];
	SHGetFolderLocation(NULL, CSIDL_COMMON_APPDATA, NULL, 0, &pidl);
	SHGetPathFromIDList( pidl, buf );
	ILFree(pidl);
	strncpy(str, buf, size);
	sc_AppendToPath(str, size, "SuperCollider");
#else

	strncpy(str,
#if defined(SC_DATA_DIR)
			SC_DATA_DIR,
#elif defined(SC_IPHONE)
			"/",
#elif defined(__APPLE__)
			"/Library/Application Support",
#else
			"/usr/local/share/SuperCollider",
#endif
			size);

#if defined(__APPLE__)
	// Get the main bundle name for the app from the enclosed Info.plist 
	sc_AppendBundleName(str, size);
#endif

#endif
}
Exemplo n.º 5
0
void sc_GetSystemAppSupportDirectory(char *str, int size)
{
	strncpy(str,
#if defined(SC_DATA_DIR)
			SC_DATA_DIR,
#elif defined(SC_IPHONE)
			"/",
#elif defined(__APPLE__)
			"/Library/Application Support",
#elif defined(_WIN32)
			( getenv("SC_SYSAPPSUP_PATH")==NULL ) ? "C:\\SuperCollider" : getenv("SC_SYSAPPSUP_PATH"),
#else
			"/usr/local/share/SuperCollider",
#endif
			size);
			
#if defined(__APPLE__)
	// Get the main bundle name for the app from the enclosed Info.plist 
	sc_AppendBundleName(str, size);
#endif
}