X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=args.h;h=fbdd498b28bff67baeb0c6c3deaf8cfa5eaf7aa9;hb=1a5408e7ee5166a82467e45662eeb6ca914473ed;hp=c518fad00ab3fe3e3550a130eb84672d7819b38e;hpb=bebe9603e5df7b96ae3abd6949b7e2bab015333c;p=xboard.git diff --git a/args.h b/args.h index c518fad..fbdd498 100644 --- a/args.h +++ b/args.h @@ -112,6 +112,7 @@ char *firstEngineLine; char *secondEngineLine; char *icsNick; char *theme; +char *replace; void EnsureOnScreen(int *x, int *y, int minX, int minY); char StringGet(void *getClosure); @@ -617,8 +618,10 @@ ArgDescriptor argDescriptors[] = { { "epd", ArgTrue, (void *) &appData.epd, FALSE, INVALID }, { "inscriptions", ArgString, (void *) &appData.inscriptions, FALSE, (ArgIniType) "" }, { "autoInstall", ArgString, (void *) &appData.autoInstall, XBOARD, (ArgIniType) "" }, + { "replace", ArgString, (void *) &replace, FALSE, (ArgIniType) NULL }, { "fixedSize", ArgBoolean, (void *) &appData.fixedSize, TRUE, (ArgIniType) FALSE }, { "showMoveTime", ArgBoolean, (void *) &appData.moveTime, TRUE, (ArgIniType) FALSE }, + { "bmpSave", ArgInt, (void *) &appData.bmpSave, FALSE, 0 }, // [HGM] tournament options { "tourneyFile", ArgFilename, (void *) &appData.tourneyFile, FALSE, (ArgIniType) "" }, @@ -1182,9 +1185,10 @@ ParseArgs(GetFunc get, void *cl) ASSIGN(*(char **) ad->argLoc, buf); break; } - if(!strncmp(argValue, "@@@@@", 5)) { // conditional string argument - if(*(char**) ad->argLoc == 0) { ASSIGN(*(char **) ad->argLoc, argValue+5); } // only used to replace empty string - break; + if(replace) { // previous -replace option makes this string option conditional + int differs = strcmp(*(char**) ad->argLoc, (char*) replace); + free(replace); replace = NULL; // but expires in the process + if(differs) break; // only use to replace the given string } ASSIGN(*(char **) ad->argLoc, argValue); break;