+
+ // Final position.
+ char *bpfen;
+ int bpfen_len;
+ build_BPFEN_string(final_board, &bpfen, &bpfen_len);
+
+ // key
+ putc(bpfen_len + sizeof(prev_board_hash), outputfile);
+ fwrite(bpfen, bpfen_len, 1, outputfile);
+ fwrite(&prev_board_hash, sizeof(prev_board_hash), 1, outputfile);
+
+ // value
+ putc(result_int, outputfile);
+ fwrite(&white_elo, sizeof(white_elo), 1, outputfile);
+ fwrite(&black_elo, sizeof(black_elo), 1, outputfile);
+ fwrite(&opening, sizeof(opening), 1, outputfile); // Not perfect, but should be OK.
+ 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);