src/chess/pgn.c

changeset 194
619f07c95894
parent 193
d1420f5c5704
equal deleted inserted replaced
193:d1420f5c5704 194:619f07c95894
131 return(pgn_error_missing_dot); 131 return(pgn_error_missing_dot);
132 } 132 }
133 133
134 char movestr[10]; 134 char movestr[10];
135 Move move; 135 Move move;
136 uint8_t curcol = WHITE; 136 Color curcol = WHITE;
137 bool movetext_ends_with_result = false; 137 bool movetext_ends_with_result = false;
138 138
139 while (true) { 139 while (true) {
140 /* move */ 140 /* move */
141 while (isspace(c = *(pgndata++))); 141 while (isspace(c = *(pgndata++)));
300 year, month, day); 300 year, month, day);
301 } 301 }
302 return date; 302 return date;
303 } 303 }
304 304
305 const char *pgn_player_name(const GameState *gamestate, uint8_t color) { 305 const char *pgn_player_name(const GameState *gamestate, Color color) {
306 const char *name = color == WHITE ? gamestate->wname : gamestate->bname; 306 const char *name = color == WHITE ? gamestate->wname : gamestate->bname;
307 return name[0] != '\0' ? name : "Anonymous"; 307 return name[0] != '\0' ? name : "Anonymous";
308 } 308 }
309 309
310 int write_pgn(FILE* stream, const GameState *gamestate, bool export_comments) { 310 int write_pgn(FILE* stream, const GameState *gamestate, bool export_comments) {

mercurial