{ "syncAfterRound", ArgBoolean, (void *) &appData.roundSync, FALSE, (ArgIniType) FALSE },
{ "syncAfterCycle", ArgBoolean, (void *) &appData.cycleSync, FALSE, (ArgIniType) TRUE },
{ "seedBase", ArgInt, (void *) &appData.seedBase, FALSE, (ArgIniType) 1 },
+ { "afterGame", ArgString, (void *) &appData.afterGame, FALSE, INVALID },
/* [HGM] board-size, adjudication and misc. options */
{ "oneClickMove", ArgBoolean, (void *) &appData.oneClick, TRUE, (ArgIniType) FALSE },
if(waitingForGame) resChar = ' '; // quit while waiting for round sync: unreserve already reserved game
if(appData.tourneyFile[0]){ // [HGM] we are in a tourney; update tourney file with game result
+ if(appData.afterGame && appData.afterGame[0]) RunCommand(appData.afterGame);
ReserveGame(nextGame, resChar); // sets nextGame
if(nextGame > appData.matchGames) appData.tourneyFile[0] = 0, ranking = TourneyStandings(3); // tourney is done
else ranking = strdup("busy"); //suppress popup when aborted but not finished
char *processes;
char *results;
char *participants;
+ char *afterGame;
int tourneyType;
int tourneyCycles;
int seedBase;
int StartChildProcess P((char *cmdLine, char *dir, ProcRef *pr));
void DestroyChildProcess P((ProcRef pr, int/*boolean*/ signal));
void InterruptChildProcess P((ProcRef pr));
+void RunCommand P((char *buf));
int OpenTelnet P((char *host, char *port, ProcRef *pr));
int OpenTCP P((char *host, char *port, ProcRef *pr));
return 0x00000040;\r
}\r
\r
+void RunCommand(char *cmdLine)\r
+{\r
+ /* Now create the child process. */\r
+ STARTUPINFO siStartInfo;\r
+ PROCESS_INFORMATION piProcInfo;\r
+\r
+ siStartInfo.cb = sizeof(STARTUPINFO);\r
+ siStartInfo.lpReserved = NULL;\r
+ siStartInfo.lpDesktop = NULL;\r
+ siStartInfo.lpTitle = NULL;\r
+ siStartInfo.dwFlags = STARTF_USESTDHANDLES;\r
+ siStartInfo.cbReserved2 = 0;\r
+ siStartInfo.lpReserved2 = NULL;\r
+ siStartInfo.hStdInput = NULL;\r
+ siStartInfo.hStdOutput = NULL;\r
+ siStartInfo.hStdError = NULL;\r
+\r
+ CreateProcess(NULL,\r
+ cmdLine, /* command line */\r
+ NULL, /* process security attributes */\r
+ NULL, /* primary thread security attrs */\r
+ TRUE, /* handles are inherited */\r
+ DETACHED_PROCESS|CREATE_NEW_PROCESS_GROUP,\r
+ NULL, /* use parent's environment */\r
+ NULL,\r
+ &siStartInfo, /* STARTUPINFO pointer */\r
+ &piProcInfo); /* receives PROCESS_INFORMATION */\r
+\r
+ CloseHandle(piProcInfo.hThread);\r
+}\r
+\r
/* Start a child process running the given program.\r
The process's standard output can be read from "from", and its\r
standard input can be written to "to".\r
}
void
+RunCommand(char *buf)
+{
+ system(buf);
+}
+
+void
Colorize(cc, continuation)
ColorClass cc;
int continuation;