Functions | Variables
libedax.c File Reference

Edax api. More...

#include "cassio.h"
#include "event.h"
#include "histogram.h"
#include "options.h"
#include "opening.h"
#include "obftest.h"
#include "perft.h"
#include "play.h"
#include "search.h"
#include "util.h"
#include "ui.h"

Functions

void version (void)
 Print version & copyright. More...
 
DLL_API void libedax_initialize (int argc, char **argv)
 edax init function for library use. More...
 
DLL_API void libedax_terminate ()
 edax terminate function for library use. More...
 
static void libedax_observer (Result *result)
 default search oberver for libedax. More...
 
void ui_init_libedax (UI *ui)
 initialize libedax api. More...
 
void ui_free_libedax (UI *ui)
 free resources used by libedax api. More...
 
void auto_go ()
 auto go with regard to mode. More...
 
DLL_API void edax_init ()
 init command. More...
 
DLL_API void edax_new ()
 new command. More...
 
DLL_API void edax_load (const char *file)
 load command. More...
 
DLL_API void edax_save (const char *file)
 save command. More...
 
DLL_API void edax_undo ()
 undo command. More...
 
DLL_API void edax_redo ()
 redo command. More...
 
DLL_API void edax_mode (const int mode)
 mode command. More...
 
DLL_API void edax_setboard (const char *board)
 setboard command. More...
 
DLL_API void edax_setboard_from_obj (const Board *board, const int turn)
 setboard command with board object. More...
 
DLL_API void edax_vmirror ()
 vmirror command. More...
 
DLL_API void edax_hmirror ()
 hmirror command. More...
 
DLL_API void edax_rotate (const int angle)
 rotate command. More...
 
DLL_API void edax_symetry (const int sym)
 symetry command. More...
 
DLL_API void edax_play (char *moves)
 play command. More...
 
DLL_API void edax_force (char *moves)
 force command. More...
 
DLL_API void edax_go ()
 go command. More...
 
DLL_API void edax_hint (const int n, HintList *hintlist)
 hint command. More...
 
DLL_API void edax_hint_prepare ()
 hint command. Call edax_hint_next after calling this function. More...
 
DLL_API void edax_hint_next (Hint *hint)
 hint command. Gets hint one by one. If there are no more hints, hint will be NOMOVE. Call edax_hint_prepare before calling this function. More...
 
DLL_API void edax_stop ()
 stop command. More...
 
DLL_API int edax_move (const char *move)
 user move command. More...
 
DLL_API const char * edax_opening ()
 opening command. More...
 
DLL_API const char * edax_ouverture ()
 ouverture command. More...
 
void book_cmd_pre_process (UI *ui)
 pre-process of book command. More...
 
void book_cmd_post_process (UI *ui)
 post-process of book command. More...
 
DLL_API void edax_book_store ()
 book store command. More...
 
DLL_API void edax_book_on ()
 book on command. More...
 
DLL_API void edax_book_off ()
 book off command. More...
 
DLL_API void edax_book_randomness (const int randomness)
 book randomness command. More...
 
DLL_API void edax_book_depth (const int depth)
 book depth command. More...
 
DLL_API void edax_book_new (const int level, const int depth)
 book new command. More...
 
DLL_API void edax_book_load (const char *book_file)
 book load command. More...
 
DLL_API void edax_book_save (const char *book_file)
 book save command. More...
 
DLL_API void edax_book_import (const char *import_file)
 book import command. More...
 
DLL_API void edax_book_export (const char *export_file)
 book export command. More...
 
DLL_API void edax_book_merge (const char *book_file)
 book merge command. More...
 
DLL_API void edax_book_fix ()
 book fix command. More...
 
DLL_API void edax_book_negamax ()
 book negamax command. More...
 
DLL_API void edax_book_correct ()
 book correct command. More...
 
DLL_API void edax_book_prune ()
 book prune command. More...
 
DLL_API void edax_book_subtree ()
 book subtree command. More...
 
DLL_API void edax_book_show (Position *position)
 book show command. More...
 
DLL_API void edax_book_info (Book *book)
 book info command. More...
 
DLL_API void edax_book_verbose (const int book_verbosity)
 book verbose command. More...
 
DLL_API void edax_book_add (const char *base_file)
 book add command. More...
 
