GlobalState.start_file_number = atoi(associated_value);
return 2;
}
+ else if(stringcompare(argument, "computerflag") == 0) {
+ GlobalState.computer_flag = atoi(associated_value);
+ return 2;
+ }
else if(stringcompare(argument, "version") == 0) {
fprintf(GlobalState.logfile, "pgn-extract %s\n", CURRENT_VERSION);
exit(0);
0, /* start_file_number */
0, /* start_position */
LONG_MAX, /* end_position */
+ 0, /* computer_flag */
DEFAULT_ECO_FILE, /* eco_file (-e) */
(FILE *)NULL, /* outputfile (-o, -a). Default is stdout */
(char *)NULL, /* output_filename (-o, -a) */
}
int file_num = current_game.file_number;
long start_position = current_game.start_position;
+ int computer_flag = GlobalState.computer_flag;
// Parse date and time, if it exists. Set invalid dates to year 3000.
const char *date_tag = current_game.tags[DATE_TAG];
fwrite(×tamp, sizeof(timestamp), 1, outputfile);
fwrite(&file_num, sizeof(file_num), 1, outputfile);
fwrite(&start_position, sizeof(start_position), 1, outputfile);
+ putc(computer_flag, outputfile);
putc(strlen((char *)move->move), outputfile);
fwrite(move->move, strlen((char *)move->move), 1, outputfile);
fwrite(×tamp, sizeof(timestamp), 1, outputfile);
fwrite(&file_num, sizeof(file_num), 1, outputfile);
fwrite(&start_position, sizeof(start_position), 1, outputfile);
+ putc(computer_flag, outputfile);
putc(0, outputfile); // No move.
free(bpfen);