3 * Copyright (c) 1998-2001, Darren Hiebert
5 * This source code is released for free distribution under the terms of the
6 * GNU General Public License.
8 * Provides the general (non-ctags-specific) environment assumed by all.
23 /* include unistd.h preventively because at least under MacOSX it is needed for off_t */
30 /* This is a helpful internal feature of later versions (> 2.7) of GCC
31 * to prevent warnings about unused variables.
33 #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) && !(defined (__APPLE_CC__) || defined (__GNUG__))
34 # define UNUSED __attribute__((unused))
35 # define PRINTF(s,f) __attribute__((format (printf, s, f)))
42 /* MS-DOS doesn't allow manipulation of standard error, so we send it to
45 #if defined (MSDOS) || defined (WIN32)
46 # define errout stdout
48 # define errout stderr
51 #if defined (__CYGWIN__)
52 # define UNIX_PATH_SEPARATOR 1
53 # define MSDOS_STYLE_PATH
56 #if defined (MSDOS) || defined (WIN32)
57 # define CASE_INSENSITIVE_FILENAMES
58 # define MSDOS_STYLE_PATH
60 # define HAVE_FCNTL_H 1
62 # define HAVE_STDLIB_H 1
63 # define HAVE_SYS_STAT_H 1
64 # define HAVE_SYS_TYPES_H 1
65 # define HAVE_TIME_H 1
67 # define HAVE_CHSIZE 1
68 # define HAVE_FGETPOS 1
69 # define HAVE_STRICMP 1
70 # define HAVE_STRNICMP 1
71 # define HAVE_STRSTR 1
72 # define HAVE_STRERROR 1
73 # define HAVE_FINDNEXT 1
76 # define HAVE_DIRENT_H 1
77 # define HAVE_FINDFIRST 1
78 # elif defined (_MSC_VER)
79 # define HAVE__FINDFIRST 1
80 # define HAVE_DIRECT_H 1
81 # elif defined (__MINGW32__)
83 # define HAVE_DIRENT_H 1
84 # define HAVE__FINDFIRST 1
85 # define ffblk _finddata_t
86 # define FA_DIREC _A_SUBDIR
89 /* provide the prototype for cross-compiling/Windows */
90 char *lrealpath(const char *filename
);
93 #ifndef HAVE_FNMATCH_H
94 /* provide the prototype for cross-compiling/Windows */
95 int fnmatch(const char *pattern
, const char *string
, int flags
);
99 # define CASE_INSENSITIVE_FILENAMES
100 # define MSDOS_STYLE_PATH
101 # define HAVE_DIR_H 1
102 # define HAVE_SYS_STAT_H 1
103 # define HAVE_SYS_TYPES_H 1
104 # define HAVE_UNISTD_H 1
105 # define HAVE_FGETPOS 1
106 # define HAVE_FINDFIRST 1
107 # define HAVE_TRUNCATE 1
111 # define UNIX_PATH_SEPARATOR 1
112 # define CASE_INSENSITIVE_FILENAMES
113 # define HAVE_DIRENT_H 1
114 # define HAVE_FCNTL_H 1
116 # define HAVE_STDLIB_H 1
117 # define HAVE_SYS_STAT_H 1
118 # define HAVE_SYS_TYPES_H 1
119 # define HAVE_TIME_H 1
120 # define HAVE_UNISTD_H 1
121 # define HAVE_CLOCK 1
122 # define HAVE_CHSIZE 1
123 # define HAVE_FGETPOS 1
124 # define HAVE_FTRUNCATE 1
125 # define HAVE_OPENDIR 1
126 # define HAVE_REGCOMP 1
127 # define HAVE_REMOVE 1
128 # define HAVE_STRERROR 1
129 # define HAVE_STRICMP 1
130 # define HAVE_STRNICMP 1
131 # define HAVE_STRSTR 1
132 # define HAVE_TRUNCATE 1
136 # define HAVE_STDLIB_H 1
137 # define HAVE_SYS_STAT_H 1
138 # define HAVE_SYS_TYPES_H 1
139 # define HAVE_TIME_H 1
140 # define HAVE_CLOCK 1
141 # define HAVE_FGETPOS 1
142 # define HAVE_STRERROR 1
143 # define HAVE_STRICMP 1
144 # define HAVE_STRNICMP 1
147 #if defined (__MWERKS__) && defined (__MACINTOSH__)
148 # define HAVE_STAT_H 1
152 # define HAVE_DIRENT_H 1
153 # define HAVE_STDLIB_H 1
154 # define HAVE_SYS_STAT_H 1
155 # define HAVE_SYS_TIMES_H 1
156 # define HAVE_SYS_TYPES_H 1
157 # define HAVE_TIME_H 1
158 # define HAVE_UNISTD_H 1
159 # define STDC_HEADERS 1
160 # define HAVE_CLOCK 1
161 # define HAVE_FGETPOS 1
162 # define HAVE_FTRUNCATE 1
163 # define HAVE_OPENDIR 1
164 # define HAVE_PUTENV 1
165 # define HAVE_REMOVE 1
166 # define HAVE_STRERROR 1
167 # define HAVE_STRSTR 1
168 # define HAVE_TIMES 1
169 # define HAVE_TRUNCATE 1
170 # define NON_CONST_PUTENV_PROTOTYPE 1
173 #if defined (__vms) && ! defined (VMS)
177 # define CASE_INSENSITIVE_FILENAMES 1
178 # define HAVE_STDLIB_H 1
179 # define HAVE_TIME_H 1
181 # define HAVE_STAT_H 1
182 # define HAVE_TYPES_H 1
184 # define HAVE_FCNTL_H 1
185 # define HAVE_SYS_STAT_H 1
186 # define HAVE_SYS_TYPES_H 1
188 # define HAVE_CLOCK 1
189 # define HAVE_FGETPOS 1
190 # define HAVE_STRERROR 1
191 # define HAVE_STRSTR 1
192 # define HAVE_UNISTD_H 1
196 #include <sys/types.h>
197 #endif /* __FreeBSD__ */
199 /* Define regex if supported */
200 #if (defined (HAVE_REGCOMP) && !defined (REGCOMP_BROKEN)) || defined (HAVE_RE_COMPILE_PATTERN)
201 # define HAVE_REGEX 1
205 /* fake debug statement macro */
206 #define DebugStatement(x) ;
207 #define PrintStatus(x) ;
208 /* wrap g_warning so we don't include glib.h for all parsers, to keep compat with CTags */
209 void utils_warn(const char *msg
);
210 #define Assert(x) if (!(x)) utils_warn("Assert(" #x ") failed!")
218 typedef enum { FALSE
, TRUE
} booleanType
;
222 typedef bool boolean
;
226 typedef enum { FALSE
, TRUE
} boolean
;
230 #if ! defined (HAVE_FGETPOS) && ! defined (fpos_t)
234 /* Work-around for broken implementation of fgetpos()/fsetpos() on Mingw32 */
235 #if defined (__MINGW32__) && defined (__MSVCRT__)
240 * FUNCTION PROTOTYPES
243 #if defined (NEED_PROTO_REMOVE) && defined (HAVE_REMOVE)
244 extern int remove (const char *);
247 #if defined (NEED_PROTO_UNLINK) && ! defined (HAVE_REMOVE)
248 extern void *unlink (const char *);
251 #ifdef NEED_PROTO_GETENV
252 extern char *getenv (const char *);
255 #endif /* _GENERAL_H */
257 /* vi:set tabstop=8 shiftwidth=4: */