usercmd.c File Reference

#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <curses.h>
#include "belofte.h"
#include "board.h"
#include "alg1_book.h"
#include "alg1_eval.h"

Defines

#define CMD_NOPARAM   0
#define CMD_OPT   1
#define CMD_PARAM_NOCHECK   16
#define CMD_PARAM_NUMBER   8
#define CMD_PARAM_STRING   2
#define CMD_PARAM_SWITCH   4
#define UNUSED   __attribute__((unused))

Functions

void cmd_constructor (UNUSED char *szCommand, UNUSED char *szArg)
 configure the engine and all local parameters this is called when a total reset is required such as launching or relaunching the application whilst in memory
void cmd_constructor2 (void)
 second constructor, taking more time and issued during protover command
void cmd_force (UNUSED char *szCommand, UNUSED char *szArg)
 switch to force mode, turn off ponder
void cmd_force (char *szCommand, char *szArg)
void cmd_go (UNUSED char *szCommand, UNUSED char *szArg)
 computer plays colour to move
void cmd_new (UNUSED char *szCommand, UNUSED char *szArg)
 gnuchess compatible implementation
int cmd_peek (void)
 return true when there is a command in the queue
void cmd_quit (UNUSED char *szCommand, UNUSED char *szArg)
 exit engine also understands bye commands
void cmd_quit (char *szCommand, char *szArg)
int cmd_readcommand (void)
 read input command from xboard return codes not used now
int cmd_readline (char *szBuffer, void *pFile, const size_t nSize)
 read line
void cmd_sd (UNUSED char *szCommand, char *szArg)
void cmd_snd (const char *szCommand)
 reply to xboard, main and only routine for this purpose
void cmd_snd_info (const char *szMessage)
 return an info back to xboard
void cmd_snd_move (const char *szMove)
 send the move generated by the engine to xboard
void cmd_snd_thinking (const int nPly, const t_score fEval, const char *szThinking)
 return thinking statistics back
int file_readline (char *szBuffer, FILE *pFile, const size_t nSize)
 read line

Variables

int algoritme
int computer_engines [2] = { 0, 1 }
int curply
int force_mode
int ics_mode
int interface_mode
int level
int level_mode
st_history m_boardhistory [MAX_GAME_LENGTH]
t_depth maxdepth
int ponder_mode
int post_mode
int processing_mode
int random_mode
char szOpponentName [MAX_DATANAME_LENGTH]
char szResult [MAX_DATANAME_LENGTH]
char szSite [MAX_DATANAME_LENGTH]
int thinking
int time_left
int xboard_mode

Define Documentation

#define CMD_NOPARAM   0
 

#define CMD_OPT   1
 

#define CMD_PARAM_NOCHECK   16
 

#define CMD_PARAM_NUMBER   8
 

#define CMD_PARAM_STRING   2
 

#define CMD_PARAM_SWITCH   4
 

#define UNUSED   __attribute__((unused))
 


Function Documentation

void cmd_constructor UNUSED char *  szCommand,
UNUSED char *  szArg
 

configure the engine and all local parameters this is called when a total reset is required such as launching or relaunching the application whilst in memory

void cmd_constructor2 void   ) 
 

second constructor, taking more time and issued during protover command

void cmd_force UNUSED char *  szCommand,
UNUSED char *  szArg
 

switch to force mode, turn off ponder

void cmd_force char *  szCommand,
char *  szArg
 

void cmd_go UNUSED char *  szCommand,
UNUSED char *  szArg
 

computer plays colour to move

void cmd_new UNUSED char *  szCommand,
UNUSED char *  szArg
 

gnuchess compatible implementation

int cmd_peek void   ) 
 

return true when there is a command in the queue

void cmd_quit UNUSED char *  szCommand,
UNUSED char *  szArg
 

exit engine also understands bye commands

void cmd_quit char *  szCommand,
char *  szArg
 

int cmd_readcommand void   ) 
 

read input command from xboard return codes not used now

int cmd_readline char *  szBuffer,
void *  pFile,
const size_t  nSize
 

read line

Returns:
0 if there is an end of file

void cmd_sd UNUSED char *  szCommand,
char *  szArg
 

void cmd_snd const char *  szCommand  ) 
 

reply to xboard, main and only routine for this purpose

void cmd_snd_info const char *  szMessage  ) 
 

return an info back to xboard

void cmd_snd_move const char *  szMove  ) 
 

send the move generated by the engine to xboard

void cmd_snd_thinking const int  nPly,
const t_score  fEval,
const char *  szThinking
 

return thinking statistics back

int file_readline char *  szBuffer,
FILE *  pFile,
const size_t  nSize
 

read line

Returns:
0 if there is an end of file


Variable Documentation

int algoritme
 

int computer_engines[2] = { 0, 1 }
 

int curply
 

int force_mode
 

int ics_mode
 

int interface_mode
 

int level
 

int level_mode
 

struct st_history m_boardhistory[MAX_GAME_LENGTH]
 

t_depth maxdepth
 

int ponder_mode
 

int post_mode
 

int processing_mode
 

int random_mode
 

char szOpponentName[MAX_DATANAME_LENGTH]
 

char szResult[MAX_DATANAME_LENGTH]
 

char szSite[MAX_DATANAME_LENGTH]
 

int thinking
 

int time_left
 

int xboard_mode
 


Generated on Tue Jan 31 00:14:06 2006 for BelofteDoc by  doxygen 1.4.6