//#define _ffigen #ifdef _WIN32 #include #else #include #endif #include #include #ifdef _WIN32 #include #else #include #include #endif #ifdef _WIN32 #define FFI_PLUGIN_EXPORT __declspec(dllexport) #else #define FFI_PLUGIN_EXPORT __attribute__((visibility("default"))) __attribute__((used)) #endif // Initialisation of Stockfish. #ifndef _ffigen extern "C" #endif FFI_PLUGIN_EXPORT int stockfish_init(); // Stockfish main loop. #ifndef _ffigen extern "C" #endif FFI_PLUGIN_EXPORT int stockfish_main(); // Writing to Stockfish STDIN. #ifndef _ffigen extern "C" #endif FFI_PLUGIN_EXPORT ssize_t stockfish_stdin_write(char *data); // Reading Stockfish STDOUT #ifndef _ffigen extern "C" #endif FFI_PLUGIN_EXPORT char * stockfish_stdout_read();