DLL_API void edax_book_check (const char *base_file)
 book check command. More...
 
DLL_API void edax_book_extract (const char *base_file)
 book extract command. More...
 
DLL_API void edax_book_deviate (int relative_error, int absolute_error)
 book deviate command. More...
 
DLL_API void edax_book_enhance (int midgame_error, int endcut_error)
 book enhance command. More...
 
DLL_API void edax_book_fill (int fill_depth)
 book fill command. More...
 
DLL_API void edax_book_play ()
 book play command. More...
 
DLL_API void edax_book_deepen ()
 book deepen command. caution: Currently, this function does not work correctly. More...
 
DLL_API void edax_book_feed_hash ()
 book feed-hash command. More...
 
DLL_API void edax_base_problem (const char *base_file, const int n_empties, const char *problem_file)
 base problem command. More...
 
DLL_API void edax_base_tofen (const char *base_file, const int n_empties, const char *problem_file)
 base tofen command. More...
 
DLL_API void edax_base_correct (const char *base_file, const int n_empties)
 base correct command. More...
 
DLL_API void edax_base_complete (const char *base_file)
 base complete command. More...
 
DLL_API void edax_base_convert (const char *base_file_from, const char *base_file_to)
 base convert command. More...
 
DLL_API void edax_base_unique (const char *base_file_from, const char *base_file_to)
 base unique command. More...
 
DLL_API void edax_set_option (const char *option_name, const char *val)
 set (option) command. More...
 
DLL_API char * edax_get_moves (char *str)
 get moves of the current game. More...
 
DLL_API int edax_is_game_over ()
 check if the current game is over. More...
 
DLL_API int edax_can_move ()
 check if the current player can move. More...
 
DLL_API void edax_get_last_move (Move *move)
 get last move. More...
 
DLL_API void edax_get_board (Board *board)
 get current board. More...
 
DLL_API int edax_get_current_player ()
 get current player. More...
 
DLL_API int edax_get_disc (const int color)
 get current number of discs. More...
 
DLL_API int edax_get_mobility_count (const int color)
 get current number of legal moves. More...
 

Variables

bool book_verbose
 
UIg_ui
 

Detailed Description

Edax api.

Date
2018
Author
lavox

Function Documentation

◆ auto_go()

void auto_go ( )

auto go with regard to mode.

◆ book_cmd_post_process()

void book_cmd_post_process ( UI ui)

post-process of book command.

Parameters
uiuser interface.

◆ book_cmd_pre_process()

void book_cmd_pre_process ( UI ui)

pre-process of book command.

Parameters
uiuser interface.

◆ edax_base_complete()

DLL_API void edax_base_complete ( const char *  base_file)

base complete command.

Parameters
base_filegame database file.

◆ edax_base_convert()

DLL_API void edax_base_convert ( const char *  base_file_from,
const char *  base_file_to 
)

base convert command.

Parameters
base_file_frominput game database file.
base_file_tooutput game database file.

◆ edax_base_correct()

DLL_API void edax_base_correct ( const char *  base_file,
const int  n_empties 
)

base correct command.

Parameters
base_filegame database file.
n_emptiesnumber of empties.

◆ edax_base_problem()

DLL_API void edax_base_problem ( const char *  base_file,
const int  n_empties,
const char *  problem_file 
)

base problem command.

Parameters
base_filegame database file.
n_emptiesnumber of empties.
problem_fileproblem_file to save.

◆ edax_base_tofen()

DLL_API void edax_base_tofen ( const char *  base_file,
const int  n_empties,
const char *  problem_file 
)

base tofen command.

Parameters
base_filegame database file.
n_emptiesnumber of empties.
problem_fileproblem_file to save.

◆ edax_base_unique()

DLL_API void edax_base_unique ( const char *  base_file_from,
const char *  base_file_to 
)

base unique command.

Parameters
base_file_frominput game database file.
base_file_tooutput game database file.

◆ edax_book_add()

DLL_API void edax_book_add ( const char *  base_file)

book add command.

Parameters
base_filebase file to add.

◆ edax_book_check()

DLL_API void edax_book_check ( const char *  base_file)

book check command.

Parameters
base_filebase file to check.

◆ edax_book_correct()

