Updated italian translation
[midnight-commander.git] / src / global.h
blobb66b3b3cb2204641845e6b1978a852247ec00931
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 useful 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 HAVE_SYS_PARAM_H
24 # include <sys/param.h>
25 #endif
27 #ifdef HAVE_FCNTL_H
28 # include <fcntl.h>
29 #endif
31 /* The O_BINARY definition was taken from gettext */
32 #if !defined O_BINARY && defined _O_BINARY
33 /* For MSC-compatible compilers. */
34 # define O_BINARY _O_BINARY
35 #endif
36 #ifdef __BEOS__
37 /* BeOS 5 has O_BINARY, but is has no effect. */
38 # undef O_BINARY
39 #endif
40 /* On reasonable systems, binary I/O is the default. */
41 #ifndef O_BINARY
42 # define O_BINARY 0
43 #endif
46 /* Replacement for O_NONBLOCK */
47 #ifndef O_NONBLOCK
48 #ifdef O_NDELAY /* SYSV */
49 #define O_NONBLOCK O_NDELAY
50 #else /* BSD */
51 #define O_NONBLOCK FNDELAY
52 #endif /* !O_NDELAY */
53 #endif /* !O_NONBLOCK */
56 #ifdef HAVE_SYS_TIMEB_H
57 # include <sys/timeb.h>
58 #endif
60 #ifdef TIME_WITH_SYS_TIME
61 # include <sys/time.h>
62 # include <time.h>
63 #else
64 # ifdef HAVE_SYS_TIME_H
65 # include <sys/time.h>
66 # else
67 # include <time.h>
68 # endif
69 #endif
71 #if !defined(HAVE_SYS_TIME_H)
72 struct timeval {
73 long int tv_sec; /* seconds */
74 long int tv_usec; /* microseconds */
76 #endif /* !HAVE_SYS_TIME_H */
78 #ifdef HAVE_UTIME_H
79 # include <utime.h>
80 #elif defined(HAVE_SYS_UTIME_H)
81 # include <sys/utime.h>
82 #endif
84 #ifdef HAVE_SYS_WAIT_H
85 # include <sys/wait.h>
86 #endif
88 #ifdef HAVE_SYS_SELECT_H
89 # include <sys/select.h>
90 #endif
92 #ifdef HAVE_GRP_H
93 # include <grp.h>
94 #endif
96 #ifdef HAVE_PWD_H
97 # include <pwd.h>
98 #endif
100 #if defined(__QNX__) && !defined(__QNXNTO__)
101 /* exec*() from <process.h> */
102 # include <unix.h>
103 #endif
105 #include <glib.h>
106 #include "glibcompat.h"
108 #if defined(HAVE_RX_H) && defined(HAVE_REGCOMP)
109 #include <rx.h>
110 #else
111 #include "eregex.h"
112 #endif
114 #ifndef __GNUC__
115 # define __attribute__(x)
116 #endif
118 #ifndef HAVE_GETUID
119 # define getuid() 0
120 #endif
121 #ifndef HAVE_GETGID
122 # define getgid() 0
123 #endif
124 #ifndef HAVE_GETEUID
125 # define geteuid() getuid()
126 #endif
127 #ifndef HAVE_GETEGID
128 # define getegid() getgid()
129 #endif
131 #ifdef ENABLE_NLS
132 # include <libintl.h>
133 # define _(String) gettext (String)
134 # ifdef gettext_noop
135 # define N_(String) gettext_noop (String)
136 # else
137 # define N_(String) (String)
138 # endif
139 #else /* Stubs that do something close enough. */
140 # define textdomain(String)
141 # define gettext(String) (String)
142 # define dgettext(Domain,Message) (Message)
143 # define dcgettext(Domain,Message,Type) (Message)
144 # define bindtextdomain(Domain,Directory)
145 # define _(String) (String)
146 # define N_(String) (String)
147 #endif /* !ENABLE_NLS */
149 #include "fs.h"
150 #include "util.h"
152 #include "textconf.h"
154 #ifdef USE_VFS
155 #include "../vfs/vfs.h"
156 #else
157 #include "vfsdummy.h"
158 #endif
160 extern const char *home_dir;
162 #ifdef min
163 #undef min
164 #endif
166 #ifdef max
167 #undef max
168 #endif
170 #define min(x, y) ((x) > (y) ? (y) : (x))
171 #define max(x, y) ((x) > (y) ? (x) : (y))
173 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
174 #define BUF_10K 10240L
175 #define BUF_8K 8192L
176 #define BUF_4K 4096L
177 #define BUF_1K 1024L
179 #define BUF_LARGE BUF_1K
180 #define BUF_MEDIUM 512
181 #define BUF_SMALL 128
182 #define BUF_TINY 64
184 void refresh_screen (void *);
186 /* AIX compiler doesn't understand '\e' */
187 #define ESC_CHAR '\033'
188 #define ESC_STR "\033"
190 /* C++ style type casts */
191 #define const_cast(m_type, m_expr) ((m_type) (m_expr))
193 #if 0
194 #ifdef MC_ENABLE_DEBUGGING_CODE
195 # undef NDEBUG
196 #else
197 # define NDEBUG
198 #endif
199 #include <assert.h>
200 #endif
202 #endif