X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=blobdiff_plain;f=args.h;h=eb573c6c09bd7d2a4fef2f6f69a44fd353d99c68;hp=15c16309f6d48998ae52fee890e27ee89a5d6245;hb=0fe341b64ac865097b5182ec7740fe18802efbd2;hpb=5cf174f6830416ba7d2de8fb7eb88cffad53805f diff --git a/args.h b/args.h index 15c1630..eb573c6 100644 --- a/args.h +++ b/args.h @@ -224,6 +224,7 @@ ArgDescriptor argDescriptors[] = { { "pieceImageDirectory", ArgFilename, (void *) &appData.pieceDirectory, TRUE, (ArgIniType) "" }, { "pid", ArgFilename, (void *) &appData.pieceDirectory, FALSE, INVALID }, { "trueColors", ArgBoolean, (void *) &appData.trueColors, TRUE, (ArgIniType) FALSE }, + { "jewelled", ArgInt, (void *) &appData.jewelled, FALSE, (ArgIniType) -1 }, { "soundDirectory", ArgFilename, (void *) &appData.soundDirectory, XBOARD, (ArgIniType) "" }, { "msLoginDelay", ArgInt, (void *) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY }, { "pasteSelection", ArgBoolean, (void *) &appData.pasteSelection, XBOARD, (ArgIniType) FALSE }, @@ -534,6 +535,7 @@ ArgDescriptor argDescriptors[] = { { "secondScoreAbs", ArgBoolean, (void *) &appData.secondScoreIsAbsolute, FALSE, (ArgIniType) FALSE }, { "pgnExtendedInfo", ArgBoolean, (void *) &appData.saveExtendedInfoInPGN, TRUE, (ArgIniType) FALSE }, { "hideThinkingFromHuman", ArgBoolean, (void *) &appData.hideThinkingFromHuman, TRUE, (ArgIniType) FALSE }, + { "pgnTimeLeft", ArgBoolean, (void *) &appData.cumulativeTimePGN, TRUE, (ArgIniType) FALSE }, { "liteBackTextureFile", ArgFilename, (void *) &appData.liteBackTextureFile, TRUE, (ArgIniType) "" }, { "lbtf", ArgFilename, (void *) &appData.liteBackTextureFile, FALSE, INVALID }, { "darkBackTextureFile", ArgFilename, (void *) &appData.darkBackTextureFile, TRUE, (ArgIniType) "" }, @@ -960,7 +962,7 @@ ParseArgs(GetFunc get, void *cl) char argValue[MAX_ARG_LEN]; ArgDescriptor *ad; char start; - char *q; + char *q, *r, *s; int i, octval; char ch; int posarg = 4; // default is game file @@ -1240,10 +1242,29 @@ ParseArgs(GetFunc get, void *cl) case ArgInstall: q = *(char **) ad->argLoc; - if((saveDate == 0 || saveDate - dateStamp < 0) && !strstr(q, argValue) ) { - int l = strlen(q) + strlen(argValue); - *(char **) ad->argLoc = malloc(l+2); - snprintf(*(char **) ad->argLoc, l+2, "%s%s\n", q, argValue); + r = NULL; s = argValue; + if(argValue[0] == '#') { // group specification + r = strstr(argValue, "\\n"); + if(r) *r++ = '\n', *r++ = NULLCHAR, s = r, r = argValue; // split s into line-to-add (s) and group (r) + } + if((saveDate == 0 || saveDate - dateStamp < 0) && !strstr(q, s) ) { // not seen before, and line does not occur yet + int l = strlen(q) + strlen(s); + if(r) { // must be put in group r + char *p = strstr(q, r); + if(p) { // group already exists + p += strlen(r) - 1; // determine insertion point (immediately after group header line) + *(char **) ad->argLoc = malloc(l+2); + *p++ = NULLCHAR; // spit old value (q) at insertion point into q and p + snprintf(*(char **) ad->argLoc, l+2, "%s\n%s\n%s", q, s, p); // insert (with newline) + } else { // group did not exist, create at end + l += strlen(r) + 8; + *(char **) ad->argLoc = malloc(l); + snprintf(*(char **) ad->argLoc, l, "%s%s%s\n# end\n", q, r, s); + } + } else { // no group, just add line at end + *(char **) ad->argLoc = malloc(l+2); + snprintf(*(char **) ad->argLoc, l+2, "%s%s\n", q, s); + } free(q); } break; @@ -1418,6 +1439,7 @@ InitAppData(char *lpCmdLine) if(!*appData.secondChessProgram) { // [HGM] scp defaults to fcp ASSIGN(appData.secondChessProgram, appData.firstChessProgram); + ASSIGN(appData.secondDirectory, appData.firstDirectory); appData.secondIsUCI = appData.firstIsUCI; // copy type too! } @@ -1528,11 +1550,10 @@ SaveSettings(char* name) ArgDescriptor *ad; char dir[MSG_SIZ], buf[MSG_SIZ]; int mps = appData.movesPerSession; - TimeMark now; if (!MainWindowUp() && !autoClose) return; - GetTimeMark(&now); saveDate = now.sec; + saveDate = programStartTime.sec; GetCurrentDirectory(MSG_SIZ, dir); if(MySearchPath(installDir, name, buf)) {