blob: 245f478d2edc037a1a1f8d13b635ad94a38bc776 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001/* vi:set ts=8 sts=4 sw=4:
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 * MSDOS Machine-dependent things.
11 */
12
13#include "os_dos.h" /* common MS-DOS and Win32 stuff */
14
15#define BINARY_FILE_IO
16#define USE_EXE_NAME /* use argv[0] for $VIM */
Bram Moolenaar071d4272004-06-13 20:20:40 +000017#define SYNC_DUP_CLOSE /* sync() a file with dup() and close() */
18#define USE_TERM_CONSOLE
19#ifdef DJGPP
20# include <fcntl.h> /* defines _USE_LFN */
21# define USE_LONG_FNAME _USE_LFN /* decide at run time */
22# define USE_FNAME_CASE
23# define HAVE_PUTENV
Bram Moolenaar071d4272004-06-13 20:20:40 +000024#else
25# define SHORT_FNAME /* always 8.3 file name */
26#endif
27#define HAVE_STDLIB_H
28#define HAVE_STRING_H
29#define HAVE_FCNTL_H
30#define HAVE_STRCSPN
31#define HAVE_STRICMP
32#define HAVE_STRFTIME /* guessed */
33#define HAVE_STRNICMP
34#define HAVE_MEMSET
35#define HAVE_QSORT
36#define HAVE_ST_MODE /* have stat.st_mode */
Bram Moolenaar446cb832008-06-24 21:56:24 +000037#define HAVE_MATH_H
Bram Moolenaar071d4272004-06-13 20:20:40 +000038#if defined(__DATE__) && defined(__TIME__)
39# define HAVE_DATE_TIME
40#endif
41#define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */
42#define HAVE_AVAIL_MEM
43
44/*
45 * Borland C++ 3.1 doesn't have _RTLENTRYF
46 */
47#ifdef __BORLANDC__
48# if __BORLANDC__ < 0x450
49# define _RTLENTRYF
50# endif
51#endif
52
53#define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
54
Bram Moolenaar82881492012-11-20 16:53:39 +010055/* cproto fails on missing include files */
56#ifndef PROTO
57# include <dos.h>
58# include <dir.h>
59# include <time.h>
60#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000061
62#ifdef DJGPP
63# include <unistd.h>
64# define HAVE_LOCALE_H
65# define setlocale(c, p) djgpp_setlocale()
66#endif
67
68#ifndef DJGPP
69typedef long off_t;
70#endif
71
72/*
73 * Try several directories to put the temp files.
74 */
75#define TEMPDIRNAMES "$TMP", "$TEMP", "c:\\TMP", "c:\\TEMP", ""
76#define TEMPNAMELEN 128
77
78#ifndef DFLT_MAXMEM
79# define DFLT_MAXMEM 256 /* use up to 256Kbyte for buffer */
80#endif
81#ifndef DFLT_MAXMEMTOT
82# define DFLT_MAXMEMTOT 0 /* decide in set_init */
83#endif
84
85#ifdef DJGPP
86# define BASENAMELEN (_USE_LFN?250:8) /* length of base of file name */
87#else
88# define BASENAMELEN 8 /* length of base of file name */
89#endif
90
91/* codes for msdos mouse event */
92#define MSDOS_MOUSE_LEFT 0x01
93#define MSDOS_MOUSE_RIGHT 0x02
94#define MSDOS_MOUSE_MIDDLE 0x04
95
96#ifdef DJGPP
97int mch_rename(const char *OldFile, const char *NewFile);
98#else
99# define mch_rename(src, dst) rename(src, dst)
100#endif
101
102#ifdef DJGPP
103# define vim_mkdir(x, y) mkdir((char *)(x), y)
104#else
105# define vim_mkdir(x, y) mkdir((char *)(x))
106#endif
107#define mch_rmdir(x) rmdir((char *)(x))
108
109#define mch_setenv(name, val, x) setenv(name, val, x)