Last fuzzy trimmed...
[midnight-commander.git] / src / global.h
blob3e9850e973fbfbb317db4f857c7ae72e4cd1f036
1 /*
2 * This file should be included after all system includes and before
3 * all local includes.
4 */
6 #ifndef __MC_GLOBAL_H
7 #define __MC_GLOBAL_H
9 #include <stdlib.h> /* for free() and other usefull routins */
11 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
12 # include <string.h>
13 /* An ANSI string.h and pre-ANSI memory.h might conflict */
14 # if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
15 # include <memory.h>
16 # endif /* !STDC_HEADERS & HAVE_MEMORY_H */
18 #else /* !STDC_HEADERS & !HAVE_STRING_H */
19 # include <strings.h>
20 /* memory and strings.h conflict on other systems */
21 #endif /* !STDC_HEADERS & !HAVE_STRING_H */
23 #ifdef _OS_NT
24 # include <windows.h>
25 # include <io.h>
26 #ifdef _MSC_VER
27 # include <direct.h> /* from mkdir() */
28 #endif
29 #endif
31 #ifdef HAVE_SYS_PARAM_H
32 # include <sys/param.h>
33 #endif
35 #ifdef HAVE_SYS_TIMEB_H
36 # include <sys/timeb.h>
37 #endif
39 #ifdef TIME_WITH_SYS_TIME
40 # include <sys/time.h>
41 # include <time.h>
42 #else
43 # ifdef HAVE_SYS_TIME_H
44 # include <sys/time.h>
45 # else
46 # include <time.h>
47 # endif
48 #endif
50 #if !defined(HAVE_SYS_TIME_H) && !defined(_OS_NT)
51 struct timeval {
52 long int tv_sec; /* seconds */
53 long int tv_usec; /* microseconds */
55 #endif /* !HAVE_SYS_TIME_H */
57 #ifdef HAVE_UTIME_H
58 # include <utime.h>
59 #elif defined(HAVE_SYS_UTIME_H)
60 # include <sys/utime.h>
61 #endif
63 #ifdef HAVE_SYS_WAIT_H
64 # include <sys/wait.h>
65 #endif
67 #ifdef HAVE_SYS_SELECT_H
68 # include <sys/select.h>
69 #endif
71 #ifdef HAVE_GRP_H
72 # include <grp.h>
73 #endif
75 #ifdef HAVE_PWD_H
76 # include <pwd.h>
77 #endif
79 #if defined(__QNX__) && !defined(__QNXNTO__)
80 /* exec*() from <process.h> */
81 # include <unix.h>
82 #endif
84 #include <glib.h>
86 #if defined(HAVE_RX_H) && defined(HAVE_REGCOMP)
87 #include <rx.h>
88 #else
89 #include "eregex.h"
90 #endif
92 #ifndef __GNUC__
93 # define __attribute__(x)
94 #endif
96 #ifndef HAVE_GETUID
97 # define getuid() 0
98 #endif
99 #ifndef HAVE_GETGID
100 # define getgid() 0
101 #endif
102 #ifndef HAVE_GETEUID
103 # define geteuid() getuid()
104 #endif
105 #ifndef HAVE_GETEGID
106 # define getegid() getgid()
107 #endif
109 #include "fs.h"
110 #include "util.h"
112 #include "textconf.h"
113 #include "../vfs/vfs.h"
115 extern char *home_dir;
117 #ifdef min
118 #undef min
119 #endif
121 #ifdef max
122 #undef max
123 #endif
125 #define min(x, y) ((x) > (y) ? (y) : (x))
126 #define max(x, y) ((x) > (y) ? (x) : (y))
128 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
129 #define BUF_10K 10240L
130 #define BUF_8K 8192L
131 #define BUF_4K 4096L
132 #define BUF_1K 1024L
134 #define BUF_LARGE BUF_1K
135 #define BUF_MEDIUM 512
136 #define BUF_SMALL 128
137 #define BUF_TINY 64
139 void refresh_screen (void *);
141 /* AIX compiler doesn't understand '\e' */
142 #define ESC_CHAR '\033'
143 #define ESC_STR "\033"
145 #define xgetch getch
147 #endif /* !__MC_GLOBAL_H */