blob: b8e90e111abc45b93099d0a3421414cff3a01ec5 [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
24#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 */
37#if defined(__DATE__) && defined(__TIME__)
38# define HAVE_DATE_TIME
39#endif
40#define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */
41#define HAVE_AVAIL_MEM
42
43/*
44 * Borland C++ 3.1 doesn't have _RTLENTRYF
45 */
46#ifdef __BORLANDC__
47# if __BORLANDC__ < 0x450
48# define _RTLENTRYF
49# endif
50#endif
51
52#define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
53
54#include <dos.h>
55#include <dir.h>
56#include <time.h>
57
58#ifdef DJGPP
59# include <unistd.h>
60# define HAVE_LOCALE_H
61# define setlocale(c, p) djgpp_setlocale()
62#endif
63
64#ifndef DJGPP
65typedef long off_t;
66#endif
67
68/*
69 * Try several directories to put the temp files.
70 */
71#define TEMPDIRNAMES "$TMP", "$TEMP", "c:\\TMP", "c:\\TEMP", ""
72#define TEMPNAMELEN 128
73
74#ifndef DFLT_MAXMEM
75# define DFLT_MAXMEM 256 /* use up to 256Kbyte for buffer */
76#endif
77#ifndef DFLT_MAXMEMTOT
78# define DFLT_MAXMEMTOT 0 /* decide in set_init */
79#endif
80
81#ifdef DJGPP
82# define BASENAMELEN (_USE_LFN?250:8) /* length of base of file name */
83#else
84# define BASENAMELEN 8 /* length of base of file name */
85#endif
86
87/* codes for msdos mouse event */
88#define MSDOS_MOUSE_LEFT 0x01
89#define MSDOS_MOUSE_RIGHT 0x02
90#define MSDOS_MOUSE_MIDDLE 0x04
91
92#ifdef DJGPP
93int mch_rename(const char *OldFile, const char *NewFile);
94#else
95# define mch_rename(src, dst) rename(src, dst)
96#endif
97
98#ifdef DJGPP
99# define vim_mkdir(x, y) mkdir((char *)(x), y)
100#else
101# define vim_mkdir(x, y) mkdir((char *)(x))
102#endif
103#define mch_rmdir(x) rmdir((char *)(x))
104
105#define mch_setenv(name, val, x) setenv(name, val, x)