Remove unnecessary include paths in Makefile
[MacVim.git] / src / os_mac.h
blob64f2ae25da7d796b730aa2f161a4cadc8a752005
1 /* vi:set ts=8 sts=4 sw=4:
3 * VIM - Vi IMproved by Bram Moolenaar
5 * Do ":help uganda" in Vim to read copying and usage conditions.
6 * Do ":help credits" in Vim to see a list of people who contributed.
7 */
9 /* Before Including the MacOS specific files,
10 * lets set the OPAQUE_TOOLBOX_STRUCTS to 0 so we
11 * can access the internal structures.
12 * (Until fully Carbon compliant)
13 * TODO: Can we remove this? (Dany)
15 #if 0
16 # define OPAQUE_TOOLBOX_STRUCTS 0
17 #endif
20 * Macintosh machine-dependent things.
22 * Include the Mac header files, unless also compiling with X11 (the header
23 * files have many conflicts).
25 #ifndef FEAT_X11
26 # ifdef FEAT_GUI_MACVIM
27 # include <Carbon/Carbon.h>
28 # else
29 # include <Quickdraw.h> /* Apple calls it QuickDraw.h... */
30 # include <ToolUtils.h>
31 # include <LowMem.h>
32 # include <Scrap.h>
33 # include <Sound.h>
34 # include <TextUtils.h>
35 # include <Memory.h>
36 # include <OSUtils.h>
37 # include <Files.h>
38 # ifdef FEAT_MBYTE
39 # include <Script.h>
40 # endif
41 # endif
42 #endif
45 * Unix interface
47 #if defined(__APPLE_CC__) /* for Project Builder and ... */
48 # include <unistd.h>
49 /* Get stat.h or something similar. Comment: How come some OS get in in vim.h */
50 # include <sys/stat.h>
51 /* && defined(HAVE_CURSE) */
52 /* The curses.h from MacOS X provides by default some BACKWARD compatibilty
53 * definition which can cause us problem later on. So we undefine a few of them. */
54 # include <curses.h>
55 # undef reg
56 # undef ospeed
57 /* OK defined to 0 in MacOS X 10.2 curses! Remove it, we define it to be 1. */
58 # undef OK
59 #endif
60 #include <signal.h>
61 #include <errno.h>
62 #include <stdio.h>
63 #include <stdlib.h>
64 #include <time.h>
65 #include <dirent.h>
68 * MacOS specific #define
71 /* This will go away when CMD_KEY fully tested */
72 #define USE_CMD_KEY
73 /* On MacOS X use the / not the : */
74 /* TODO: Should file such as ~/.vimrc reside instead in
75 * ~/Library/Vim or ~/Library/Preferences/org.vim.vim/ ? (Dany)
77 /* When compiled under MacOS X (including CARBON version)
78 * we use the Unix File path style. Also when UNIX is defined. */
79 # define USE_UNIXFILENAME
83 * Generic Vim #define
86 #define FEAT_SOURCE_FFS
87 #define FEAT_SOURCE_FF_MAC
89 #define USE_EXE_NAME /* to find $VIM */
90 #define CASE_INSENSITIVE_FILENAME /* ignore case when comparing file names */
91 #define SPACE_IN_FILENAME
92 #define BREAKCHECK_SKIP 32 /* call mch_breakcheck() each time, it's
93 quite fast. Did I forgot to update the
94 comment */
97 #define USE_FNAME_CASE /* make ":e os_Mac.c" open the file in its
98 original case, as "os_mac.c" */
99 #define BINARY_FILE_IO
100 #define EOL_DEFAULT EOL_MAC
101 #ifndef MACOS_X_UNIX /* I hope that switching these two lines */
102 # define USE_CR /* does what I want -- BNF */
103 # define NO_CONSOLE /* don't include console mode */
104 #endif
105 #define HAVE_AVAIL_MEM
107 #ifndef HAVE_CONFIG_H
108 /* #define SYNC_DUP_CLOSE sync() a file with dup() and close() */
109 # define HAVE_STRING_H
110 # define HAVE_STRCSPN
111 # define HAVE_MEMSET
112 # define USE_TMPNAM /* use tmpnam() instead of mktemp() */
113 # define HAVE_FCNTL_H
114 # define HAVE_QSORT
115 # define HAVE_ST_MODE /* have stat.st_mode */
116 # define HAVE_MATH_H
118 # if defined(__DATE__) && defined(__TIME__)
119 # define HAVE_DATE_TIME
120 # endif
121 # define HAVE_STRFTIME
122 #endif
125 * Names for the EXRC, HELP and temporary files.
126 * Some of these may have been defined in the makefile.
129 #ifndef SYS_VIMRC_FILE
130 # define SYS_VIMRC_FILE "$VIM/vimrc"
131 #endif
132 #ifndef SYS_GVIMRC_FILE
133 # define SYS_GVIMRC_FILE "$VIM/gvimrc"
134 #endif
135 #ifndef SYS_MENU_FILE
136 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim"
137 #endif
138 #ifndef SYS_OPTWIN_FILE
139 # define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim"
140 #endif
141 #ifndef EVIM_FILE
142 # define EVIM_FILE "$VIMRUNTIME/evim.vim"
143 #endif
145 #ifdef FEAT_GUI
146 # ifndef USR_GVIMRC_FILE
147 # define USR_GVIMRC_FILE "~/.gvimrc"
148 # endif
149 # ifndef GVIMRC_FILE
150 # define GVIMRC_FILE "_gvimrc"
151 # endif
152 #endif
153 #ifndef USR_VIMRC_FILE
154 # define USR_VIMRC_FILE "~/.vimrc"
155 #endif
157 #ifndef USR_EXRC_FILE
158 # define USR_EXRC_FILE "~/.exrc"
159 #endif
161 #ifndef VIMRC_FILE
162 # define VIMRC_FILE "_vimrc"
163 #endif
165 #ifndef EXRC_FILE
166 # define EXRC_FILE "_exrc"
167 #endif
169 #ifndef DFLT_HELPFILE
170 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt"
171 #endif
173 #ifndef FILETYPE_FILE
174 # define FILETYPE_FILE "filetype.vim"
175 #endif
176 #ifndef FTPLUGIN_FILE
177 # define FTPLUGIN_FILE "ftplugin.vim"
178 #endif
179 #ifndef INDENT_FILE
180 # define INDENT_FILE "indent.vim"
181 #endif
182 #ifndef FTOFF_FILE
183 # define FTOFF_FILE "ftoff.vim"
184 #endif
185 #ifndef FTPLUGOF_FILE
186 # define FTPLUGOF_FILE "ftplugof.vim"
187 #endif
188 #ifndef INDOFF_FILE
189 # define INDOFF_FILE "indoff.vim"
190 #endif
192 #ifndef SYNTAX_FNAME
193 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim"
194 #endif
196 #ifdef FEAT_VIMINFO
197 # ifndef VIMINFO_FILE
198 # define VIMINFO_FILE "~/.viminfo"
199 # endif
200 #endif /* FEAT_VIMINFO */
202 #ifndef DFLT_BDIR
203 # define DFLT_BDIR "." /* default for 'backupdir' */
204 #endif
206 #ifndef DFLT_DIR
207 # define DFLT_DIR "." /* default for 'directory' */
208 #endif
210 #ifndef DFLT_VDIR
211 # define DFLT_VDIR "$VIM/vimfiles/view" /* default for 'viewdir' */
212 #endif
214 #define DFLT_ERRORFILE "errors.err"
216 #ifndef DFLT_RUNTIMEPATH
217 # define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
218 #endif
221 * Macintosh has plenty of memory, use large buffers
223 #define CMDBUFFSIZE 1024 /* size of the command processing buffer */
225 #if !defined(MACOS_X_UNIX)
226 # define MAXPATHL 256 /* Limited by the Pascal Strings */
227 # define BASENAMELEN (32-5-1) /* length of base of filename */
228 #endif
230 #ifndef DFLT_MAXMEM
231 # define DFLT_MAXMEM 512 /* use up to 512 Kbyte for buffer */
232 #endif
234 #ifndef DFLT_MAXMEMTOT
235 # define DFLT_MAXMEMTOT 2048 /* use up to 2048 Kbyte for Vim */
236 #endif
238 #define WILDCHAR_LIST "*?[{`$"
240 /**************/
241 #define mch_rename(src, dst) rename(src, dst)
242 #define mch_remove(x) unlink((char *)(x))
243 #ifndef mch_getenv
244 # if defined(__MRC__) || defined(__SC__)
245 # define mch_getenv(name) ((char_u *)getenv((char *)(name)))
246 # define mch_setenv(name, val, x) setenv((name), (val))
247 # elif defined(__APPLE_CC__)
248 # define mch_getenv(name) ((char_u *)getenv((char *)(name)))
249 /*# define mch_setenv(name, val, x) setenv((name), (val)) */ /* Obsoleted by Dany on Oct 30, 2001 */
250 # define mch_setenv(name, val, x) setenv(name, val, x)
251 # else
252 /* vim_getenv() is in pty.c */
253 # define USE_VIMPTY_GETENV
254 # define mch_getenv(x) vimpty_getenv(x)
255 # define mch_setenv(name, val, x) setenv(name, val, x)
256 # endif
257 #endif
259 #ifndef HAVE_CONFIG_H
260 # ifdef __APPLE_CC__
261 /* Assuming compiling for MacOS X */
262 /* Trying to take advantage of the prebinding */
263 # define HAVE_TGETENT
264 # define OSPEED_EXTERN
265 # define UP_BC_PC_EXTERN
266 # endif
267 #endif
269 /* Some "prep work" definition to be able to compile the MacOS X
270 * version with os_unix.x instead of os_mac.c. Based on the result
271 * of ./configure for console MacOS X.
274 #ifdef MACOS_X_UNIX
275 # ifndef SIGPROTOARG
276 # define SIGPROTOARG (int)
277 # endif
278 # ifndef SIGDEFARG
279 # define SIGDEFARG(s) (s) int s UNUSED;
280 # endif
281 # ifndef SIGDUMMYARG
282 # define SIGDUMMYARG 0
283 # endif
284 # undef HAVE_AVAIL_MEM
285 # ifndef HAVE_CONFIG_H
286 # define RETSIGTYPE void
287 # define SIGRETURN return
288 /*# define USE_SYSTEM */ /* Output ship do debugger :(, but ot compile */
289 # define HAVE_SYS_WAIT_H 1 /* Attempt */
290 # define HAVE_TERMIOS_H 1
291 # define SYS_SELECT_WITH_SYS_TIME 1
292 # define HAVE_SELECT 1
293 # define HAVE_SYS_SELECT_H 1
294 # define HAVE_PUTENV
295 # define HAVE_SETENV
296 # define HAVE_RENAME
297 # endif
298 #endif
300 #if defined(MACOS_X) && !defined(HAVE_CONFIG_H)
301 # define HAVE_PUTENV
302 #endif
304 /* A Mac constant causing big problem to syntax highlighting */
305 #define UNKNOWN_CREATOR '\?\?\?\?'
308 * for debugging
310 #ifdef MACOS_X
311 # ifdef _DEBUG
312 # define TRACE Trace
313 void Trace(char *fmt, ...);
314 # else
315 # define TRACE 1 ? (void)0 : printf
316 # endif
317 #endif