X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmisc.h;h=70fc01ebfec08d4e5774db30d0fa2c38eb6f8b0c;hp=6c451934997ba63fd91c8cb7e7fa53571d33530a;hb=ad43ce143664953087b44dd3b4324f77c212bd46;hpb=6738b65be97af10e4b5b783dc8ad21ae0faf36a8 diff --git a/src/misc.h b/src/misc.h index 6c451934..70fc01eb 100644 --- a/src/misc.h +++ b/src/misc.h @@ -20,20 +20,18 @@ #if !defined(MISC_H_INCLUDED) #define MISC_H_INCLUDED +#include #include + +#include "lock.h" #include "types.h" -extern const std::string engine_name(); -extern const std::string engine_author(); -extern int get_system_time(); +extern const std::string engine_info(bool to_uci = false); +extern int system_time(); extern int cpu_count(); -extern int input_available(); +extern void timed_wait(WaitCondition*, Lock*, int); extern void prefetch(char* addr); -extern void prefetchTables(Key pKey, Key mKey, int threadID); -// Debug functions -extern bool dbg_show_mean; -extern bool dbg_show_hit_rate; extern void dbg_hit_on(bool b); extern void dbg_hit_on_c(bool c, bool b); extern void dbg_before(); @@ -42,4 +40,14 @@ extern void dbg_mean_of(int v); extern void dbg_print_hit_rate(); extern void dbg_print_mean(); +class Position; +extern Move move_from_uci(const Position& pos, const std::string& str); +extern const std::string move_to_uci(Move m, bool chess960); +extern const std::string move_to_san(Position& pos, Move m); + +struct Log : public std::ofstream { + Log(const std::string& f = "log.txt") : std::ofstream(f.c_str(), std::ios::out | std::ios::app) {} + ~Log() { if (is_open()) close(); } +}; + #endif // !defined(MISC_H_INCLUDED)