3 * \brief Header: %global definitions for compatibility
5 * This file should be included after all system includes and before all local includes.
12 #include <stdlib.h> /* for free() and other useful routins */
14 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
16 /* An ANSI string.h and pre-ANSI memory.h might conflict */
17 # if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
19 # endif /* !STDC_HEADERS & HAVE_MEMORY_H */
21 #else /* !STDC_HEADERS & !HAVE_STRING_H */
23 /* memory and strings.h conflict on other systems */
24 #endif /* !STDC_HEADERS & !HAVE_STRING_H */
26 #ifdef HAVE_SYS_PARAM_H
27 # include <sys/param.h>
34 /* The O_BINARY definition was taken from gettext */
35 #if !defined O_BINARY && defined _O_BINARY
36 /* For MSC-compatible compilers. */
37 # define O_BINARY _O_BINARY
40 /* BeOS 5 has O_BINARY, but is has no effect. */
43 /* On reasonable systems, binary I/O is the default. */
49 /* Replacement for O_NONBLOCK */
51 #ifdef O_NDELAY /* SYSV */
52 #define O_NONBLOCK O_NDELAY
54 #define O_NONBLOCK FNDELAY
55 #endif /* !O_NDELAY */
56 #endif /* !O_NONBLOCK */
59 #ifdef HAVE_SYS_TIMEB_H
60 # include <sys/timeb.h>
63 #ifdef TIME_WITH_SYS_TIME
64 # include <sys/time.h>
67 # ifdef HAVE_SYS_TIME_H
68 # include <sys/time.h>
74 #if !defined(HAVE_SYS_TIME_H)
76 long int tv_sec
; /* seconds */
77 long int tv_usec
; /* microseconds */
79 #endif /* !HAVE_SYS_TIME_H */
83 #elif defined(HAVE_SYS_UTIME_H)
84 # include <sys/utime.h>
87 #ifdef HAVE_SYS_WAIT_H
88 # include <sys/wait.h>
91 #ifdef HAVE_SYS_SELECT_H
92 # include <sys/select.h>
103 #if defined(__QNX__) && !defined(__QNXNTO__)
104 /* exec*() from <process.h> */
109 #include "glibcompat.h"
112 # define __attribute__(x)
122 # define geteuid() getuid()
125 # define getegid() getgid()
129 # include <libintl.h>
130 # define _(String) gettext (String)
132 # define N_(String) gettext_noop (String)
134 # define N_(String) (String)
136 #else /* Stubs that do something close enough. */
137 # define textdomain(String)
138 # define gettext(String) (String)
139 # define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
140 # define dgettext(Domain,Message) (Message)
141 # define dcgettext(Domain,Message,Type) (Message)
142 # define bindtextdomain(Domain,Directory)
143 # define _(String) (String)
144 # define N_(String) (String)
145 #endif /* !ENABLE_NLS */
150 #include "textconf.h"
153 #include "../vfs/vfs.h"
155 #include "vfsdummy.h"
158 extern const char *home_dir
;
168 #define min(x, y) ((x) > (y) ? (y) : (x))
169 #define max(x, y) ((x) > (y) ? (x) : (y))
171 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
172 #define BUF_10K 10240L
177 #define BUF_LARGE BUF_1K
178 #define BUF_MEDIUM 512
179 #define BUF_SMALL 128
182 void refresh_screen (void *);
184 /* AIX compiler doesn't understand '\e' */
185 #define ESC_CHAR '\033'
186 #define ESC_STR "\033"
188 /* C++ style type casts */
189 #define const_cast(m_type, m_expr) ((m_type) (m_expr))
192 #ifdef MC_ENABLE_DEBUGGING_CODE