+/// The LimitsType struct stores information sent by GUI about available time
+/// to search the current move, maximum depth/time, if we are in analysis mode
+/// or if we have to ponder while it's our opponent's turn to move.
+
+struct LimitsType {
+
+ LimitsType() { std::memset(this, 0, sizeof(LimitsType)); }
+ bool use_time_management() const { return !(mate | movetime | depth | nodes | infinite); }
+
+ std::vector<Move> searchmoves;
+ int time[COLOR_NB], inc[COLOR_NB], movestogo, depth, nodes, movetime, mate, infinite, ponder;
+};
+
+
+/// The SignalsType struct stores volatile flags updated during the search
+/// typically in an async fashion e.g. to stop the search by the GUI.
+
+struct SignalsType {
+ bool stop, stopOnPonderhit, firstRootMove, failedLowAtRoot;
+};
+
+typedef std::auto_ptr<std::stack<StateInfo> > StateStackPtr;
+
+extern volatile SignalsType Signals;
+extern LimitsType Limits;
+extern std::vector<RootMove> RootMoves;
+extern Position RootPos;
+extern Color RootColor;
+extern Time::point SearchTime, IterationTime;
+extern StateStackPtr SetupStates;
+
+extern void init();
+extern uint64_t perft(Position& pos, Depth depth);
+extern void think();