mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +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:
committed by
Carlos R. Mafra
parent
7e1cdf2d59
commit
1e45ff2305
@@ -864,6 +864,7 @@ Bool WMWritePropListToFile(WMPropList *plist, const char *path);
|
|||||||
|
|
||||||
/* don't free the returned string */
|
/* don't free the returned string */
|
||||||
const char* wusergnusteppath(void);
|
const char* wusergnusteppath(void);
|
||||||
|
const char* wuserdatapath(void);
|
||||||
|
|
||||||
/* Free the returned string when you no longer need it */
|
/* Free the returned string when you no longer need it */
|
||||||
char* wdefaultspathfordomain(const char *domain);
|
char* wdefaultspathfordomain(const char *domain);
|
||||||
|
|||||||
@@ -81,6 +81,19 @@ const char *wusergnusteppath()
|
|||||||
return path;
|
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 *wdefaultspathfordomain(const char *domain)
|
||||||
{
|
{
|
||||||
char *path;
|
char *path;
|
||||||
|
|||||||
Reference in New Issue
Block a user