160786Sps/* 2240121Sdelphij * Copyright (C) 1984-2012 Mark Nudelman 360786Sps * 460786Sps * You may distribute under the terms of either the GNU General Public 560786Sps * License or the Less License, as specified in the README file. 660786Sps * 7240121Sdelphij * For more information, see the README file. 860786Sps */ 960786Sps 1060786Sps 1160786Sps/* DOS definition file for less. */ 1260786Sps/* 1360786Sps * This file has 2 sections: 1460786Sps * User preferences. 1560786Sps * Settings always true for MS-DOS systems. 1660786Sps */ 1760786Sps 1860786Sps/* User preferences. */ 1960786Sps 2060786Sps/* 2160786Sps * SECURE is 1 if you wish to disable a bunch of features in order to 2260786Sps * be safe to run by unprivileged users. 2360786Sps */ 2460786Sps#define SECURE 0 2560786Sps 2660786Sps/* 2760786Sps * SHELL_ESCAPE is 1 if you wish to allow shell escapes. 2860786Sps * (This is possible only if your system supplies the system() function.) 2960786Sps */ 3060786Sps#define SHELL_ESCAPE (!SECURE) 3160786Sps 3260786Sps/* 3360786Sps * EXAMINE is 1 if you wish to allow examining files by name from within less. 3460786Sps */ 3560786Sps#define EXAMINE (!SECURE) 3660786Sps 3760786Sps/* 3860786Sps * TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key 3960786Sps * to complete filenames at prompts. 4060786Sps */ 4160786Sps#define TAB_COMPLETE_FILENAME (!SECURE) 4260786Sps 4360786Sps/* 4460786Sps * CMD_HISTORY is 1 if you wish to allow keys to cycle through 4560786Sps * previous commands at prompts. 4660786Sps */ 4760786Sps#define CMD_HISTORY 1 4860786Sps 4960786Sps/* 5060786Sps * HILITE_SEARCH is 1 if you wish to have search targets to be 5160786Sps * displayed in standout mode. 5260786Sps */ 5360786Sps#define HILITE_SEARCH 1 5460786Sps 5560786Sps/* 5660786Sps * EDITOR is 1 if you wish to allow editor invocation (the "v" command). 5760786Sps * (This is possible only if your system supplies the system() function.) 5860786Sps * EDIT_PGM is the name of the (default) editor to be invoked. 5960786Sps */ 6060786Sps#define EDITOR (!SECURE) 6160786Sps#define EDIT_PGM "vi" 6260786Sps 6360786Sps/* 6460786Sps * TAGS is 1 if you wish to support tag files. 6560786Sps */ 6660786Sps#define TAGS (!SECURE) 6760786Sps 6860786Sps/* 6960786Sps * USERFILE is 1 if you wish to allow a .less file to specify 7060786Sps * user-defined key bindings. 7160786Sps */ 7260786Sps#define USERFILE (!SECURE) 7360786Sps 7460786Sps/* 7560786Sps * GLOB is 1 if you wish to have shell metacharacters expanded in filenames. 7660786Sps * This will generally work if your system provides the "popen" function 7760786Sps * and the "echo" shell command. 7860786Sps */ 7960786Sps#ifdef __DJGPP__ 8060786Sps#define GLOB (!SECURE) 8160786Sps#else 8260786Sps#define GLOB 0 8360786Sps#endif 8460786Sps 8560786Sps/* 8660786Sps * PIPEC is 1 if you wish to have the "|" command 8760786Sps * which allows the user to pipe data into a shell command. 8860786Sps */ 8960786Sps#ifdef __DJGPP__ 9060786Sps#define PIPEC (!SECURE) 9160786Sps#else 9260786Sps#define PIPEC 0 9360786Sps#endif 9460786Sps 9560786Sps/* 9660786Sps * LOGFILE is 1 if you wish to allow the -l option (to create log files). 9760786Sps */ 9860786Sps#define LOGFILE (!SECURE) 9960786Sps 10060786Sps/* 10160786Sps * GNU_OPTIONS is 1 if you wish to support the GNU-style command 10260786Sps * line options --help and --version. 10360786Sps */ 10460786Sps#define GNU_OPTIONS 1 10560786Sps 10660786Sps/* 10760786Sps * ONLY_RETURN is 1 if you want RETURN to be the only input which 10860786Sps * will continue past an error message. 10960786Sps * Otherwise, any key will continue past an error message. 11060786Sps */ 11160786Sps#define ONLY_RETURN 0 11260786Sps 11360786Sps/* 11460786Sps * LESSKEYFILE is the filename of the default lesskey output file 11560786Sps * (in the HOME directory). 11660786Sps * LESSKEYFILE_SYS is the filename of the system-wide lesskey output file. 11760786Sps * DEF_LESSKEYINFILE is the filename of the default lesskey input 11860786Sps * (in the HOME directory). 119161475Sdelphij * LESSHISTFILE is the filename of the history file 120161475Sdelphij * (in the HOME directory). 12160786Sps */ 12260786Sps#define LESSKEYFILE "_less" 12360786Sps#define LESSKEYFILE_SYS "c:\\_sysless" 12460786Sps#define DEF_LESSKEYINFILE "_lesskey" 125161475Sdelphij#define LESSHISTFILE "_lesshst" 12660786Sps 12760786Sps 12860786Sps/* Settings always true for MS-DOS systems. */ 12960786Sps 13060786Sps/* 13160786Sps * Define MSDOS_COMPILER if compiling for MS-DOS. 13260786Sps */ 13360786Sps#ifdef __DJGPP__ 13460786Sps#define MSDOS_COMPILER DJGPPC 13560786Sps#else 13660786Sps#ifdef __BORLANDC__ 13760786Sps#define MSDOS_COMPILER BORLANDC 13860786Sps#else 13960786Sps#define MSDOS_COMPILER MSOFTC 14060786Sps#endif 14160786Sps#endif 14260786Sps 14360786Sps/* 14460786Sps * Pathname separator character. 14560786Sps */ 14660786Sps#define PATHNAME_SEP "\\" 14760786Sps 14860786Sps/* 14960786Sps * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>. 15060786Sps */ 15160786Sps#define HAVE_SYS_TYPES_H 1 15260786Sps 15360786Sps/* 15460786Sps * Define if you have the <sgstat.h> header file. 15560786Sps */ 15660786Sps#define HAVE_SGSTAT_H 0 15760786Sps 15860786Sps/* 15960786Sps * HAVE_PERROR is 1 if your system has the perror() call. 16060786Sps * (Actually, if it has sys_errlist, sys_nerr and errno.) 16160786Sps */ 16260786Sps#define HAVE_PERROR 1 16360786Sps 16460786Sps/* 16560786Sps * HAVE_TIME is 1 if your system has the time() call. 16660786Sps */ 16760786Sps#define HAVE_TIME 1 16860786Sps 16960786Sps/* 17060786Sps * HAVE_SHELL is 1 if your system supports a SHELL command interpreter. 17160786Sps */ 17260786Sps#define HAVE_SHELL 0 17360786Sps 174128345Stjr/* 175128345Stjr * Default shell metacharacters and meta-escape character. 176128345Stjr */ 177128345Stjr#define DEF_METACHARS "; *?\t\n'\"()<>|&" 178128345Stjr#define DEF_METAESCAPE "" 179128345Stjr 18060786Sps/* 18160786Sps * HAVE_DUP is 1 if your system has the dup() call. 18260786Sps */ 18360786Sps#define HAVE_DUP 1 18460786Sps 18560786Sps/* 18660786Sps * Sizes of various buffers. 18760786Sps */ 188251154Sdelphij#if 0 /* old sizes for small memory machines 18960786Sps#define CMDBUF_SIZE 512 /* Buffer for multichar commands */ 19060786Sps#define UNGOT_SIZE 100 /* Max chars to unget() */ 19160786Sps#define LINEBUF_SIZE 1024 /* Max size of line in input file */ 19260786Sps#define OUTBUF_SIZE 1024 /* Output buffer */ 19360786Sps#define PROMPT_SIZE 200 /* Max size of prompt string */ 19460786Sps#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ 19560786Sps#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ 19660786Sps#define TAGLINE_SIZE 512 /* Max size of line in tags file */ 19789019Sps#define TABSTOP_MAX 32 /* Max number of custom tab stops */ 198251154Sdelphij#else /* more reasonable sizes for modern machines */ 199251154Sdelphij#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ 200251154Sdelphij#define UNGOT_SIZE 200 /* Max chars to unget() */ 201251154Sdelphij#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ 202251154Sdelphij#define OUTBUF_SIZE 1024 /* Output buffer */ 203251154Sdelphij#define PROMPT_SIZE 2048 /* Max size of prompt string */ 204251154Sdelphij#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ 205251154Sdelphij#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ 206251154Sdelphij#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ 207251154Sdelphij#define TABSTOP_MAX 128 /* Max number of custom tab stops */ 208251154Sdelphij#endif 20960786Sps 21060786Sps/* Define to `long' if <sys/types.h> doesn't define. */ 21160786Sps#if MSDOS_COMPILER==BORLANDC 21260786Sps#define off_t long 21360786Sps#endif 21460786Sps 21560786Sps/* Define if you need to in order for stat and other things to work. */ 21660786Sps/* #undef _POSIX_SOURCE */ 21760786Sps 21860786Sps/* Define as the return type of signal handlers (int or void). */ 21960786Sps#define RETSIGTYPE void 22060786Sps 22160786Sps 22260786Sps/* 22360786Sps * Regular expression library. 22460786Sps * Define exactly one of the following to be 1: 22560786Sps * HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h 22660786Sps * HAVE_RE_COMP: BSD re_comp() 22760786Sps * HAVE_REGCMP: System V regcmp() 22860786Sps * HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h 22960786Sps * NO_REGEX: pattern matching is supported, but without metacharacters. 23060786Sps */ 23160786Sps/* #undef HAVE_POSIX_REGCOMP */ 23260786Sps/* #undef HAVE_RE_COMP */ 23360786Sps/* #undef HAVE_REGCMP */ 23460786Sps/* #undef HAVE_V8_REGCOMP */ 23560786Sps#if MSDOS_COMPILER==DJGPPC 23660786Sps#define HAVE_POSIX_REGCOMP 1 23760786Sps#else 23860786Sps#define NO_REGEX 1 23960786Sps#endif 24060786Sps 24160786Sps/* Define HAVE_VOID if your compiler supports the "void" type. */ 24260786Sps#define HAVE_VOID 1 24360786Sps 24460786Sps/* Define HAVE_CONST if your compiler supports the "const" modifier. */ 24560786Sps#define HAVE_CONST 1 24660786Sps 24760786Sps/* Define HAVE_TIME_T if your system supports the "time_t" type. */ 24860786Sps#define HAVE_TIME_T 1 24960786Sps 25060786Sps/* Define HAVE_STRERROR if you have the strerror() function. */ 25160786Sps#define HAVE_STRERROR 1 25260786Sps 25360786Sps/* Define HAVE_FILENO if you have the fileno() macro. */ 25460786Sps#define HAVE_FILENO 1 25560786Sps 25660786Sps/* Define HAVE_ERRNO if you have the errno variable */ 25760786Sps/* Define MUST_DEFINE_ERRNO if you have errno but it is not defined 25860786Sps * in errno.h */ 25960786Sps#if MSDOS_COMPILER==MSOFTC || MSDOS_COMPILER==DJGPPC 26060786Sps#define HAVE_ERRNO 1 26160786Sps#define MUST_DEFINE_ERRNO 0 26260786Sps#else 26360786Sps#define HAVE_ERRNO 1 26460786Sps#define MUST_DEFINE_ERRNO 1 26560786Sps#endif 26660786Sps 26760786Sps/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */ 26860786Sps#define HAVE_SYS_ERRLIST 1 26960786Sps 27060786Sps/* Define HAVE_OSPEED if your termcap library has the ospeed variable */ 27160786Sps/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined 27260786Sps * in termcap.h. */ 27360786Sps#define HAVE_OSPEED 0 27460786Sps#define MUST_DEFINE_OSPEED 0 27560786Sps 27660786Sps/* Define HAVE_LOCALE if you have locale.h and setlocale. */ 27789019Sps#define HAVE_LOCALE 0 27860786Sps 27960786Sps/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */ 28060786Sps#define HAVE_TERMIOS_FUNCS 0 28160786Sps 28260786Sps/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */ 28360786Sps#define HAVE_UPPER_LOWER 1 28460786Sps 28560786Sps/* Define if you have the _setjmp function. */ 28660786Sps#if MSDOS_COMPILER==MSOFTC || MSDOS_COMPILER==DJGPPC 28760786Sps#define HAVE__SETJMP 0 28860786Sps#else 28960786Sps#define HAVE__SETJMP 1 29060786Sps#endif 29160786Sps 29260786Sps/* Define if you have the memcpy function. */ 29360786Sps#define HAVE_MEMCPY 1 29460786Sps 29560786Sps/* Define if you have the popen function. */ 29660786Sps#if MSDOS_COMPILER==DJGPPC 29760786Sps#define HAVE_POPEN 1 29860786Sps#else 29960786Sps#define HAVE_POPEN 0 30060786Sps#endif 30160786Sps 30260786Sps/* Define if you have the sigsetmask function. */ 30360786Sps#define HAVE_SIGSETMASK 0 30460786Sps 30563128Sps/* Define if you have the sigprocmask function. */ 30663128Sps#define HAVE_SIGPROCMASK 0 30763128Sps 30863128Sps/* Define if you have the sigset_t type and sigemptyset macro */ 30963128Sps#define HAVE_SIGSET_T 0 31063128Sps#define HAVE_SIGEMPTYSET 0 31163128Sps 31260786Sps/* Define if you have the stat function. */ 31360786Sps#define HAVE_STAT 1 31460786Sps 31560786Sps/* Define if you have the strchr function. */ 31660786Sps#define HAVE_STRCHR 1 31760786Sps 31860786Sps/* Define if you have the system function. */ 31960786Sps#define HAVE_SYSTEM 1 32060786Sps 321161475Sdelphij/* Define if you have the snprintf function. */ 322161475Sdelphij#define HAVE_SNPRINTF 0 323161475Sdelphij 32460786Sps/* Define if you have the <ctype.h> header file. */ 32560786Sps#define HAVE_CTYPE_H 1 32660786Sps 327173682Sdelphij/* Define if you have the <wctype.h> header file. */ 328173682Sdelphij#define HAVE_WCTYPE_H 0 329173682Sdelphij 33060786Sps/* Define if you have the <errno.h> header file. */ 33160786Sps#define HAVE_ERRNO_H 1 33260786Sps 33360786Sps/* Define if you have the <fcntl.h> header file. */ 33460786Sps#define HAVE_FCNTL_H 1 33560786Sps 336240121Sdelphij/* Define HAVE_FLOAT if your compiler supports the "double" type. */ 337240121Sdelphij#define HAVE_FLOAT 1 338240121Sdelphij 33960786Sps/* Define if you have the <limits.h> header file. */ 34060786Sps#define HAVE_LIMITS_H 1 34160786Sps 34260786Sps/* Define if you have the <stdio.h> header file. */ 34360786Sps#define HAVE_STDIO_H 1 34460786Sps 34560786Sps/* Define if you have the <stdlib> header file. */ 34660786Sps#define HAVE_STDLIB_H 1 34760786Sps 34860786Sps/* Define if you have the <string.h> header file. */ 34960786Sps#define HAVE_STRING_H 1 35060786Sps 35160786Sps/* Define if you have the <sys/ioctl.h> header file. */ 35260786Sps#define HAVE_SYS_IOCTL_H 0 35360786Sps 35460786Sps/* Define if you have the <sys/ptem.h> header file. */ 35560786Sps#define HAVE_SYS_PTEM_H 0 35660786Sps 35760786Sps/* Define if you have the <sys/stream.h> header file. */ 35860786Sps#define HAVE_SYS_STREAM_H 0 35960786Sps 36060786Sps/* Define if you have the <termcap.h> header file. */ 36160786Sps#define HAVE_TERMCAP_H 0 36260786Sps 36360786Sps/* Define if you have the <termio.h> header file. */ 36460786Sps#define HAVE_TERMIO_H 0 36560786Sps 36660786Sps/* Define if you have the <termios.h> header file. */ 36760786Sps#define HAVE_TERMIOS_H 0 36860786Sps 36960786Sps/* Define if you have the <time.h> header file. */ 37060786Sps#define HAVE_TIME_H 1 37160786Sps 37260786Sps/* Define if you have the <unistd.h> header file. */ 37360786Sps#if MSDOS_COMPILER==DJGPPC 37460786Sps#define HAVE_UNISTD_H 1 37560786Sps#else 37660786Sps#define HAVE_UNISTD_H 0 37760786Sps#endif 37860786Sps 37960786Sps/* Define if you have the <values.h> header file. */ 38060786Sps#if MSDOS_COMPILER==MSOFTC 38160786Sps#define HAVE_VALUES_H 0 38260786Sps#else 38360786Sps#define HAVE_VALUES_H 1 38460786Sps#endif 38560786Sps 38660786Sps#if MSDOS_COMPILER == MSOFTC && _MSC_VER >= 700 38760786Sps/* 38860786Sps * The names of these things changed in Microsoft C version 7.0. 38960786Sps */ 39060786Sps#define videoconfig _videoconfig 39160786Sps#define rccoord _rccoord 39260786Sps#define O_RDONLY _O_RDONLY 39360786Sps#define O_WRONLY _O_WRONLY 39460786Sps#define O_APPEND _O_APPEND 39560786Sps#define O_BINARY _O_BINARY 39660786Sps#define O_TEXT _O_TEXT 39760786Sps#define find_t _find_t 39860786Sps#define stat _stat 39960786Sps#define S_IFMT _S_IFMT 40060786Sps#define S_IFDIR _S_IFDIR 40160786Sps#define S_IFREG _S_IFREG 40260786Sps#define dup _dup 40360786Sps#define open _open 40460786Sps#define lseek _lseek 40560786Sps#define write _write 40660786Sps#define creat _creat 40760786Sps#define fstat _fstat 40860786Sps#define isatty _isatty 40960786Sps#define close _close 41060786Sps#define read _read 41160786Sps#define ungetch _ungetch 41260786Sps#define kbhit _kbhit 41360786Sps#define getch _getch 41460786Sps#endif 415