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.
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)
16 # define OPAQUE_TOOLBOX_STRUCTS 0
20 * Macintosh machine-dependent things.
22 * Include the Mac header files, unless also compiling with X11 (the header
23 * files have many conflicts).
26 # ifdef FEAT_GUI_MACVIM
27 # include <Carbon/Carbon.h>
29 # include <Quickdraw.h> /* Apple calls it QuickDraw.h... */
30 # include <ToolUtils.h>
34 # include <TextUtils.h>
47 #if defined(__APPLE_CC__) /* for Project Builder and ... */
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. */
57 /* OK defined to 0 in MacOS X 10.2 curses! Remove it, we define it to be 1. */
68 * MacOS specific #define
71 /* This will go away when CMD_KEY fully tested */
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
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
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 */
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
112 # define USE_TMPNAM /* use tmpnam() instead of mktemp() */
113 # define HAVE_FCNTL_H
115 # define HAVE_ST_MODE /* have stat.st_mode */
118 # if defined(__DATE__) && defined(__TIME__)
119 # define HAVE_DATE_TIME
121 # define HAVE_STRFTIME
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"
132 #ifndef SYS_GVIMRC_FILE
133 # define SYS_GVIMRC_FILE "$VIM/gvimrc"
135 #ifndef SYS_MENU_FILE
136 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim"
138 #ifndef SYS_OPTWIN_FILE
139 # define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim"
142 # define EVIM_FILE "$VIMRUNTIME/evim.vim"
146 # ifndef USR_GVIMRC_FILE
147 # define USR_GVIMRC_FILE "~/.gvimrc"
150 # define GVIMRC_FILE "_gvimrc"
153 #ifndef USR_VIMRC_FILE
154 # define USR_VIMRC_FILE "~/.vimrc"
157 #ifndef USR_EXRC_FILE
158 # define USR_EXRC_FILE "~/.exrc"
162 # define VIMRC_FILE "_vimrc"
166 # define EXRC_FILE "_exrc"
169 #ifndef DFLT_HELPFILE
170 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt"
173 #ifndef FILETYPE_FILE
174 # define FILETYPE_FILE "filetype.vim"
176 #ifndef FTPLUGIN_FILE
177 # define FTPLUGIN_FILE "ftplugin.vim"
180 # define INDENT_FILE "indent.vim"
183 # define FTOFF_FILE "ftoff.vim"
185 #ifndef FTPLUGOF_FILE
186 # define FTPLUGOF_FILE "ftplugof.vim"
189 # define INDOFF_FILE "indoff.vim"
193 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim"
197 # ifndef VIMINFO_FILE
198 # define VIMINFO_FILE "~/.viminfo"
200 #endif /* FEAT_VIMINFO */
203 # define DFLT_BDIR "." /* default for 'backupdir' */
207 # define DFLT_DIR "." /* default for 'directory' */
211 # define DFLT_VDIR "$VIM/vimfiles/view" /* default for 'viewdir' */
214 #define DFLT_ERRORFILE "errors.err"
216 #ifndef DFLT_RUNTIMEPATH
217 # define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
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 */
231 # define DFLT_MAXMEM 512 /* use up to 512 Kbyte for buffer */
234 #ifndef DFLT_MAXMEMTOT
235 # define DFLT_MAXMEMTOT 2048 /* use up to 2048 Kbyte for Vim */
238 #define WILDCHAR_LIST "*?[{`$"
241 #define mch_rename(src, dst) rename(src, dst)
242 #define mch_remove(x) unlink((char *)(x))
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)
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)
259 #ifndef HAVE_CONFIG_H
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
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.
276 # define SIGPROTOARG (int)
279 # define SIGDEFARG(s) (s) int s UNUSED;
282 # define SIGDUMMYARG 0
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
300 #if defined(MACOS_X) && !defined(HAVE_CONFIG_H)
304 /* A Mac constant causing big problem to syntax highlighting */
305 #define UNKNOWN_CREATOR '\?\?\?\?'
313 void Trace(char *fmt
, ...);
315 # define TRACE 1 ? (void)0 : printf