1 /* vi:set ts=8 sts=4 sw=4 noet: 2 * 3 * VIM - Vi IMproved by Bram Moolenaar 4 * 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 */ 8 9 /* 10 * Amiga Machine-dependent things 11 */ 12 13 #define CASE_INSENSITIVE_FILENAME // ignore case when comparing file names 14 #define SPACE_IN_FILENAME 15 #define USE_FNAME_CASE // adjust case of file names 16 #define USE_TERM_CONSOLE 17 #define HAVE_AVAIL_MEM 18 19 #ifndef HAVE_CONFIG_H 20 # if defined(AZTEC_C) || defined(__amigaos4__) 21 # define HAVE_STAT_H 22 # endif 23 # define HAVE_STDLIB_H 24 # define HAVE_STRING_H 25 # define HAVE_FCNTL_H 26 # define HAVE_STRCSPN 27 # define HAVE_STRICMP 28 # define HAVE_STRNICMP 29 # define HAVE_STRFTIME // guessed 30 # define HAVE_SETENV 31 # define HAVE_MEMSET 32 # define HAVE_QSORT 33 # if defined(__DATE__) && defined(__TIME__) 34 # define HAVE_DATE_TIME 35 # endif 36 37 #endif // HAVE_CONFIG_H 38 39 #ifndef DFLT_ERRORFILE 40 # define DFLT_ERRORFILE "AztecC.Err" // Should this change? 41 #endif 42 43 #ifndef DFLT_RUNTIMEPATH 44 # define DFLT_RUNTIMEPATH "home:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,home:vimfiles/after" 45 #endif 46 #ifndef CLEAN_RUNTIMEPATH 47 # define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after" 48 #endif 49 50 #ifndef BASENAMELEN 51 # define BASENAMELEN 26 // Amiga 52 #endif 53 54 #ifndef TEMPNAME 55 # define TEMPNAME "t:v?XXXXXX" 56 # define TEMPNAMELEN 12 57 #endif 58 59 // cproto fails on missing include files 60 #ifndef PROTO 61 62 #include <exec/types.h> 63 #include <libraries/dos.h> 64 #include <libraries/dosextens.h> 65 66 // Currently, all Amiga compilers except AZTEC C have these... 67 #ifndef AZTEC_C 68 # include <proto/exec.h> 69 # include <proto/dos.h> 70 # include <proto/intuition.h> 71 #endif 72 73 #endif // PROTO 74 75 #define FNAME_ILLEGAL ";*?`#%" // illegal characters in a file name 76 77 /* 78 * Manx doesn't have off_t, define it here. 79 */ 80 #ifdef AZTEC_C 81 typedef long off_t; 82 #endif 83 84 #ifdef LATTICE 85 # define USE_TMPNAM // use tmpnam() instead of mktemp() 86 #endif 87 88 #ifdef __GNUC__ 89 # include <sys/stat.h> 90 # include <unistd.h> 91 # include <limits.h> 92 # include <errno.h> 93 # include <pwd.h> 94 # include <grp.h> 95 # include <dirent.h> 96 #endif 97 98 #include <time.h> // for strftime() and others 99 100 #ifndef PROTO 101 /* 102 * arpbase.h must be included before functions.h 103 */ 104 #ifdef FEAT_ARP 105 # include <libraries/arpbase.h> 106 #endif 107 108 #endif // PROTO 109 110 /* 111 * This won't be needed if you have a version of Lattice 4.01 without broken 112 * break signal handling. 113 */ 114 #include <signal.h> 115 116 /* 117 * Names for the EXRC, HELP and temporary files. 118 * Some of these may have been defined in the makefile. 119 */ 120 #ifndef SYS_VIMRC_FILE 121 # define SYS_VIMRC_FILE "$VIM/vimrc" 122 #endif 123 #ifndef SYS_GVIMRC_FILE 124 # define SYS_GVIMRC_FILE "$VIM/gvimrc" 125 #endif 126 #ifndef SYS_MENU_FILE 127 # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim" 128 #endif 129 #ifndef DFLT_HELPFILE 130 # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt" 131 #endif 132 #ifndef FILETYPE_FILE 133 # define FILETYPE_FILE "filetype.vim" 134 #endif 135 #ifndef FTPLUGIN_FILE 136 # define FTPLUGIN_FILE "ftplugin.vim" 137 #endif 138 #ifndef INDENT_FILE 139 # define INDENT_FILE "indent.vim" 140 #endif 141 #ifndef FTOFF_FILE 142 # define FTOFF_FILE "ftoff.vim" 143 #endif 144 #ifndef FTPLUGOF_FILE 145 # define FTPLUGOF_FILE "ftplugof.vim" 146 #endif 147 #ifndef INDOFF_FILE 148 # define INDOFF_FILE "indoff.vim" 149 #endif 150 #ifndef SYNTAX_FNAME 151 # define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim" 152 #endif 153 154 #ifndef USR_EXRC_FILE 155 # define USR_EXRC_FILE "s:.exrc" 156 #endif 157 #ifndef USR_EXRC_FILE2 158 # define USR_EXRC_FILE2 "home:.exrc" 159 #endif 160 161 #ifndef USR_VIMRC_FILE 162 # define USR_VIMRC_FILE "s:.vimrc" 163 #endif 164 #ifndef USR_VIMRC_FILE2 165 # define USR_VIMRC_FILE2 "home:.vimrc" 166 #endif 167 #ifndef USR_VIMRC_FILE3 168 # define USR_VIMRC_FILE3 "home:vimfiles:vimrc" 169 #endif 170 #ifndef USR_VIMRC_FILE4 171 # define USR_VIMRC_FILE4 "$VIM/.vimrc" 172 #endif 173 #ifndef VIM_DEFAULTS_FILE 174 # define VIM_DEFAULTS_FILE "$VIMRUNTIME/defaults.vim" 175 #endif 176 #ifndef EVIM_FILE 177 # define EVIM_FILE "$VIMRUNTIME/evim.vim" 178 #endif 179 180 #ifndef USR_GVIMRC_FILE 181 # define USR_GVIMRC_FILE "s:.gvimrc" 182 #endif 183 #ifndef USR_GVIMRC_FILE2 184 # define USR_GVIMRC_FILE2 "home:.gvimrc" 185 #endif 186 #ifndef USR_GVIMRC_FILE3 187 # define USR_GVIMRC_FILE3 "home:vimfiles:gvimrc" 188 #endif 189 #ifndef USR_GVIMRC_FILE4 190 # define USR_GVIMRC_FILE4 "$VIM/.gvimrc" 191 #endif 192 193 #ifdef FEAT_VIMINFO 194 # ifndef VIMINFO_FILE 195 # define VIMINFO_FILE "s:.viminfo" 196 # endif 197 #endif 198 199 #ifndef EXRC_FILE 200 # define EXRC_FILE ".exrc" 201 #endif 202 203 #ifndef VIMRC_FILE 204 # define VIMRC_FILE ".vimrc" 205 #endif 206 207 #ifndef GVIMRC_FILE 208 # define GVIMRC_FILE ".gvimrc" 209 #endif 210 211 #ifndef DFLT_BDIR 212 # define DFLT_BDIR ".,t:" // default for 'backupdir' 213 #endif 214 215 #ifndef DFLT_DIR 216 # define DFLT_DIR ".,t:" // default for 'directory' 217 #endif 218 219 #ifndef DFLT_VDIR 220 # define DFLT_VDIR "$VIM/vimfiles/view" // default for 'viewdir' 221 #endif 222 223 #ifndef DFLT_MAXMEM 224 # define DFLT_MAXMEM 256 // use up to 256Kbyte for buffer 225 #endif 226 #ifndef DFLT_MAXMEMTOT 227 # define DFLT_MAXMEMTOT 0 // decide in set_init 228 #endif 229 230 #if defined(SASC) 231 int setenv(const char *, const char *); 232 #endif 233 234 #define mch_remove(x) remove((char *)(x)) 235 #define mch_rename(src, dst) rename(src, dst) 236 #define mch_chdir(s) chdir(s) 237 #define vim_mkdir(x, y) mch_mkdir(x) 238