27 #include "xmms_configuration.h" 35 xdg_dir_get (
const char *env,
const char *default_dir,
char *buf,
int len)
46 snprintf (buf, len,
"%s/xmms2", home);
51 pw = getpwuid (getuid ());
55 snprintf (buf, len,
"%s/%s", pw->pw_dir, default_dir);
69 return xdg_dir_get (
"XDG_CACHE_HOME", USERCACHEDIR, buf, len);
82 return xdg_dir_get (
"XDG_CONFIG_HOME", USERCONFDIR, buf, len);
97 pw = getpwuid (getuid ());
98 if (!pw || !pw->pw_name) {
102 snprintf (buf, len,
"unix:///tmp/xmms-ipc-%s", pw->pw_name);
116 struct timespec sleeptime;
118 sleeptime.tv_sec = (time_t) (n / 1000);
119 sleeptime.tv_nsec = (n % 1000) * 1000000;
121 while (nanosleep (&sleeptime, &sleeptime) == -1) {
122 if (errno != EINTR) {
const char * xmms_fallback_ipcpath_get(char *buf, int len)
Get the fallback connection path (if XMMS_PATH is not accessible)
bool xmms_sleep_ms(int n)
Sleep for n milliseconds.
const char * xmms_usercachedir_get(char *buf, int len)
Get the absolute path to the user cache dir.
const char * xmms_userconfdir_get(char *buf, int len)
Get the absolute path to the user config dir.