defines.ds revision 60786
1105513Sphk/*
2105513Sphk * Copyright (C) 1984-2000  Mark Nudelman
3105513Sphk *
4105513Sphk * You may distribute under the terms of either the GNU General Public
5105513Sphk * License or the Less License, as specified in the README file.
6105513Sphk *
7105513Sphk * For more information about less, or for information on how to 
8105513Sphk * contact the author, see the README file.
9105513Sphk */
10105513Sphk
11105513Sphk
12105513Sphk/* DOS definition file for less.  */
13105513Sphk/*
14105513Sphk * This file has 2 sections:
15105513Sphk * User preferences.
16105513Sphk * Settings always true for MS-DOS systems. 
17105513Sphk */
18105513Sphk
19105513Sphk/* User preferences.  */
20105513Sphk
21105513Sphk/*
22105513Sphk * SECURE is 1 if you wish to disable a bunch of features in order to
23105513Sphk * be safe to run by unprivileged users.
24105513Sphk */
25105513Sphk#define	SECURE		0
26105513Sphk
27105513Sphk/*
28105513Sphk * SHELL_ESCAPE is 1 if you wish to allow shell escapes.
29105513Sphk * (This is possible only if your system supplies the system() function.)
30105513Sphk */
31105513Sphk#define	SHELL_ESCAPE	(!SECURE)
32105513Sphk
33105513Sphk/*
34105513Sphk * EXAMINE is 1 if you wish to allow examining files by name from within less.
35105513Sphk */
36105513Sphk#define	EXAMINE		(!SECURE)
37105513Sphk
38105513Sphk/*
39105513Sphk * TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key
40105513Sphk * to complete filenames at prompts.
41105513Sphk */
42105513Sphk#define	TAB_COMPLETE_FILENAME	(!SECURE)
43105513Sphk
44107455Sphk/*
45105513Sphk * CMD_HISTORY is 1 if you wish to allow keys to cycle through
46105513Sphk * previous commands at prompts.
47105513Sphk */
48105513Sphk#define	CMD_HISTORY	1
49105513Sphk
50112877Sphk/*
51105513Sphk * HILITE_SEARCH is 1 if you wish to have search targets to be 
52105513Sphk * displayed in standout mode.
53106407Sphk */
54105513Sphk#define	HILITE_SEARCH	1
55106407Sphk
56105513Sphk/*
57106407Sphk * EDITOR is 1 if you wish to allow editor invocation (the "v" command).
58106407Sphk * (This is possible only if your system supplies the system() function.)
59105513Sphk * EDIT_PGM is the name of the (default) editor to be invoked.
60105513Sphk */
61105513Sphk#define	EDITOR		(!SECURE)
62105513Sphk#define	EDIT_PGM	"vi"
63105513Sphk
64106407Sphk/*
65106407Sphk * TAGS is 1 if you wish to support tag files.
66106407Sphk */
67106407Sphk#define	TAGS		(!SECURE)
68106407Sphk
69106407Sphk/*
70106407Sphk * USERFILE is 1 if you wish to allow a .less file to specify 
71106407Sphk * user-defined key bindings.
72106407Sphk */
73106407Sphk#define	USERFILE	(!SECURE)
74106407Sphk
75106407Sphk/*
76106407Sphk * GLOB is 1 if you wish to have shell metacharacters expanded in filenames.
77106407Sphk * This will generally work if your system provides the "popen" function
78106407Sphk * and the "echo" shell command.
79106407Sphk */
80106407Sphk#ifdef __DJGPP__
81106407Sphk#define	GLOB		(!SECURE)
82106407Sphk#else
83106407Sphk#define	GLOB		0
84106407Sphk#endif
85106407Sphk
86106407Sphk/*
87106407Sphk * PIPEC is 1 if you wish to have the "|" command
88106407Sphk * which allows the user to pipe data into a shell command.
89106407Sphk */
90106407Sphk#ifdef __DJGPP__
91106407Sphk#define	PIPEC		(!SECURE)
92106407Sphk#else
93106407Sphk#define	PIPEC		0
94106407Sphk#endif
95106407Sphk
96106407Sphk/*
97105513Sphk * LOGFILE is 1 if you wish to allow the -l option (to create log files).
98105513Sphk */
99105513Sphk#define	LOGFILE		(!SECURE)
100105513Sphk
101105513Sphk/*
102105513Sphk * GNU_OPTIONS is 1 if you wish to support the GNU-style command
103105513Sphk * line options --help and --version.
104105513Sphk */
105107455Sphk#define	GNU_OPTIONS	1
106105541Sphk
107107455Sphk/*
108107455Sphk * ONLY_RETURN is 1 if you want RETURN to be the only input which
109107455Sphk * will continue past an error message.
110105513Sphk * Otherwise, any key will continue past an error message.
111105513Sphk */
112105513Sphk#define	ONLY_RETURN	0
113105513Sphk
114105513Sphk/*
115105513Sphk * LESSKEYFILE is the filename of the default lesskey output file 
116105513Sphk * (in the HOME directory).
117105513Sphk * LESSKEYFILE_SYS is the filename of the system-wide lesskey output file.
118105513Sphk * DEF_LESSKEYINFILE is the filename of the default lesskey input 
119105513Sphk * (in the HOME directory).
120105513Sphk */
121105513Sphk#define	LESSKEYFILE		"_less"
122105513Sphk#define	LESSKEYFILE_SYS		"c:\\_sysless"
123105513Sphk#define	DEF_LESSKEYINFILE	"_lesskey"
124105513Sphk
125105513Sphk
126105513Sphk/* Settings always true for MS-DOS systems.  */
127105513Sphk
128105513Sphk/*
129105513Sphk * Define MSDOS_COMPILER if compiling for MS-DOS.
130105513Sphk */
131105513Sphk#ifdef __DJGPP__
132105513Sphk#define	MSDOS_COMPILER		DJGPPC
133105513Sphk#else
134105513Sphk#ifdef __BORLANDC__
135105513Sphk#define	MSDOS_COMPILER		BORLANDC
136105513Sphk#else
137105513Sphk#define	MSDOS_COMPILER		MSOFTC
138105513Sphk#endif
139105513Sphk#endif
140105513Sphk
141105513Sphk/*
142105513Sphk * Pathname separator character.
143105513Sphk */
144105513Sphk#define	PATHNAME_SEP	"\\"
145105513Sphk
146105513Sphk/*
147105513Sphk * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>.
148105513Sphk */
149105513Sphk#define HAVE_SYS_TYPES_H	1
150105513Sphk
151105513Sphk/*
152105513Sphk * Define if you have the <sgstat.h> header file.
153106407Sphk */
154105513Sphk#define HAVE_SGSTAT_H	0
155105513Sphk
156105513Sphk/*
157105513Sphk * HAVE_PERROR is 1 if your system has the perror() call.
158105513Sphk * (Actually, if it has sys_errlist, sys_nerr and errno.)
159106407Sphk */
160105513Sphk#define	HAVE_PERROR	1
161105513Sphk
162105513Sphk/*
163105513Sphk * HAVE_TIME is 1 if your system has the time() call.
164105513Sphk */
165105513Sphk#define	HAVE_TIME	1
166105513Sphk
167105513Sphk/*
168106407Sphk * HAVE_SHELL is 1 if your system supports a SHELL command interpreter.
169106407Sphk */
170105513Sphk#define	HAVE_SHELL	0
171105513Sphk
172105513Sphk/* 
173105513Sphk * HAVE_DUP is 1 if your system has the dup() call.
174105513Sphk */
175105513Sphk#define	HAVE_DUP	1
176105513Sphk
177105513Sphk/*
178105513Sphk * Sizes of various buffers.
179105513Sphk */
180105513Sphk#define	CMDBUF_SIZE	512	/* Buffer for multichar commands */
181105513Sphk#define	UNGOT_SIZE	100	/* Max chars to unget() */
182105513Sphk#define	LINEBUF_SIZE	1024	/* Max size of line in input file */
183105513Sphk#define	OUTBUF_SIZE	1024	/* Output buffer */
184105513Sphk#define	PROMPT_SIZE	200	/* Max size of prompt string */
185105513Sphk#define	TERMBUF_SIZE	2048	/* Termcap buffer for tgetent */
186105513Sphk#define	TERMSBUF_SIZE	1024	/* Buffer to hold termcap strings */
187105513Sphk#define	TAGLINE_SIZE	512	/* Max size of line in tags file */
188105513Sphk
189105513Sphk/* Define to `long' if <sys/types.h> doesn't define.  */
190105513Sphk#if MSDOS_COMPILER==BORLANDC
191105513Sphk#define	off_t	long 
192105513Sphk#endif
193105513Sphk
194105513Sphk/* Define if you need to in order for stat and other things to work.  */
195105513Sphk/* #undef _POSIX_SOURCE */
196105513Sphk
197105513Sphk/* Define as the return type of signal handlers (int or void).  */
198106407Sphk#define RETSIGTYPE void
199106407Sphk
200105513Sphk
201105513Sphk/*
202105513Sphk * Regular expression library.
203106407Sphk * Define exactly one of the following to be 1:
204105513Sphk * HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h
205105513Sphk * HAVE_RE_COMP: BSD re_comp()
206105513Sphk * HAVE_REGCMP: System V regcmp()
207105513Sphk * HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h
208105513Sphk * NO_REGEX: pattern matching is supported, but without metacharacters.
209105513Sphk */
210105513Sphk/* #undef HAVE_POSIX_REGCOMP */
211105513Sphk/* #undef HAVE_RE_COMP */
212106407Sphk/* #undef HAVE_REGCMP */
213105513Sphk/* #undef HAVE_V8_REGCOMP */
214105513Sphk#if MSDOS_COMPILER==DJGPPC
215105513Sphk#define	HAVE_POSIX_REGCOMP 1
216105513Sphk#else
217105513Sphk#define NO_REGEX 1
218105513Sphk#endif
219105513Sphk
220105513Sphk/* Define HAVE_VOID if your compiler supports the "void" type. */
221105513Sphk#define HAVE_VOID 1
222105513Sphk
223112877Sphk/* Define HAVE_CONST if your compiler supports the "const" modifier. */
224112877Sphk#define HAVE_CONST 1
225112877Sphk
226112877Sphk/* Define HAVE_TIME_T if your system supports the "time_t" type. */
227105513Sphk#define HAVE_TIME_T 1
228115624Sphk
229115624Sphk/* Define HAVE_STRERROR if you have the strerror() function. */
230112877Sphk#define HAVE_STRERROR 1
231112877Sphk
232112877Sphk/* Define HAVE_FILENO if you have the fileno() macro. */
233105513Sphk#define HAVE_FILENO 1
234105513Sphk
235105513Sphk/* Define HAVE_ERRNO if you have the errno variable */
236111296Stjr/* Define MUST_DEFINE_ERRNO if you have errno but it is not defined
237112877Sphk * in errno.h */
238112877Sphk#if MSDOS_COMPILER==MSOFTC || MSDOS_COMPILER==DJGPPC
239105513Sphk#define HAVE_ERRNO 1
240105513Sphk#define MUST_DEFINE_ERRNO 0
241112877Sphk#else
242112877Sphk#define HAVE_ERRNO 1
243112877Sphk#define MUST_DEFINE_ERRNO 1
244112877Sphk#endif
245105513Sphk
246105513Sphk/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
247105513Sphk#define HAVE_SYS_ERRLIST 1
248105513Sphk
249105513Sphk/* Define HAVE_OSPEED if your termcap library has the ospeed variable */
250105541Sphk/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined
251105513Sphk * in termcap.h. */
252112877Sphk#define HAVE_OSPEED 0
253112877Sphk#define MUST_DEFINE_OSPEED 0
254112877Sphk
255105513Sphk/* Define HAVE_LOCALE if you have locale.h and setlocale. */
256115624Sphk#define HAVE_LOCALE 1
257115624Sphk
258112877Sphk/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */
259112877Sphk#define HAVE_TERMIOS_FUNCS 0
260112877Sphk
261112877Sphk/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */
262112877Sphk#define HAVE_UPPER_LOWER 1
263112877Sphk
264112877Sphk/* Define if you have the _setjmp function.  */
265105513Sphk#if MSDOS_COMPILER==MSOFTC || MSDOS_COMPILER==DJGPPC
266105513Sphk#define HAVE__SETJMP	0
267105513Sphk#else
268105513Sphk#define HAVE__SETJMP	1
269106407Sphk#endif
270105513Sphk
271105513Sphk/* Define if you have the memcpy function.  */
272105513Sphk#define HAVE_MEMCPY 1
273105513Sphk
274106407Sphk/* Define if you have the popen function.  */
275106407Sphk#if MSDOS_COMPILER==DJGPPC
276106407Sphk#define HAVE_POPEN	1
277105513Sphk#else
278106407Sphk#define HAVE_POPEN	0
279106407Sphk#endif
280106407Sphk
281106407Sphk/* Define if you have the sigsetmask function.  */
282106407Sphk#define HAVE_SIGSETMASK	0
283106407Sphk
284106407Sphk/* Define if you have the stat function.  */
285106407Sphk#define HAVE_STAT 1
286106407Sphk
287106407Sphk/* Define if you have the strchr function.  */
288106407Sphk#define HAVE_STRCHR 1
289106407Sphk
290106407Sphk/* Define if you have the system function.  */
291105513Sphk#define HAVE_SYSTEM	1
292105513Sphk
293105513Sphk/* Define if you have the <ctype.h> header file.  */
294111296Stjr#define HAVE_CTYPE_H 1
295105513Sphk
296105513Sphk/* Define if you have the <errno.h> header file.  */
297105513Sphk#define HAVE_ERRNO_H 1
298105513Sphk
299105513Sphk/* Define if you have the <fcntl.h> header file.  */
300105513Sphk#define HAVE_FCNTL_H 1
301106407Sphk
302106407Sphk/* Define if you have the <limits.h> header file.  */
303105513Sphk#define HAVE_LIMITS_H 1
304105513Sphk
305105513Sphk/* Define if you have the <stdio.h> header file.  */
306105513Sphk#define HAVE_STDIO_H 1
307105513Sphk
308105513Sphk/* Define if you have the <stdlib> header file. */
309105513Sphk#define HAVE_STDLIB_H 1
310105513Sphk
311105513Sphk/* Define if you have the <string.h> header file.  */
312105513Sphk#define HAVE_STRING_H 1
313105513Sphk
314105513Sphk/* Define if you have the <sys/ioctl.h> header file.  */
315105513Sphk#define HAVE_SYS_IOCTL_H 0
316105513Sphk
317105513Sphk/* Define if you have the <sys/ptem.h> header file.  */
318105513Sphk#define HAVE_SYS_PTEM_H	0
319105513Sphk
320105513Sphk/* Define if you have the <sys/stream.h> header file.  */
321105513Sphk#define HAVE_SYS_STREAM_H	0
322105513Sphk
323105513Sphk/* Define if you have the <termcap.h> header file.  */
324105513Sphk#define HAVE_TERMCAP_H	0
325105513Sphk
326105513Sphk/* Define if you have the <termio.h> header file.  */
327105513Sphk#define HAVE_TERMIO_H	0
328105513Sphk
329105513Sphk/* Define if you have the <termios.h> header file.  */
330105513Sphk#define HAVE_TERMIOS_H 0
331105513Sphk
332105513Sphk/* Define if you have the <time.h> header file.  */
333105513Sphk#define HAVE_TIME_H 1
334105513Sphk
335105513Sphk/* Define if you have the <unistd.h> header file.  */
336105513Sphk#if MSDOS_COMPILER==DJGPPC
337105513Sphk#define HAVE_UNISTD_H 1
338105513Sphk#else
339105513Sphk#define HAVE_UNISTD_H 0
340105513Sphk#endif
341105513Sphk
342105513Sphk/* Define if you have the <values.h> header file.  */
343105513Sphk#if MSDOS_COMPILER==MSOFTC
344105513Sphk#define HAVE_VALUES_H 0
345105513Sphk#else
346105513Sphk#define HAVE_VALUES_H 1
347105513Sphk#endif
348105513Sphk
349105513Sphk#if MSDOS_COMPILER == MSOFTC && _MSC_VER >= 700
350105513Sphk/*
351105513Sphk * The names of these things changed in Microsoft C version 7.0.
352105513Sphk */
353105513Sphk#define videoconfig	_videoconfig
354105513Sphk#define rccoord		_rccoord
355105513Sphk#define O_RDONLY	_O_RDONLY
356105513Sphk#define O_WRONLY	_O_WRONLY
357105513Sphk#define O_APPEND	_O_APPEND
358105513Sphk#define O_BINARY	_O_BINARY
359105513Sphk#define O_TEXT		_O_TEXT
360105513Sphk#define find_t		_find_t
361105513Sphk#define stat		_stat
362120876Sphk#define S_IFMT		_S_IFMT
363105513Sphk#define S_IFDIR		_S_IFDIR
364105513Sphk#define S_IFREG		_S_IFREG
365105513Sphk#define dup		_dup
366105513Sphk#define open		_open
367105513Sphk#define lseek		_lseek
368111296Stjr#define write		_write
369105513Sphk#define creat		_creat
370105513Sphk#define fstat		_fstat
371120876Sphk#define isatty		_isatty
372105513Sphk#define close		_close
373105513Sphk#define read		_read
374105513Sphk#define ungetch		_ungetch
375105513Sphk#define kbhit		_kbhit
376105513Sphk#define getch		_getch
377105513Sphk#endif
378105513Sphk