-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()