Tue, 13 Aug 2019 00:33:59 +0200
pgn parser can now handle comments (although it ignores them for now)
universe@50 | 1 | /* |
universe@50 | 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
universe@50 | 3 | * |
universe@55 | 4 | * Copyright 2016 Mike Becker. All rights reserved. |
universe@50 | 5 | * |
universe@50 | 6 | * Redistribution and use in source and binary forms, with or without |
universe@50 | 7 | * modification, are permitted provided that the following conditions are met: |
universe@50 | 8 | * |
universe@50 | 9 | * 1. Redistributions of source code must retain the above copyright |
universe@50 | 10 | * notice, this list of conditions and the following disclaimer. |
universe@50 | 11 | * |
universe@50 | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
universe@50 | 13 | * notice, this list of conditions and the following disclaimer in the |
universe@50 | 14 | * documentation and/or other materials provided with the distribution. |
universe@50 | 15 | * |
universe@50 | 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
universe@50 | 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
universe@50 | 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
universe@50 | 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
universe@50 | 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
universe@50 | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
universe@50 | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
universe@50 | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
universe@50 | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
universe@50 | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
universe@50 | 26 | * POSSIBILITY OF SUCH DAMAGE. |
universe@50 | 27 | * |
universe@50 | 28 | */ |
universe@50 | 29 | |
universe@50 | 30 | |
universe@50 | 31 | #ifndef PGN_H |
universe@50 | 32 | #define PGN_H |
universe@50 | 33 | |
universe@50 | 34 | #include "rules.h" |
universe@50 | 35 | #include <stdio.h> |
universe@50 | 36 | |
universe@50 | 37 | #ifdef __cplusplus |
universe@50 | 38 | extern "C" { |
universe@50 | 39 | #endif |
universe@59 | 40 | |
universe@50 | 41 | int read_pgn(FILE *stream, GameState *gamestate, GameInfo *gameinfo); |
universe@50 | 42 | size_t write_pgn(FILE* stream, GameState *gamestate, GameInfo *gameinfo); |
universe@54 | 43 | void compute_fen(char *str, GameState *gamestate); |
universe@50 | 44 | |
universe@60 | 45 | const char* pgn_error_str(int code); |
universe@60 | 46 | |
universe@50 | 47 | #ifdef __cplusplus |
universe@50 | 48 | } |
universe@50 | 49 | #endif |
universe@50 | 50 | |
universe@50 | 51 | #endif /* PGN_H */ |
universe@50 | 52 |