forked from ulthiel/polyglot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpgn.h
56 lines (36 loc) · 839 Bytes
/
pgn.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// pgn.h
#ifndef PGN_H
#define PGN_H
// includes
#include <stdio.h>
#include "util.h"
// defines
#define PGN_STRING_SIZE 256
// types
typedef struct {
FILE * file;
int char_hack;
int char_line;
int char_column;
bool char_unread;
bool char_first;
int token_type;
char token_string[PGN_STRING_SIZE];
int token_length;
int token_line;
int token_column;
bool token_unread;
bool token_first;
char result[PGN_STRING_SIZE];
char fen[PGN_STRING_SIZE];
int move_line;
int move_column;
int game_nb;
} pgn_t;
// functions
extern void pgn_open (pgn_t * pgn, const char file_name[]);
extern void pgn_close (pgn_t * pgn);
extern bool pgn_next_game (pgn_t * pgn);
extern bool pgn_next_move (pgn_t * pgn, char string[], int size);
#endif // !defined PGN_H
// end of pgn.h