X-Git-Url: http://winboard.nl/cgi-bin?p=polyglot.git;a=blobdiff_plain;f=pgn.h;h=6bed708ce558469ec1d7caca9d8ee8ec4d16c7ff;hp=e79fc3f3a895aa9e09fda8c8517ed314334c3127;hb=HEAD;hpb=64f72f31685ea1dff12b19b22cfaf7a53ccc079f diff --git a/pgn.h b/pgn.h index e79fc3f..6bed708 100644 --- a/pgn.h +++ b/pgn.h @@ -1,56 +1,56 @@ - -// pgn.h - -#ifndef PGN_H -#define PGN_H - -// includes - -#include - -#include "util.h" - -// constants - -const int PGN_STRING_SIZE = 256; - -// types - -struct pgn_t { - - 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; -}; - -// 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 - + +// pgn.h + +#ifndef PGN_H +#define PGN_H + +// includes + +#include + +#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 +