#include <semaphore.h>
#include <dlfcn.h>
#include <pwd.h>
+#include <limits.h>
#ifdef LINUX
-#include <termio.h>
+#include <termios.h>
+#include <sys/ioctl.h>
#endif
-#ifdef OSX
+#ifdef DARWIN
#include <termios.h>
#include <sys/ioctl.h>
#include <mach-o/dyld.h>
typedef void *OCL_LIB;
#ifdef HAVE_HWMON
-typedef void *NV_LIB;
-typedef void *AMD_LIB;
-#ifdef OSX
+typedef void *ADL_LIB;
+typedef void *NVAPI_LIB;
+typedef void *NVML_LIB;
+typedef void *XNVCTRL_LIB;
+#ifdef DARWIN
#define __stdcall
#endif
#endif
typedef HINSTANCE OCL_LIB;
#ifdef HAVE_HWMON
-typedef HINSTANCE NV_LIB;
-typedef HINSTANCE AMD_LIB;
+typedef HINSTANCE ADL_LIB;
+typedef HINSTANCE NVAPI_LIB;
+typedef HINSTANCE NVML_LIB;
+typedef HINSTANCE XNVCTRL_LIB;
#endif
#define mkdir(name,mode) mkdir (name)
#define HCBUFSIZ 0x50000 // general large space buffer size in case the size is unknown at compile-time
+#define EXPECTED_ITERATIONS 10000
+
/**
* functions
*/
-void log_out_nn (FILE *fp, const char *fmt, ...);
-void log_info_nn (const char *fmt, ...);
-void log_error_nn (const char *fmt, ...);
+int log_out_nn (FILE *fp, const char *fmt, ...);
+int log_info_nn (const char *fmt, ...);
+int log_error_nn (const char *fmt, ...);
-void log_out (FILE *fp, const char *fmt, ...);
-void log_info (const char *fmt, ...);
-void log_error (const char *fmt, ...);
+int log_out (FILE *fp, const char *fmt, ...);
+int log_info (const char *fmt, ...);
+int log_error (const char *fmt, ...);
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+#define CEIL(a) ((a - (int) (a)) > 0 ? a + 1 : a)
+
#endif // COMMON_H