2 * This file should be included after all system includes and before
9 #include <stdlib.h> /* for free() and other useful routins */
11 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
13 /* An ANSI string.h and pre-ANSI memory.h might conflict */
14 # if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
16 # endif /* !STDC_HEADERS & HAVE_MEMORY_H */
18 #else /* !STDC_HEADERS & !HAVE_STRING_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>
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
37 /* BeOS 5 has O_BINARY, but is has no effect. */
40 /* On reasonable systems, binary I/O is the default. */
46 /* Replacement for O_NONBLOCK */
48 #ifdef O_NDELAY /* SYSV */
49 #define O_NONBLOCK O_NDELAY
51 #define O_NONBLOCK FNDELAY
52 #endif /* !O_NDELAY */
53 #endif /* !O_NONBLOCK */
56 #ifdef HAVE_SYS_TIMEB_H
57 # include <sys/timeb.h>
60 #ifdef TIME_WITH_SYS_TIME
61 # include <sys/time.h>
64 # ifdef HAVE_SYS_TIME_H
65 # include <sys/time.h>
71 #if !defined(HAVE_SYS_TIME_H)
73 long int tv_sec
; /* seconds */
74 long int tv_usec
; /* microseconds */
76 #endif /* !HAVE_SYS_TIME_H */
80 #elif defined(HAVE_SYS_UTIME_H)
81 # include <sys/utime.h>
84 #ifdef HAVE_SYS_WAIT_H
85 # include <sys/wait.h>
88 #ifdef HAVE_SYS_SELECT_H
89 # include <sys/select.h>
100 #if defined(__QNX__) && !defined(__QNXNTO__)
101 /* exec*() from <process.h> */
106 #include "glibcompat.h"
108 #if defined(HAVE_RX_H) && defined(HAVE_REGCOMP)
115 # define __attribute__(x)
125 # define geteuid() getuid()
128 # define getegid() getgid()
132 # include <libintl.h>
133 # define _(String) gettext (String)
135 # define N_(String) gettext_noop (String)
137 # define N_(String) (String)
139 #else /* Stubs that do something close enough. */
140 # define textdomain(String)
141 # define gettext(String) (String)
142 # define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
143 # define dgettext(Domain,Message) (Message)
144 # define dcgettext(Domain,Message,Type) (Message)
145 # define bindtextdomain(Domain,Directory)
146 # define _(String) (String)
147 # define N_(String) (String)
148 #endif /* !ENABLE_NLS */
153 #include "textconf.h"
156 #include "../vfs/vfs.h"
158 #include "vfsdummy.h"
161 extern const char *home_dir
;
171 #define min(x, y) ((x) > (y) ? (y) : (x))
172 #define max(x, y) ((x) > (y) ? (x) : (y))
174 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
175 #define BUF_10K 10240L
180 #define BUF_LARGE BUF_1K
181 #define BUF_MEDIUM 512
182 #define BUF_SMALL 128
185 void refresh_screen (void *);
187 /* AIX compiler doesn't understand '\e' */
188 #define ESC_CHAR '\033'
189 #define ESC_STR "\033"
191 /* C++ style type casts */
192 #define const_cast(m_type, m_expr) ((m_type) (m_expr))
195 #ifdef MC_ENABLE_DEBUGGING_CODE