Renamed to libxdg-basedir, moved xdg.dox to Doxyfile, fixed permissions.
[libxdg-basedir.git] / tests / testdump.c
blobdb910b45f42feccdb4901d65178af9b302f505ae
1 #include <basedir.h>
2 #include <stdio.h>
4 main(int argc, char* argv[])
6 const char * const * item;
7 xdgHandle handle = xdgAllocHandle();
8 if (!handle) return 1;
9 printf("${XDG_DATA_HOME:-$HOME/.local/share}=%s\n", xdgDataHome(handle));
10 printf("${XDG_CONFIG_HOME:-$HOME/.config}=%s\n", xdgConfigHome(handle));
11 printf("${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}=");
12 for (item = xdgDataDirectories(handle); *item; item++)
13 printf("%s%c", *item, (item[1] ? ':' : '\n'));
14 printf("${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}=");
15 for (item = xdgSearchableDataDirectories(handle); *item; item++)
16 printf("%s%c", *item, (item[1] ? ':' : '\n'));
17 printf("${XDG_CONFIG_DIRS:-/etc/xdg}=");
18 for (item = xdgConfigDirectories(handle); *item; item++)
19 printf("%s%c", *item, (item[1] ? ':' : '\n'));
20 printf("${XDG_CONFIG_HOME:-$HOME/.config}:${XDG_CONFIG_DIRS:-/etc/xdg}=");
21 for (item = xdgSearchableConfigDirectories(handle); *item; item++)
22 printf("%s%c", *item, (item[1] ? ':' : '\n'));
23 printf("${XDG_CACHE_HOME:-$HOME/.cache}=%s\n", xdgCacheHome(handle));
24 xdgFreeHandle(handle);
25 return 0;