Couche de compatibilité : shim GLib et en-têtes réduits
engine/compat/ remplace ce que le cœur de gnubg attend du reste de gnubg et de GLib : config.h écrit à la main (sans threads, C générique, NEON prévu), shim GLib minimal (dont un analyseur XML pour les tables d'équité et mmap pour les bases de fin de partie), en-têtes réduits et fonctions de support. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
792f6395bf
commit
42bfb6506d
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* external.h -- en-tête réduit remplaçant celui de GNU Backgammon.
|
||||
*
|
||||
* Copyright (C) 2026 les auteurs d'Ustagammon.
|
||||
* Les deux structures ci-dessous sont reprises telles quelles de external.h
|
||||
* de GNU Backgammon (commit 14b6798, Copyright (C) 2001-2025 the AUTHORS).
|
||||
* Licence : GPLv3 ou ultérieure (voir LICENSE).
|
||||
*
|
||||
* drawboard.c (repris pour FormatMove, la notation des coups) inclut
|
||||
* external.h pour ces deux types, utilisés par ProcessFIBSBoardInfo. Le
|
||||
* reste de l'interface externe de gnubg (sockets) n'a pas lieu d'être ici.
|
||||
*/
|
||||
|
||||
#ifndef EXTERNAL_H
|
||||
#define EXTERNAL_H
|
||||
|
||||
#include <glib.h>
|
||||
#include "backgammon.h"
|
||||
|
||||
#define MAX_NAME_LEN 32
|
||||
|
||||
typedef struct {
|
||||
/*
|
||||
* These must be in the same order than the FIBS board string definition,
|
||||
* starting at Match Length.
|
||||
* See description at http://www.fibs.com/fibs_interface.html#board_state
|
||||
*/
|
||||
int nMatchTo;
|
||||
int nScore;
|
||||
int nScoreOpp;
|
||||
int anFIBSBoard[26];
|
||||
int nTurn;
|
||||
int anDice[2];
|
||||
int anOppDice[2];
|
||||
int nCube;
|
||||
int fCanDouble;
|
||||
int fOppCanDouble;
|
||||
int fDoubled;
|
||||
int nColor;
|
||||
int nDirection;
|
||||
int nHome; /* unused, set to 0 */
|
||||
int nBar; /* unused, set to 25 */
|
||||
int nOnHome; /* unused */
|
||||
int nOnHomeOpp; /* unused */
|
||||
int nOnBar; /* unused */
|
||||
int nOnBarOpp; /* unused */
|
||||
int nCanMove; /* unused */
|
||||
int fForcedMOve; /* unused */
|
||||
int fPostCrawford;
|
||||
/*
|
||||
* Redoubles from FIBS board is not usable by GNUbg.
|
||||
* A flag for match play is put at the same place
|
||||
*/
|
||||
int fNonCrawford;
|
||||
int nVersion;
|
||||
int padding[51];
|
||||
|
||||
/* These must be last */
|
||||
GString *gsName;
|
||||
GString *gsOpp;
|
||||
} FIBSBoardInfo;
|
||||
|
||||
typedef struct {
|
||||
char szPlayer[MAX_NAME_LEN];
|
||||
char szOpp[MAX_NAME_LEN];
|
||||
int nMatchTo;
|
||||
int nScore;
|
||||
int nScoreOpp;
|
||||
int anDice[2];
|
||||
int nCube;
|
||||
int fCubeOwner;
|
||||
int fDoubled;
|
||||
int fCrawford;
|
||||
int fJacoby;
|
||||
int nResignation;
|
||||
TanBoard anBoard;
|
||||
} ProcessedFIBSBoard;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user