-static wxChar *GetResourcePath(wxChar *buf, wxChar *name, bool create)
-{
- if (create && FileExists(name))
- {
- wxStrcpy(buf, name);
- return buf; // Exists so ...
- }
- if (*name == _T('/'))
- wxStrcpy(buf, name);
- else
- {
- // Put in standard place for resource files if not absolute
- wxStrcpy(buf, DEFAULT_XRESOURCE_DIR);
- wxStrcat(buf, _T("/"));
- wxStrcat(buf, FileNameFromPath(name));
- }
- if (create)
- {
- // Touch the file to create it
- FILE *fd = fopen(wxConvCurrent->cWX2MB(buf), "w");
- if (fd) fclose(fd);
- }
- return buf;
-}
-
-// Read $HOME for what it says is home, if not
-// read $USER or $LOGNAME for user name else determine
-// the Real User, then determine the Real home dir.
-static wxChar *GetIniFile(wxChar *dest, const wxChar *filename)
-{
- const wxChar *home = (const wxChar *) NULL;
- if (filename && wxIsAbsolutePath(filename))
- {
- wxStrcpy(dest, filename);
- }
- else
- {
- if ((home = wxGetUserHome(wxString())) != NULL)
- {
- wxStrcpy(dest, home);
- if (dest[wxStrlen(dest) - 1] != _T('/')) wxStrcat(dest, _T("/"));
- if (filename == NULL)
- {
- if ((filename = wxGetenv(_T("XENVIRONMENT"))) == NULL) filename = _T(".Xdefaults");
- }
- else
- if (*filename != _T('.')) wxStrcat(dest, _T("."));
- wxStrcat(dest, filename);
- }
- else
- {
- dest[0] = _T('\0');
- }
- }
- return dest;
-}
-
-static void wxXMergeDatabases()