Activate reordering or files to help integration into linux distributions
[hashcat.git] / include / common.h
1 /**
2 * Author......: Jens Steube <jens.steube@gmail.com>
3 * License.....: MIT
4 */
5
6 #ifndef COMMON_H
7 #define COMMON_H
8
9 #define _POSIX_SOURCE
10 #define _GNU_SOURCE
11 #define _FILE_OFFSET_BITS 64
12 #define _CRT_SECURE_NO_WARNINGS
13
14 #include <stdarg.h>
15 #include <stdint.h>
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <string.h>
19 #include <errno.h>
20 #include <getopt.h>
21 #include <math.h>
22 #include <ctype.h>
23 #include <dirent.h>
24 #include <time.h>
25 #include <unistd.h>
26 #include <signal.h>
27 #include <sys/stat.h>
28 #include <sys/types.h>
29 #include <search.h>
30
31 #ifdef _POSIX
32 #include <sys/time.h>
33 #include <pthread.h>
34 #include <semaphore.h>
35 #include <dlfcn.h>
36 #include <pwd.h>
37
38 #ifdef LINUX
39 #include <termio.h>
40 #endif
41
42 #ifdef OSX
43 #include <termios.h>
44 #include <sys/ioctl.h>
45 #endif
46
47 typedef void *HM_LIB;
48 #endif
49
50 #ifdef _WIN
51 #define WIN32_LEAN_AND_MEAN
52 #include <windows.h>
53 #include <process.h>
54 #include <conio.h>
55 #include <tchar.h>
56 #include <psapi.h>
57 #include <io.h>
58 #include <fcntl.h>
59
60 typedef UINT8 uint8_t;
61 typedef UINT16 uint16_t;
62 typedef UINT32 uint32_t;
63 typedef UINT64 uint64_t;
64 typedef INT8 int8_t;
65 typedef INT16 int16_t;
66 typedef INT32 int32_t;
67 typedef INT64 int64_t;
68
69 typedef UINT32 uint;
70 typedef UINT64 uint64_t;
71
72 typedef HINSTANCE HM_LIB;
73
74 #define mkdir(name,mode) mkdir (name)
75
76 #endif
77
78 #define SPEED_CACHE 128
79 #define SPEED_MAXAGE 4096
80
81 #undef BUFSIZ
82 #define BUFSIZ 8192
83
84 /**
85 * functions
86 */
87
88 void log_out_nn (FILE *fp, const char *fmt, ...);
89 void log_info_nn (const char *fmt, ...);
90 void log_error_nn (const char *fmt, ...);
91
92 void log_out (FILE *fp, const char *fmt, ...);
93 void log_info (const char *fmt, ...);
94 void log_error (const char *fmt, ...);
95
96 typedef uint32_t uint; // we should rename to u32, sooner or later, for consistency
97 typedef uint64_t u64;
98
99 #endif