1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 03:50:30 +01:00

WUtil: New function wuserdatapath() to get path for application data

Returns the path in the user's GNUstep library: ~/GNUstep/Library
This commit is contained in:
John D Pell
2021-08-08 09:36:17 +02:00
committed by Carlos R. Mafra
parent 7e1cdf2d59
commit 1e45ff2305
2 changed files with 14 additions and 0 deletions

View File

@@ -864,6 +864,7 @@ Bool WMWritePropListToFile(WMPropList *plist, const char *path);
/* don't free the returned string */
const char* wusergnusteppath(void);
const char* wuserdatapath(void);
/* Free the returned string when you no longer need it */
char* wdefaultspathfordomain(const char *domain);

View File

@@ -81,6 +81,19 @@ const char *wusergnusteppath()
return path;
}
const char *wuserdatapath(void)
{
static char *path = NULL;
if (path)
/* Value have been already computed, re-use it */
return path;
path = wstrconcat(wusergnusteppath(), "/" USERDATA_SUBDIR);
return path;
}
char *wdefaultspathfordomain(const char *domain)
{
char *path;