[Note, I haven't actually read any of the gnubg source code, so the conventions I use for eg naming structs and pointers may differ from the gnubg standard, but obviously the ideas here can survive a style change]. ***************** move.h: typedef struct move_s move_s, *move_t; /* return evaluation n for the move ( 0 <= n < moveGetNumberOfEvaluations(move)) */ eval_t moveGetEvaluation(move_t move, int n); /* how many different evaluations do we have for this move? */ int moveGetNumberOfEvaluations(move_t move); /* return an evaluation of a particular type (if it exists) */ eval_t moveGetEvaluationOfType(move_t move, evalType_t evalType); /* add an evaluation to a move. evalType specifies what sort of evaluation ÊÊ we want (defined in eval.h) */ void moveAddEvaluation(move_t move, evalType_t evalType); /* some move functions on moves... */ ***************** game.h: typedef struct game_s game_s, *game_t; /* get the n'th move in the game (start at 0) */ move_t gameGetMove(game_t game, int n); /* A different way to get a move: what's the next move after this one? */ move_t gameGetNextMove(game_t game, move_t move); /* return the number of moves in this game */ int gameGetLength(game_t game); /* Result for the game ------------------------------------------------------- */ enum{ GAME_WINNER_0, /* player 0 won */ GAME_WINNER_1, /* player 1 won */ GAME_WINNER_NONE, /* noone won (perhaps the board exploded) */ GAME_WINNER_UNFINISHED /* the game is unfinished */ }GAME_WINNER_e; enum{ GAME_ENDED_FINISH, Ê ÊÊ ÊÊ Ê/* game ended naturally */ GAME_ENDED_CUBE_PASS, Ê ÊÊ Ê/* game ended when one player cubed, the other passed */ GAME_ENDED_BEAVER_PASSÊ ÊÊ Ê/* game ended when one player beavered, the other passed */ }GAME_ENDED_e; typedef struct gameResult_s{ GAME_WINNER_eÊwinner; /* the rest only valid in winner is GAME_WINNER_0 or GAME_WINNER_1 */ GAME_ENDED_eÊreason; /* how did the game end? */ int amount; /* amount player 0 won or lost */Ê int multiplier; /* 1=normal, 2=gammon, 3=backgammon */ int cube; /* value of cube at end */ }gameResult_s, *gameResult_t; /* return the result of the game: */ gameResult_s gameGetResult(game_t game); /* more game functions.. */ **************** match.h: typedef struct match_s match_s, *match_t; /* load a match from a file */ match_t matchLoad(FILE*f); /* save a match to a file (returns 1 on success, 0 on failure) */ int matchSave(FILE*f); /* how many games in this match? */ int matchGetLength(match_t match); /* return the n'th game in the match (starting from 0) */ game_t matchGetGame(match_t match, int n); /* return player 0 and player 1 */ player_t matchGetPlayer(match_t match, int n); /* the match was up to how many points? */ intÊmatchGetLimit(match_t match); /* more match functions.. */