X-Git-Url: https://www.flypig.org.uk/git/?a=blobdiff_plain;f=include%2Fcommon.h;h=c36a3e029adb85be56014ecdfb1658960cf4c48f;hb=161a6eb4bc643d8e636e96eda613f5137d30da59;hp=de176b614cc15e376bcd87ad96e51513d7bea40d;hpb=6d37c123a5f0e1169651cb9ab2cc56b16618e88a;p=hashcat.git diff --git a/include/common.h b/include/common.h index de176b6..c36a3e0 100644 --- a/include/common.h +++ b/include/common.h @@ -1,5 +1,7 @@ /** - * Author......: Jens Steube + * Authors.....: Jens Steube + * magnum + * * License.....: MIT */ @@ -36,24 +38,33 @@ #include #include #include +#include -#ifdef LINUX -#include +#ifdef __linux__ +#include +#include #endif -#ifdef OSX +#ifdef __APPLE__ #include #include #include #include #endif +#ifdef __FreeBSD__ +#include +#include +#endif + 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 __APPLE__ #define __stdcall #endif #endif @@ -84,8 +95,10 @@ typedef UINT64 uint64_t; 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) @@ -99,25 +112,30 @@ typedef uint64_t u64; typedef uint32_t uint; // we need to get rid of this sooner or later, for consistency -#define SPEED_CACHE 128 -#define SPEED_MAXAGE 4096 +#define EXEC_CACHE 128 + +#define SPEED_CACHE 128 +#define SPEED_MAXAGE 4096 -#undef BUFSIZ -#define BUFSIZ 8192 +#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