Moved filemanager-related stuff to src/filemanager directory
[pantumic.git] / lib / global.h
bloba2d963a027cad3e590f7d52d757a1f37fc10796c
1 /** \file global.h
2 * \brief Header: %global definitions for compatibility
4 * This file should be included after all system includes and before all local includes.
5 */
7 #ifndef MC_GLOBAL_H
8 #define MC_GLOBAL_H
10 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
11 #include <string.h>
12 /* An ANSI string.h and pre-ANSI memory.h might conflict */
13 #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
14 #include <memory.h>
15 #endif /* !STDC_HEADERS & HAVE_MEMORY_H */
17 #else /* !STDC_HEADERS & !HAVE_STRING_H */
18 #include <strings.h>
19 /* memory and strings.h conflict on other systems */
20 #endif /* !STDC_HEADERS & !HAVE_STRING_H */
22 #ifdef HAVE_SYS_PARAM_H
23 #include <sys/param.h>
24 #endif
26 /*** typedefs(not structures) and defined constants **********************************************/
28 /* The O_BINARY definition was taken from gettext */
29 #if !defined O_BINARY && defined _O_BINARY
30 /* For MSC-compatible compilers. */
31 #define O_BINARY _O_BINARY
32 #endif
33 #ifdef __BEOS__
34 /* BeOS 5 has O_BINARY, but is has no effect. */
35 #undef O_BINARY
36 #endif
37 /* On reasonable systems, binary I/O is the default. */
38 #ifndef O_BINARY
39 #define O_BINARY 0
40 #endif
42 /* Replacement for O_NONBLOCK */
43 #ifndef O_NONBLOCK
44 #ifdef O_NDELAY /* SYSV */
45 #define O_NONBLOCK O_NDELAY
46 #else /* BSD */
47 #define O_NONBLOCK FNDELAY
48 #endif /* !O_NDELAY */
49 #endif /* !O_NONBLOCK */
51 #ifdef HAVE_SYS_SELECT_H
52 #include <sys/select.h>
53 #endif
55 #if defined(__QNX__) && !defined(__QNXNTO__)
56 /* exec*() from <process.h> */
57 #include <unix.h>
58 #endif
60 #include <glib.h>
61 #include "glibcompat.h"
63 #ifndef __GNUC__
64 #define __attribute__(x)
65 #endif
67 #ifdef ENABLE_NLS
68 #include <libintl.h>
69 #define _(String) gettext (String)
70 #ifdef gettext_noop
71 #define N_(String) gettext_noop (String)
72 #else
73 #define N_(String) (String)
74 #endif
75 #else /* Stubs that do something close enough. */
76 #define textdomain(String)
77 #define gettext(String) (String)
78 #define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
79 #define dgettext(Domain,Message) (Message)
80 #define dcgettext(Domain,Message,Type) (Message)
81 #define bindtextdomain(Domain,Directory)
82 #define _(String) (String)
83 #define N_(String) (String)
84 #endif /* !ENABLE_NLS */
86 #include "fs.h"
88 #ifdef USE_MAINTAINER_MODE
89 #include "lib/logging.h"
90 #endif
92 #ifdef min
93 #undef min
94 #endif
96 #ifdef max
97 #undef max
98 #endif
100 #define min(x, y) ((x) > (y) ? (y) : (x))
101 #define max(x, y) ((x) > (y) ? (x) : (y))
103 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
104 #define BUF_10K 10240L
105 #define BUF_8K 8192L
106 #define BUF_4K 4096L
107 #define BUF_1K 1024L
109 #define BUF_LARGE BUF_1K
110 #define BUF_MEDIUM 512
111 #define BUF_SMALL 128
112 #define BUF_TINY 64
114 /* AIX compiler doesn't understand '\e' */
115 #define ESC_CHAR '\033'
116 #define ESC_STR "\033"
118 /* OS specific defines */
119 #define PATH_SEP '/'
120 #define PATH_SEP_STR "/"
121 #define PATH_ENV_SEP ':'
122 #define TMPDIR_DEFAULT "/tmp"
123 #define SCRIPT_SUFFIX ""
124 #define get_default_editor() "vi"
125 #define OS_SORT_CASE_SENSITIVE_DEFAULT 1
127 /* C++ style type casts */
128 #define const_cast(m_type, m_expr) ((m_type) (m_expr))
130 #if 0
131 #ifdef MC_ENABLE_DEBUGGING_CODE
132 #undef NDEBUG
133 #else
134 #define NDEBUG
135 #endif
136 #include <assert.h>
137 #endif
139 #define MC_ERROR mc_main_error_quark ()
141 /*** enums ***************************************************************************************/
143 /*** structures declarations (and typedefs of structures)*****************************************/
145 /*** global variables defined in .c file *********************************************************/
147 /*** declarations of public functions ************************************************************/
149 void refresh_screen (void *);
150 GQuark mc_main_error_quark (void);
152 /*** inline functions ****************************************************************************/
153 #endif