version 1.4w10UCIb16
[polyglot.git] / pgn.h
1 \r
2 // pgn.h\r
3 \r
4 #ifndef PGN_H\r
5 #define PGN_H\r
6 \r
7 // includes\r
8 \r
9 #include <cstdio>\r
10 \r
11 #include "util.h"\r
12 \r
13 // constants\r
14 \r
15 const int PGN_STRING_SIZE = 256;\r
16 \r
17 // types\r
18 \r
19 struct pgn_t {\r
20 \r
21    FILE * file;\r
22 \r
23    int char_hack;\r
24    int char_line;\r
25    int char_column;\r
26    bool char_unread;\r
27    bool char_first;\r
28 \r
29    int token_type;\r
30    char token_string[PGN_STRING_SIZE];\r
31    int token_length;\r
32    int token_line;\r
33    int token_column;\r
34    bool token_unread;\r
35    bool token_first;\r
36 \r
37    char result[PGN_STRING_SIZE];\r
38    char fen[PGN_STRING_SIZE];\r
39 \r
40    int move_line;\r
41    int move_column;\r
42    int game_nb;\r
43 };\r
44 \r
45 // functions\r
46 \r
47 extern void pgn_open      (pgn_t * pgn, const char file_name[]);\r
48 extern void pgn_close     (pgn_t * pgn);\r
49 \r
50 extern bool pgn_next_game (pgn_t * pgn);\r
51 extern bool pgn_next_move (pgn_t * pgn, char string[], int size);\r
52 \r
53 #endif // !defined PGN_H\r
54 \r
55 // end of pgn.h\r
56 \r