-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglobal.h
31 lines (26 loc) · 908 Bytes
/
global.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifdef GLOBAL_MAIN
#define GLOBAL
#define GLOBAL_VAL(X) = X
#else
#define GLOBAL extern
#define GLOBAL_VAL(X)
#endif
GLOBAL void (*pelog_th)(int priority, char const *format, ...);
GLOBAL void (*vpelog)(int priority, char const *format, va_list ap);
GLOBAL void (*pelog)(int priority, char const *format, ...);
GLOBAL char const *rule_file_path GLOBAL_VAL("/dev/null");
GLOBAL bool return_bound_address GLOBAL_VAL(true);
GLOBAL pthread_key_t sock_cleaner;
GLOBAL bool first_worker GLOBAL_VAL(true);
GLOBAL pid_t root_process;
#ifdef NDEBUG
GLOBAL int const timeout_greet GLOBAL_VAL(3000);
GLOBAL int const timeout_read_short GLOBAL_VAL(1000);
GLOBAL int const timeout_write GLOBAL_VAL(500);
#else
#define testtoms 0
GLOBAL int const timeout_greet GLOBAL_VAL(testtoms);
GLOBAL int const timeout_read_short GLOBAL_VAL(testtoms);
GLOBAL int const timeout_write GLOBAL_VAL(testtoms);
#undef testtoms
#endif