You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.2 KiB
54 lines
1.2 KiB
/* |
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 |
|
*/ |
|
#include "e.h" |
|
|
|
/* externally accessible functions */ |
|
EAPI const char * |
|
e_user_homedir_get(void) |
|
{ |
|
char *homedir; |
|
int len; |
|
|
|
homedir = getenv("HOME"); |
|
if (!homedir) return "/tmp"; |
|
len = strlen(homedir); |
|
while ((len > 1) && (homedir[len - 1] == '/')) |
|
{ |
|
homedir[len - 1] = 0; |
|
len--; |
|
} |
|
return homedir; |
|
} |
|
|
|
/** |
|
* Return the directory where user .desktop files should be stored. |
|
* If the directory does not exist, it will be created. If it cannot be |
|
* created, a dialog will be displayed an NULL will be returned |
|
*/ |
|
EAPI const char * |
|
e_user_desktop_dir_get(void) |
|
{ |
|
static char dir[PATH_MAX] = ""; |
|
|
|
if (!dir[0]) |
|
snprintf(dir, sizeof(dir), "%s/applications", efreet_data_home_get()); |
|
|
|
return dir; |
|
} |
|
|
|
/** |
|
* Return the directory where user .icon files should be stored. |
|
* If the directory does not exist, it will be created. If it cannot be |
|
* created, a dialog will be displayed an NULL will be returned |
|
*/ |
|
EAPI const char * |
|
e_user_icon_dir_get(void) |
|
{ |
|
static char dir[PATH_MAX] = ""; |
|
|
|
if (!dir[0]) |
|
snprintf(dir, sizeof(dir), "%s/icons", efreet_data_home_get()); |
|
|
|
return dir; |
|
}
|
|
|