typedef struct _gnubg_game { /* ordinal number of the game within a match */ int i; /* match score BEFORE the game */ int anScore[2]; /* this is the Crawford game */ int fCrawfordGame; /* who won (-1 = unfinished) */ int fWinner; /* how many points were scored by the winner */ int nPoints; /* the game was ended by resignation */ int fResigned; /* how many automatic doubles were rolled */ int nAutoDoubles; /* Type of game */ bgvariation bgv; /* Cube used in game */ int fCubeUse; statcontext sc; #if USE_TIMECONTROL /* the game ended on time */ int fTimeout; /* how many timeouts (clock expiry) have happened during the match */ int nTimeouts[2]; #endif int length; /* number of moves (moverecords) in this game. */ GList *moves; /* linked list of moverecords */ GList *current_move; /* link to current move */ } gnubg_game; typedef struct _gnubg_match { player ap[ 2 ]; int nMatchTo; bgvariation bgv; int fCrawford; int fCubeUse; int fJacoby; int length; /* number of games in this match. */ GList *games; /* linked list of games */ GList *current_game; /* Link to current game */ int fWinner; /* Do we need this? what about final score? */ } gnubg_match; /* Ignore this code. I'm just playing around */ void example_code(void){ /* gnubg_match match; // Global match? */ GList game = match->games; printf("Player name: %s\n", match->ap[0]->name); // loop through match: for ( ; game ; game = game->next ){ GList move = game->moves; for ( ; move ; move = move->next ) analyse(move); } }