libXDGdirs v1.1.1-2-g54a653b
An implementation of XDG Base Directory Specification
Loading...
Searching...
No Matches
print.c
-- POSSIBLE OUTPUT --
XDG_DATA_HOME /home/user/.local/share
XDG_CONFIG_HOME /home/user/.config
XDG_CACHE_HOME /home/user/.cache
XDG_RUNTIME_DIR /run/user/1000
XDG_DATA_DIRS /usr/local/share:/usr/share
XDG_CONFIG_DIRS /etc/xdg
#include <stdio.h>
#include <xdgdirs.h>
int main()
{
const char* fmt = "%-20s %s\n";
printf(fmt, "XDG_DATA_HOME", xdgDataHome());
printf(fmt, "XDG_CONFIG_HOME", xdgConfigHome());
printf(fmt, "XDG_CACHE_HOME", xdgCacheHome());
printf(fmt, "XDG_RUNTIME_DIR", xdgRuntimeDir());
printf(fmt, "XDG_DATA_DIRS", xdgDataDirs()->raw);
printf(fmt, "XDG_CONFIG_DIRS", xdgConfigDirs()->raw);
return 0;
}
void xdgDirs_clear(void)
Clear cached data.
xdgDirsList * xdgConfigDirs(void)
Value of $XDG_CONFIG_DIRS.
xdgDirsList * xdgDataDirs(void)
Value of $XDG_DATA_DIRS.
const char * xdgRuntimeDir(void)
Value of $XDG_RUNTIME_DIR.
const char * xdgCacheHome(void)
Value of $XDG_CACHE_HOME.
const char * xdgConfigHome(void)
Value of $XDG_CONFIG_HOME.
const char * xdgDataHome(void)
Value of $XDG_DATA_HOME.
int main()
Definition test.c:4