DLL_API void edax_book_correct ( )

book correct command.

◆ edax_book_deepen()

DLL_API void edax_book_deepen ( )

book deepen command. caution: Currently, this function does not work correctly.

◆ edax_book_depth()

DLL_API void edax_book_depth ( const int  depth)

book depth command.

Parameters
depthdepth.

◆ edax_book_deviate()

DLL_API void edax_book_deviate ( int  relative_error,
int  absolute_error 
)

book deviate command.

Parameters
relative_errorrelative error.
absolute_errorabsolute error.

◆ edax_book_enhance()

DLL_API void edax_book_enhance ( int  midgame_error,
int  endcut_error 
)

book enhance command.

Parameters
midgame_errormidgame error.
endcut_errorendcut error.

◆ edax_book_export()

DLL_API void edax_book_export ( const char *  export_file)

book export command.

Parameters
export_filefile name to export.

◆ edax_book_extract()

DLL_API void edax_book_extract ( const char *  base_file)

book extract command.

Parameters
base_filebase file to extract.

◆ edax_book_feed_hash()

DLL_API void edax_book_feed_hash ( )

book feed-hash command.

◆ edax_book_fill()

DLL_API void edax_book_fill ( int  fill_depth)

book fill command.

Parameters
fill_depthfill depth.

◆ edax_book_fix()

DLL_API void edax_book_fix ( )

book fix command.

◆ edax_book_import()

DLL_API void edax_book_import ( const char *  import_file)

book import command.

Parameters
import_filefile name to import.

◆ edax_book_info()

DLL_API void edax_book_info ( Book book)

book info command.

Parameters
bookbook information(out parameter).

◆ edax_book_load()

DLL_API void edax_book_load ( const char *  book_file)

book load command.

Parameters
book_filebook file name to load.

◆ edax_book_merge()

DLL_API void edax_book_merge ( const char *  book_file)

book merge command.

Parameters
book_filefile name to merge.

◆ edax_book_negamax()

DLL_API void edax_book_negamax ( )

book negamax command.

◆ edax_book_new()

DLL_API void edax_book_new ( const int  level,
const int  depth 
)

book new command.

Parameters
levellevel.
depthdepth.

◆ edax_book_off()

DLL_API void edax_book_off ( )

book off command.

◆ edax_book_on()

DLL_API void edax_book_on ( )

book on command.

◆ edax_book_play()

DLL_API void edax_book_play ( )

book play command.

◆ edax_book_prune()

DLL_API void edax_book_prune ( )

book prune command.

◆ edax_book_randomness()

DLL_API void edax_book_randomness ( const int  randomness)

book randomness command.

Parameters
randomnessrandomness.

◆ edax_book_save()

DLL_API void edax_book_save ( const char *  book_file)

book save command.

Parameters
book_filebook file name to save.

◆ edax_book_show()

DLL_API void edax_book_show ( Position position)

book show command.

Parameters
positionposition information(out parameter).

◆ edax_book_store()

DLL_API void edax_book_store ( )

book store command.

◆ edax_book_subtree()

DLL_API void edax_book_subtree ( )

book subtree command.

◆ edax_book_verbose()

DLL_API void edax_book_verbose ( const int  book_verbosity)

book verbose command.

Parameters
book_verbositybook verbosity.

◆ edax_can_move()

DLL_API int edax_can_move ( )

check if the current player can move.

Returns
1 if the current player can move, otherwise 0.

◆ edax_force()

DLL_API void edax_force ( char *  moves)

force command.

Parameters
movesmoves.

◆ edax_get_board()

DLL_API void edax_get_board ( Board board)

get current board.

Parameters
boardcurrent board(out parameter).

◆ edax_get_current_player()

DLL_API int edax_get_current_player ( )

get current player.

Returns
current player(0:BLACK, 1:WHITE).

◆ edax_get_disc()

DLL_API int edax_get_disc ( const int  color)

get current number of discs.

Parameters
colorplayer's color(0:BLACK, 1:WHITE).
Returns
number of discs.

◆ edax_get_last_move()

DLL_API void edax_get_last_move ( Move move)

get last move.

Parameters
movelast move(out parameter).

◆ edax_get_mobility_count()

