--- a/src/chess/fen.h Thu Sep 03 18:32:47 2026 +0200 +++ b/src/chess/fen.h Fri Sep 04 13:49:48 2026 +0200 @@ -50,7 +50,18 @@ * @param gamestate the current game state * @see #FEN_MAX_LENGTH */ -void fen_compute(char *str, GameState *gamestate); +void fen_compute(char *str, const GameState *gamestate); + +/** + * Constructs a game state from a FEN string. + * + * Note that this cannot reconstruct a move history by design. + * + * @param str the FEN string + * @param gamestate uninitialized target structure + * @return zero on success, non-zero when the FEN is invalid + */ +int fen_parse(const char *str, GameState *gamestate); #ifdef __cplusplus } /* extern "C" */