コード例 #1
0
ファイル: basedir.c プロジェクト: atheros/svc
const char * xdgCacheHome(xdgHandle *handle)
{
	if (handle)
		return xdgGetCache(handle)->cacheHome;
	else
		return xdgGetRelativeHome("XDG_CACHE_HOME", DefaultRelativeCacheHome, sizeof(DefaultRelativeCacheHome)-1);
}
コード例 #2
0
ファイル: basedir.c プロジェクト: atheros/svc
const char * xdgDataHome(xdgHandle *handle)
{
	if (handle)
		return xdgGetCache(handle)->dataHome;
	else
		return xdgGetRelativeHome("XDG_DATA_HOME", DefaultRelativeDataHome, sizeof(DefaultRelativeDataHome)-1);
}
コード例 #3
0
ファイル: basedir.c プロジェクト: atheros/svc
const char * xdgConfigHome(xdgHandle *handle)
{
	if (handle)
		return xdgGetCache(handle)->configHome;
	else
		return xdgGetRelativeHome("XDG_CONFIG_HOME", DefaultRelativeConfigHome, sizeof(DefaultRelativeConfigHome)-1);
}
コード例 #4
0
ファイル: basedir.c プロジェクト: atheros/svc
int xdgUpdateData(xdgHandle *handle)
{
	xdgCachedData* cache = (xdgCachedData*)malloc(sizeof(xdgCachedData));
	xdgCachedData* oldCache;
	if (!cache) return FALSE;
	xdgZeroMemory(cache, sizeof(xdgCachedData));

	if (xdgUpdateHomeDirectories(cache) &&
		xdgUpdateDirectoryLists(cache))
	{
		/* Update successful, replace pointer to old cache with pointer to new cache */
		oldCache = xdgGetCache(handle);
		handle->reserved = cache;
		if (oldCache)
		{
			xdgFreeData(oldCache);
			free(oldCache);
		}
		return TRUE;
	}
	else
	{
		/* Update failed, discard new cache and leave old cache unmodified */
		xdgFreeData(cache);
		free(cache);
		return FALSE;
	}
}
コード例 #5
0
ファイル: basedir.c プロジェクト: Kovensky/libxdg-basedir
const char * xdgRuntimeDirectory(xdgHandle *handle)
{
	if (handle)
		return xdgGetCache(handle)->runtimeDirectory;
	else
		return xdgEnvDup("XDG_RUNTIME_DIRECTORY");
}
コード例 #6
0
ファイル: basedir.c プロジェクト: atheros/svc
void xdgWipeHandle(xdgHandle *handle)
{
	xdgCachedData* cache = xdgGetCache(handle);
	xdgFreeData(cache);
	free(cache);
}
コード例 #7
0
ファイル: basedir.c プロジェクト: Caught/openpliPC
const char * xdgCacheHome(xdgHandle *handle)
{
	return xdgGetCache(handle)->cacheHome;
}
コード例 #8
0
ファイル: basedir.c プロジェクト: Caught/openpliPC
const char * xdgDataHome(xdgHandle *handle)
{
	return xdgGetCache(handle)->dataHome;
}