1
/* $Header: d:/cvsroot/tads/TADS2/msdos/OSDOS.H,v 1.4 1999/07/11 00:46:37 MJRoberts Exp $ */
4
* Copyright (c) 1998, 2002 Michael J. Roberts. All Rights Reserved.
6
* Please see the accompanying license file, LICENSE.TXT, for information
7
* on using and copying this software.
11
osdos.h - MS-DOS system definitions
17
10/17/98 MJRoberts - Creation
27
/* include general DOS/Windows definitions */
30
/* ------------------------------------------------------------------------ */
32
* System name and long desription (for banner)
35
# define OS_SYSTEM_NAME "DJGPP"
37
# define OS_SYSTEM_NAME "MSDOS"
40
#define OS_SYSTEM_LDESC "MS-DOS"
43
/* ------------------------------------------------------------------------ */
45
* File Opening - use stdio
48
/* newline sequence - DOS/Windows use CR-LF */
49
#define OS_NEWLINE_SEQ "\r\n"
51
/* open text file for reading; returns NULL on error */
52
/* osfildef *osfoprt(const char *fname, os_filetype_t typ); */
53
#define osfoprt(fname, typ) fopen(fname, "r")
55
/* open text file for 'volatile' reading; returns NULL on error */
56
/* osfildef *osfoprtv(const char *fname, os_filetype_t typ); */
57
#define osfoprtv(fname, typ) osfoprt(fname, typ)
59
/* open text file for writing; returns NULL on error */
60
/* osfildef *osfopwt(const char *fname, os_filetype_t typ); */
61
#define osfopwt(fname, typ) fopen(fname, "w")
63
/* open text file for reading/writing; don't truncate */
64
osfildef *osfoprwt(const char *fname, os_filetype_t typ);
66
/* open text file for reading/writing; truncate; returns NULL on error */
67
/* osfildef *osfoprwtt(const char *fname, os_filetype_t typ); */
68
#define osfoprwtt(fname, typ) fopen(fname, "w+")
70
/* open binary file for writing; returns NULL on error */
71
/* osfildef *osfopwb(const char *fname, os_filetype_t typ); */
72
#define osfopwb(fname, typ) fopen(fname, "wb")
74
/* open SOURCE file for reading - use appropriate text/binary mode */
75
/* osfildef *osfoprs(const char *fname, os_filetype_t typ); */
76
#define osfoprs(fname, typ) fopen(fname, "rb")
78
/* open binary file for reading; returns NULL on erorr */
79
/* osfildef *osfoprb(const char *fname, os_filetype_t typ); */
80
#define osfoprb(fname, typ) fopen(fname, "rb")
82
/* open binary file for 'volatile' reading; returns NULL on erorr */
83
/* osfildef *osfoprbv(const char *fname, os_filetype_t typ); */
84
#define osfoprbv(fname, typ) osfoprb(fname, typ)
86
/* open binary file for reading/writing; don't truncate */
87
osfildef *osfoprwb(const char *fname, os_filetype_t typ);
89
/* open binary file for reading/writing; truncate; returns NULL on error */
90
/* osfildef *osfoprwtb(const char *fname, os_filetype_t typ); */
91
#define osfoprwtb(fname, typ) fopen(fname, "w+b")
95
/* ------------------------------------------------------------------------ */
97
* Set "busy" cursor on/off. For systems with a mouse cursor, set the
98
* cursor to an appropriate shape to notify the user that the system is
99
* busy. Does nothing on DOS.
101
/* void os_csr_busy(int show_as_busy); */
102
#define os_csr_busy(show_as_busy)
105
/* ------------------------------------------------------------------------ */
107
* If error messages are to be included in the executable, define
108
* ERR_LINK_MESSAGES. Otherwise, they'll be read from an external
109
* file that is to be opened with oserrop().
112
#define ERR_LINK_MESSAGES
116
/* ------------------------------------------------------------------------ */
118
* Update progress display with linfdef info, if appropriate. This can
119
* be used to provide a status display during compilation. Most
120
* command-line implementations will just ignore this notification; this
121
* can be used for GUI compiler implementations to provide regular
122
* display updates during compilation to show the progress so far.
124
#define os_progress(fname, linenum)
127
/* ------------------------------------------------------------------------ */
129
* Single/double quote matching macros. Used to allow systems with
130
* extended character codes with weird quote characters (such as Mac) to
131
* match the weird characters.
133
#define os_squote(c) ((c) == '\'')
134
#define os_dquote(c) ((c) == '"')
135
#define os_qmatch(a, b) ((a) == (b))
138
/* ------------------------------------------------------------------------ */
140
* on 16-bit protected-mode DOS, we need to check manually for break, so
141
* do this in os_yield; on other DOS versions, we don't need to do
142
* anything in os_yield
146
# define os_yield() FALSE
151
/* ------------------------------------------------------------------------ */
153
* theoretical maximum osmalloc size is all of memory
156
# define OSMALMAX 0xffffffffL
157
#else /* !__32BIT__ */
158
# define OSMALMAX 0xffffL
159
#endif /* __32BIT__ */
162
/* ------------------------------------------------------------------------ */
164
* Usage lines - for protected mode, we use different names for the
165
* executables, so reflect that in the usage lines. This isn't needed
166
* for the real-mode DOS versions, since they use the deault command
170
# define OS_TC_USAGE "usage: tcx [options] file"
171
# define OS_TR_USGAE "usage: trx [options] file"
172
# define OS_TDB_USAGE "usage: tdbx [options] file"
175
/* add the special TR option messages */
176
#define ERR_TRUS_OS_FIRST ERR_TRUS_DOS_1
177
#define ERR_TRUS_OS_LAST ERR_TRUS_DOS_L
180
* If we're in 16-bit mode, either real or protected, reduce the default
181
* stack size, since the real system stack is very constrained for these
182
* executables. (The interpreter consumes system stack in proportion to
183
* TADS stack space, so limiting the TADS stack will help ensure we
184
* don't overflow system stack.)
187
# define TRD_STKSIZ 100
188
# define TRD_STKSIZ_MSG " -ms size stack size (default 100 elements)"
193
# define OS_TC_USAGE "usage: tadsc [options] file"
194
# define OS_TR_USAGE "usage: tadsr [options] file"
197
* Make default buffer sizes huge, since we can be fairly liberal with
200
#include "osbigmem.h"
203
* Swapping off by default, since DJGPP has virtual memory
205
# define OS_DEFAULT_SWAP_ENABLED 0
208
* argv[0] required by dbgu.c
210
extern char *__dos_argv0; /* from crt0.h */
211
# define ARG0 __dos_argv0
213
# ifndef TADS_OEM_NAME
214
# define TADS_OEM_VERSION "0"
215
# define OS_SYSTEM_PATCHSUBLVL "0"
216
# define TADS_OEM_NAME "jim.dunleavy@erha.ie"