(UNIX-like OS) see golded.cfg in /usr/local/etc/, ~/.golded/ and ~/

This commit is contained in:
Stas Degteff 2005-10-27 18:31:18 +00:00
parent f5016e755d
commit 70f54bd223
3 changed files with 46 additions and 0 deletions

View File

@ -10,6 +10,9 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
! New locations of config file for unix-like OS: ~/.golded/, ~/ and
/usr/local/etc/.
+ Compile-time defines to specify config file name: GEDCFG (default is
"golded.cfg") and GEDCFG2 (default is platform-depended: "gedw32.cfg",
"ged2.cfg", "geddos.cfg" or nothing).

View File

@ -96,4 +96,22 @@
#define FIDOLASTREAD "lastread"
#endif
#ifndef CFGUSERPATH1
#ifdef __UNIX__
#define CFGUSERPATH1 "~/.golded/"
#endif
#endif
#ifndef CFGUSERPATH2
#ifdef __UNIX__
#define CFGUSERPATH2 "~/"
#endif
#endif
#ifndef CFGPATH
#ifdef __UNIX__
#define CFGPATH "/usr/local/etc/"
#endif
#endif
#endif /* __GEFN_H__ */

View File

@ -624,6 +624,31 @@ void Initialize(int argc, char* argv[]) {
found = FindCfg(cmdlinecfg);
}
#ifdef CFGUSERPATH1
// Get it in user directory (step 1)
if(not found) {
strxcpy(cmdlinecfg, CFGUSERPATH1, sizeof(cmdlinecfg));
getcwd(cmdlinecfg, sizeof(cmdlinecfg));
found = FindCfg(cmdlinecfg);
}
#endif
#ifdef CFGUSERPATH2
// Get it in user directory (step 2)
if(not found) {
strxcpy(cmdlinecfg, CFGUSERPATH2, sizeof(cmdlinecfg));
getcwd(cmdlinecfg, sizeof(cmdlinecfg));
found = FindCfg(cmdlinecfg);
}
#endif
#ifdef CFGPATH
// Get it in system config directory
if(not found) {
strxcpy(cmdlinecfg, CFGPATH, sizeof(cmdlinecfg));
getcwd(cmdlinecfg, sizeof(cmdlinecfg));
found = FindCfg(cmdlinecfg);
}
#endif
// Get it in current directory
if(not found) {
getcwd(cmdlinecfg, sizeof(cmdlinecfg));