if(p = strstr(line+6, " max ")) sscanf(p+1, "max %d", &max), *p = '\n';\r
if(p = strstr(line+6, " default ")) sscanf(p+1, "default %[^\n]*", val), *p = '\n';\r
if(!(p = strstr(line+6, " name "))) p = line+1; sscanf(p+6, "%[^\n]", name); // 'name' is omitted in UCCI\r
- if(!strcmp(name, "Threads")) { strcpy(threadOpt, name); continue; }\r
- if(!strcmp(name, "Ponder") || !strcmp(name, "USI_Ponder")) { strcpy(canPonder, name); continue; }\r
- if(!strcmp(name, "Hash") || !strcmp(name, "USI_Hash") || !strcmp(name, "hashsize")) {\r
+ if(!strcasecmp(name, "Threads")) { strcpy(threadOpt, name); continue; }\r
+ if(!strcasecmp(name, "Ponder") || !strcasecmp(name, "USI_Ponder")) { strcpy(canPonder, name); continue; }\r
+ if(!strcasecmp(name, "Hash") || !strcasecmp(name, "USI_Hash") || !strcasecmp(name, "hashsize")) {\r
memory = oldMem = atoi(val); hasHash = 1; \r
strcpy(hashOpt, name);\r
continue;\r
}\r
- if(!strcmp(name, "newgame") && !strcmp(type, "button")) { newGame++; continue; }\r
- if(!strcmp(name, "usemillisec")) { unit = (!strcmp(val, "false") ? 2 : 1); continue; }\r
+ if(!strcasecmp(name, "newgame") && !strcmp(type, "button")) { newGame++; continue; }\r
+ if(!strcasecmp(name, "usemillisec")) { unit = (!strcmp(val, "false") ? 2 : 1); continue; }\r
// pass on engine-defined option as WB option feature\r
if(!strcmp(type, "filename")) type[4] = 0;\r
sprintf(buf, "feature option=\"%s -%s", name, type); q = buf + strlen(buf);\r
else if(!strcmp(command, "nopost")) post = 0;\r
else if(!strcmp(command, "easy") && !!*canPonder) ponder = 0, StopPonder(pondering), fprintf(toE, "setoption %s%s %sfalse\n", nameWord, canPonder, valueWord);\r
else if(!strcmp(command, "hard") && !!*canPonder) ponder = 1, fprintf(toE, "setoption %s%s %strue\n", nameWord, canPonder, valueWord), StartPonder();\r
- else if(!strcmp(command, "ping")) pause = 1, fprintf(toE, "isready\n"), fflush(toE), Sync(PAUSE), printf("pong %s", line+5);\r
+ else if(!strcmp(command, "ping")) { static int done; if(!done) pause = 1, fprintf(toE, "isready\n"), fflush(toE), printf("# send isready\n"), fflush(stdout), Sync(PAUSE); done = 1; printf("pong %s", line+5); }\r
else if(!strcmp(command, "memory")) sscanf(line, "memory %d", &memory);\r
else if(!strcmp(command, "cores")&& !!*threadOpt) sscanf(line, "cores %d", &cores), fprintf(toE, "setoption %s%s %s%d\n", nameWord, threadOpt, valueWord, cores);\r
else if(!strcmp(command, "sd")) sscanf(line, "sd %d", &depth);\r