]> git.sesse.net Git - pgn-extract/blobdiff - typedef.h
Push through a computer/human flag to the binary output.
[pgn-extract] / typedef.h
index 9f7f270e416fbecc5f3cc2b914366a98935365b1..93978bdb5bd11dab4e3b1698dab334ab41dac9de 100644 (file)
--- a/typedef.h
+++ b/typedef.h
@@ -33,7 +33,7 @@
      *            and en-passant notation.
      *     UCI: UCI-compatible format - actually LALG.
      */
-typedef enum { SOURCE, SAN, EPD, CM, LALG, HALG, ELALG, UCI } OutputFormat;
+typedef enum { SOURCE, SAN, EPD, CM, LALG, HALG, ELALG, UCI, SESSE_BIN } OutputFormat;
 
     /* Define a type to specify whether a move gives check, checkmate,
      * or nocheck.
@@ -70,6 +70,9 @@ typedef struct variation{
  */
 #define MAX_MOVE_LEN 15
 
+struct EcoLog;
+typedef struct EcoLog EcoLog;
+
         /* Retain the text of a move and any associated 
          * NAGs and comments.
          */
@@ -96,11 +99,17 @@ typedef struct move{
      * has been played.
      */
     char *epd;
+    /* Same as epd, but in our special binary packed format.
+     * Not zero-terminated, since it is binary.
+     */
+    char *bpfen;
+    int bpfen_len;
     StringList *Nags;
     CommentList *Comment;
     /* terminating_result hold the result of the current list of moves. */
     char *terminating_result;
     Variation *Variants;
+    EcoLog *eco;
     /* Pointers to the previous and next move.
      * The extraction program does not need the prev field, but my
      * intention is to build other interfaces that might need it.
@@ -137,6 +146,12 @@ typedef struct {
      * 0 => no error found.
      */
     int error_ply;
+    /* File number this game comes from. */
+    int file_number;
+    /* File position of the first byte of the game, or -1
+     * if unknown.
+     */
+    long start_position;
 } Game;
 
 /* Define a type to distinguish between CHECK files, NORMAL files,
@@ -258,12 +273,26 @@ typedef struct {
     Boolean output_total_plycount;
     /* Whether to add a HashCode tag. */
     Boolean add_hashcode_tag;
+    /* Whether to dump ECO data to stdout after loading.*/
+    Boolean dump_eco;
     /* The comment to use for position matches, if required. */
     const char *position_match_comment;
     /* Current input file name. */
     const char *current_input_file;
     /* Whether this is a CHECKFILE or a NORMALFILE. */
     SourceFileType current_file_type;
+    /* Current file number. Used to disambiguate PGN file positions. */
+    int current_file_number;
+    int start_file_number;
+    /* Byte positions to scan to and from in the PGN file.
+     * Starting in the middle of a game will yield unexpected
+     * results.
+     */
+    long start_position;
+    long end_position;
+    /* Whether the games are assumed played by computers.
+     * Passed through verbatim to the binary format. */
+    int computer_flag;
     /* File of ECO lines. */
     const char *eco_file;
     /* Where to write the extracted games. */