DLL_API int edax_get_mobility_count ( const int  color)

get current number of legal moves.

Parameters
colorplayer's color(0:BLACK, 1:WHITE).
Returns
number of legal moves.

◆ edax_get_moves()

DLL_API char* edax_get_moves ( char *  str)

get moves of the current game.

Parameters
strbuffer of length 160 + 1 or more (out parameter).
Returns
moves(equals to str. This is for Java, as Java String is immutable).

◆ edax_go()

DLL_API void edax_go ( )

go command.

◆ edax_hint()

DLL_API void edax_hint ( const int  n,
HintList hintlist 
)

hint command.

Parameters
nnumber of hints.
hintlistresult (out parameter).

◆ edax_hint_next()

DLL_API void edax_hint_next ( Hint hint)

hint command. Gets hint one by one. If there are no more hints, hint will be NOMOVE. Call edax_hint_prepare before calling this function.

Parameters
nnumber of hints.
hintlistresult (out parameter).

◆ edax_hint_prepare()

DLL_API void edax_hint_prepare ( )

hint command. Call edax_hint_next after calling this function.

◆ edax_hmirror()

DLL_API void edax_hmirror ( )

hmirror command.

◆ edax_init()

DLL_API void edax_init ( )

init command.

◆ edax_is_game_over()

DLL_API int edax_is_game_over ( )

check if the current game is over.

Returns
1 if game is over, otherwise 0.

◆ edax_load()

DLL_API void edax_load ( const char *  file)

load command.

Parameters
filefile name to open

◆ edax_mode()

DLL_API void edax_mode ( const int  mode)

mode command.

Parameters
modemode to set

◆ edax_move()

DLL_API int edax_move ( const char *  move)

user move command.

Parameters
moveuser move.
Returns
1 if the move has been legally played, otherwise 0.

◆ edax_new()

DLL_API void edax_new ( )

new command.

◆ edax_opening()

DLL_API const char* edax_opening ( )

opening command.

Returns
opening name.

◆ edax_ouverture()

DLL_API const char* edax_ouverture ( )

ouverture command.

Returns
opening name in french.

◆ edax_play()

DLL_API void edax_play ( char *  moves)

play command.

Parameters
movesmoves.

◆ edax_redo()

DLL_API void edax_redo ( )

redo command.

◆ edax_rotate()

DLL_API void edax_rotate ( const int  angle)

rotate command.

Parameters
angleangle for rotation

◆ edax_save()

DLL_API void edax_save ( const char *  file)

save command.

Parameters
filefile name to save

◆ edax_set_option()

DLL_API void edax_set_option ( const char *  option_name,
const char *  val 
)

set (option) command.

Parameters
option_namename of option.
valvalue to set.

◆ edax_setboard()

DLL_API void edax_setboard ( const char *  board)

setboard command.

Parameters
boardboard to set

◆ edax_setboard_from_obj()

DLL_API void edax_setboard_from_obj ( const Board board,
const int  turn 
)

setboard command with board object.

Parameters
boardboard to set
turnplayer to play

◆ edax_stop()

DLL_API void edax_stop ( )

stop command.

◆ edax_symetry()

DLL_API void edax_symetry ( const int  sym)

symetry command.

Parameters
symsymetry.

◆ edax_undo()

DLL_API void edax_undo ( )

undo command.

◆ edax_vmirror()

DLL_API void edax_vmirror ( )

vmirror command.

◆ libedax_initialize()

DLL_API void libedax_initialize ( int  argc,
char **  argv 
)

edax init function for library use.

Parameters
argcNumber of arguments.
argvCommand line arguments.

◆ libedax_observer()

static void libedax_observer ( Result result)
static

default search oberver for libedax.

Parameters
resultSearch Result.

◆ libedax_terminate()

DLL_API void libedax_terminate ( )

edax terminate function for library use.

◆ ui_free_libedax()

void ui_free_libedax ( UI ui)

free resources used by libedax api.

Parameters
uiuser interface.

◆ ui_init_libedax()

void ui_init_libedax ( UI ui)

initialize libedax api.

Parameters
uiuser interface.

◆ version()

void version ( void  )

Print version & copyright.

Variable Documentation

◆ book_verbose

bool book_verbose

◆ g_ui

UI* g_ui