From: H.G. Muller Date: Mon, 9 May 2011 07:33:39 +0000 (+0200) Subject: Add -userFileDirectory option X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=a7be75c6a5a033a50c121aaf6b80468f5ff3a0c0 Add -userFileDirectory option This volatile option is initialized from 'installDir'. It is primarily intended for configuration of WinBoard through its master settings file, and specifies an alternative place to create saveGameFile or look for other user files, in stead of looking in the installDir. --- diff --git a/args.h b/args.h index fb9a263..2a3fd18 100644 --- a/args.h +++ b/args.h @@ -103,6 +103,7 @@ IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE]; int junk; Boolean singleList; +char *homeDir; void EnsureOnScreen(int *x, int *y, int minX, int minY); char StringGet(void *getClosure); @@ -553,6 +554,7 @@ ArgDescriptor argDescriptors[] = { { "defaultCacheSizeEGTB", ArgInt, (void *) &appData.defaultCacheSizeEGTB, TRUE, (ArgIniType) 4 }, { "defaultPathEGTB", ArgFilename, (void *) &appData.defaultPathEGTB, TRUE, (ArgIniType) "c:\\egtb" }, { "language", ArgFilename, (void *) &appData.language, TRUE, (ArgIniType) "" }, + { "userFileDirectory", ArgFilename, (void *) &homeDir, FALSE, (ArgIniType) installDir }, // [HGM] tournament options { "tourney", ArgFilename, (void *) &appData.tourneyFile, FALSE, (ArgIniType) "" }, diff --git a/frontend.h b/frontend.h index f498bc4..9cee154 100644 --- a/frontend.h +++ b/frontend.h @@ -173,7 +173,7 @@ void GLT_AddToList( char *name ); Boolean GLT_GetFromList( int index, char *name ); extern char lpUserGLT[]; -extern char homeDir[]; +extern char *homeDir; /* these are in wgamelist.c */ void GameListPopUp P((FILE *fp, char *filename)); diff --git a/winboard/winboard.c b/winboard/winboard.c index 722b9c8..1655d40 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -156,7 +156,6 @@ char *programName; char *settingsFileName; Boolean saveSettingsOnExit; char installDir[MSG_SIZ]; -char homeDir[MSG_SIZ]; int errorExitStatus; BoardSize boardSize; @@ -990,7 +989,6 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) } else { GetCurrentDirectory(MSG_SIZ, installDir); } - safeStrCpy(homeDir, installDir, MSG_SIZ); gameInfo.boardWidth = gameInfo.boardHeight = 8; // [HGM] won't have open window otherwise screenWidth = screenHeight = 1000; // [HGM] placement: kludge to allow calling EnsureOnScreen from InitAppData InitAppData(lpCmdLine); /* Get run-time parameters */