updated the .TP cleanup for coherency in the key description pages.
[midnight-commander.git] / src / global.h
blobc51fab24e374f58e46e5f55f522f19300db34cbd
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 NATIVE_WIN32
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_FCNTL_H
36 # include <fcntl.h>
37 #endif
39 /* The O_BINARY definition was taken from gettext */
40 #if !defined O_BINARY && defined _O_BINARY
41 /* For MSC-compatible compilers. */
42 # define O_BINARY _O_BINARY
43 #endif
44 #ifdef __BEOS__
45 /* BeOS 5 has O_BINARY, but is has no effect. */
46 # undef O_BINARY
47 #endif
48 /* On reasonable systems, binary I/O is the default. */
49 #ifndef O_BINARY
50 # define O_BINARY 0
51 #endif
53 #ifdef HAVE_SYS_TIMEB_H
54 # include <sys/timeb.h>
55 #endif
57 #ifdef TIME_WITH_SYS_TIME
58 # include <sys/time.h>
59 # include <time.h>
60 #else
61 # ifdef HAVE_SYS_TIME_H
62 # include <sys/time.h>
63 # else
64 # include <time.h>
65 # endif
66 #endif
68 #if !defined(HAVE_SYS_TIME_H) && !defined(NATIVE_WIN32)
69 struct timeval {
70 long int tv_sec; /* seconds */
71 long int tv_usec; /* microseconds */
73 #endif /* !HAVE_SYS_TIME_H */
75 #ifdef HAVE_UTIME_H
76 # include <utime.h>
77 #elif defined(HAVE_SYS_UTIME_H)
78 # include <sys/utime.h>
79 #endif
81 #ifdef HAVE_SYS_WAIT_H
82 # include <sys/wait.h>
83 #endif
85 #ifdef HAVE_SYS_SELECT_H
86 # include <sys/select.h>
87 #endif
89 #ifdef HAVE_GRP_H
90 # include <grp.h>
91 #endif
93 #ifdef HAVE_PWD_H
94 # include <pwd.h>
95 #endif
97 #if defined(__QNX__) && !defined(__QNXNTO__)
98 /* exec*() from <process.h> */
99 # include <unix.h>
100 #endif
102 #include <glib.h>
104 #if defined(HAVE_RX_H) && defined(HAVE_REGCOMP)
105 #include <rx.h>
106 #else
107 #include "eregex.h"
108 #endif
110 #ifndef __GNUC__
111 # define __attribute__(x)
112 #endif
114 #ifndef HAVE_GETUID
115 # define getuid() 0
116 #endif
117 #ifndef HAVE_GETGID
118 # define getgid() 0
119 #endif
120 #ifndef HAVE_GETEUID
121 # define geteuid() getuid()
122 #endif
123 #ifndef HAVE_GETEGID
124 # define getegid() getgid()
125 #endif
127 #include "fs.h"
128 #include "util.h"
130 #include "textconf.h"
131 #include "../vfs/vfs.h"
133 extern char *home_dir;
135 #ifdef min
136 #undef min
137 #endif
139 #ifdef max
140 #undef max
141 #endif
143 #define min(x, y) ((x) > (y) ? (y) : (x))
144 #define max(x, y) ((x) > (y) ? (x) : (y))
146 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
147 #define BUF_10K 10240L
148 #define BUF_8K 8192L
149 #define BUF_4K 4096L
150 #define BUF_1K 1024L
152 #define BUF_LARGE BUF_1K
153 #define BUF_MEDIUM 512
154 #define BUF_SMALL 128
155 #define BUF_TINY 64
157 void refresh_screen (void *);
159 /* AIX compiler doesn't understand '\e' */
160 #define ESC_CHAR '\033'
161 #define ESC_STR "\033"
163 #endif /* !__MC_GLOBAL_H */