mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
WUtil: Added 'const' attribute to the filename on WM(Read|Write)PropList*
Note that the argument is also stored as-is in the PLData structure but only for debugging purpose (warning display to user), hence the choice to not duplicate it. As a side effect, it was 'const'-ified too to reflect that.
This commit is contained in:
committed by
Carlos R. Mafra
parent
ea9d3e643f
commit
d40fa69b92
@@ -805,11 +805,11 @@ WMPropList* WMCreatePropListFromDescription(char *desc);
|
|||||||
/* Free the returned string when you no longer need it */
|
/* Free the returned string when you no longer need it */
|
||||||
char* WMGetPropListDescription(WMPropList *plist, Bool indented);
|
char* WMGetPropListDescription(WMPropList *plist, Bool indented);
|
||||||
|
|
||||||
WMPropList* WMReadPropListFromFile(char *file);
|
WMPropList* WMReadPropListFromFile(const char *file);
|
||||||
|
|
||||||
WMPropList* WMReadPropListFromPipe(char *command);
|
WMPropList* WMReadPropListFromPipe(const char *command);
|
||||||
|
|
||||||
Bool WMWritePropListToFile(WMPropList *plist, char *path);
|
Bool WMWritePropListToFile(WMPropList *plist, const char *path);
|
||||||
|
|
||||||
/* ---[ WINGs/userdefaults.c ]-------------------------------------------- */
|
/* ---[ WINGs/userdefaults.c ]-------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ typedef struct W_PropList {
|
|||||||
typedef struct PLData {
|
typedef struct PLData {
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int pos;
|
int pos;
|
||||||
char *filename;
|
const char *filename;
|
||||||
int lineNumber;
|
int lineNumber;
|
||||||
} PLData;
|
} PLData;
|
||||||
|
|
||||||
@@ -1485,7 +1485,7 @@ char *WMGetPropListDescription(WMPropList * plist, Bool indented)
|
|||||||
return (indented ? indentedDescription(plist, 0) : description(plist));
|
return (indented ? indentedDescription(plist, 0) : description(plist));
|
||||||
}
|
}
|
||||||
|
|
||||||
WMPropList *WMReadPropListFromFile(char *file)
|
WMPropList *WMReadPropListFromFile(const char *file)
|
||||||
{
|
{
|
||||||
WMPropList *plist = NULL;
|
WMPropList *plist = NULL;
|
||||||
PLData *pldata;
|
PLData *pldata;
|
||||||
@@ -1545,7 +1545,7 @@ WMPropList *WMReadPropListFromFile(char *file)
|
|||||||
return plist;
|
return plist;
|
||||||
}
|
}
|
||||||
|
|
||||||
WMPropList *WMReadPropListFromPipe(char *command)
|
WMPropList *WMReadPropListFromPipe(const char *command)
|
||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
WMPropList *plist;
|
WMPropList *plist;
|
||||||
@@ -1601,7 +1601,7 @@ WMPropList *WMReadPropListFromPipe(char *command)
|
|||||||
|
|
||||||
/* TODO: review this function's code */
|
/* TODO: review this function's code */
|
||||||
|
|
||||||
Bool WMWritePropListToFile(WMPropList * plist, char *path)
|
Bool WMWritePropListToFile(WMPropList * plist, const char *path)
|
||||||
{
|
{
|
||||||
char *thePath = NULL;
|
char *thePath = NULL;
|
||||||
char *desc;
|
char *desc;
|
||||||
|
|||||||
Reference in New Issue
Block a user