defines.ds revision 161475
160786Sps/* 2161475Sdelphij * Copyright (C) 1984-2004 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 * 760786Sps * For more information about less, or for information on how to 860786Sps * contact the author, see the README file. 960786Sps */ 1060786Sps 1160786Sps 1260786Sps/* DOS definition file for less. */ 1360786Sps/* 1460786Sps * This file has 2 sections: 1560786Sps * User preferences. 1660786Sps * Settings always true for MS-DOS systems. 1760786Sps */ 1860786Sps 1960786Sps/* User preferences. */ 2060786Sps 2160786Sps/* 2260786Sps * SECURE is 1 if you wish to disable a bunch of features in order to 2360786Sps * be safe to run by unprivileged users. 2460786Sps */ 2560786Sps#define SECURE 0 2660786Sps 2760786Sps/* 2860786Sps * SHELL_ESCAPE is 1 if you wish to allow shell escapes. 2960786Sps * (This is possible only if your system supplies the system() function.) 3060786Sps */ 3160786Sps#define SHELL_ESCAPE (!SECURE) 3260786Sps 3360786Sps/* 3460786Sps * EXAMINE is 1 if you wish to allow examining files by name from within less. 3560786Sps */ 3660786Sps#define EXAMINE (!SECURE) 3760786Sps 3860786Sps/* 3960786Sps * TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key 4060786Sps * to complete filenames at prompts. 4160786Sps */ 4260786Sps#define TAB_COMPLETE_FILENAME (!SECURE) 4360786Sps 4460786Sps/* 4560786Sps * CMD_HISTORY is 1 if you wish to allow keys to cycle through 4660786Sps * previous commands at prompts. 4760786Sps */ 4860786Sps#define CMD_HISTORY 1 4960786Sps 5060786Sps/* 5160786Sps * HILITE_SEARCH is 1 if you wish to have search targets to be 5260786Sps * displayed in standout mode. 5360786Sps */ 5460786Sps#define HILITE_SEARCH 1 5560786Sps 5660786Sps/* 5760786Sps * EDITOR is 1 if you wish to allow editor invocation (the "v" command). 5860786Sps * (This is possible only if your system supplies the system() function.) 5960786Sps * EDIT_PGM is the name of the (default) editor to be invoked. 6060786Sps */ 6160786Sps#define EDITOR (!SECURE) 6260786Sps#define EDIT_PGM "vi" 6360786Sps 6460786Sps/* 6560786Sps * TAGS is 1 if you wish to support tag files. 6660786Sps */ 6760786Sps#define TAGS (!SECURE) 6860786Sps 6960786Sps/* 7060786Sps * USERFILE is 1 if you wish to allow a .less file to specify 7160786Sps * user-defined key bindings. 7260786Sps */ 7360786Sps#define USERFILE (!SECURE) 7460786Sps 7560786Sps/* 7660786Sps * GLOB is 1 if you wish to have shell metacharacters expanded in filenames. 7760786Sps * This will generally work if your system provides the "popen" function 7860786Sps * and the "echo" shell command. 7960786Sps */ 8060786Sps#ifdef __DJGPP__ 8160786Sps#define GLOB (!SECURE) 8260786Sps#else 8360786Sps#define GLOB 0 8460786Sps#endif 8560786Sps 8660786Sps/* 8760786Sps * PIPEC is 1 if you wish to have the "|" command 8860786Sps * which allows the user to pipe data into a shell command. 8960786Sps */ 9060786Sps#ifdef __DJGPP__ 9160786Sps#define PIPEC (!SECURE) 9260786Sps#else 9360786Sps#define PIPEC 0 9460786Sps#endif 9560786Sps 9660786Sps/* 9760786Sps * LOGFILE is 1 if you wish to allow the -l option (to create log files). 9860786Sps */ 9960786Sps#define LOGFILE (!SECURE) 10060786Sps 10160786Sps/* 10260786Sps * GNU_OPTIONS is 1 if you wish to support the GNU-style command 10360786Sps * line options --help and --version. 10460786Sps */ 10560786Sps#define GNU_OPTIONS 1 10660786Sps 10760786Sps/* 10860786Sps * ONLY_RETURN is 1 if you want RETURN to be the only input which 10960786Sps * will continue past an error message. 11060786Sps * Otherwise, any key will continue past an error message. 11160786Sps */ 11260786Sps#define ONLY_RETURN 0 11360786Sps 11460786Sps/* 11560786Sps * LESSKEYFILE is the filename of the default lesskey output file 11660786Sps * (in the HOME directory). 11760786Sps * LESSKEYFILE_SYS is the filename of the system-wide lesskey output file. 11860786Sps * DEF_LESSKEYINFILE is the filename of the default lesskey input 11960786Sps * (in the HOME directory). 120161475Sdelphij * LESSHISTFILE is the filename of the history file 121161475Sdelphij * (in the HOME directory). 12260786Sps */ 12360786Sps#define LESSKEYFILE "_less" 12460786Sps#define LESSKEYFILE_SYS "c:\\_sysless" 12560786Sps#define DEF_LESSKEYINFILE "_lesskey" 126161475Sdelphij#define LESSHISTFILE "_lesshst" 12760786Sps 12860786Sps 12960786Sps/* Settings always true for MS-DOS systems. */ 13060786Sps 13160786Sps/* 13260786Sps * Define MSDOS_COMPILER if compiling for MS-DOS. 13360786Sps */ 13460786Sps#ifdef __DJGPP__ 13560786Sps#define MSDOS_COMPILER DJGPPC 13660786Sps#else 13760786Sps#ifdef __BORLANDC__ 13860786Sps#define MSDOS_COMPILER BORLANDC 13960786Sps#else 14060786Sps#define MSDOS_COMPILER MSOFTC 14160786Sps#endif 14260786Sps#endif 14360786Sps 14460786Sps/* 14560786Sps * Pathname separator character. 14660786Sps */ 14760786Sps#define PATHNAME_SEP "\\" 14860786Sps 14960786Sps/* 15060786Sps * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>. 15160786Sps */ 15260786Sps#define HAVE_SYS_TYPES_H 1 15360786Sps 15460786Sps/* 15560786Sps * Define if you have the <sgstat.h> header file. 15660786Sps */ 15760786Sps#define HAVE_SGSTAT_H 0 15860786Sps 15960786Sps/* 16060786Sps * HAVE_PERROR is 1 if your system has the perror() call. 16160786Sps * (Actually, if it has sys_errlist, sys_nerr and errno.) 16260786Sps */ 16360786Sps#define HAVE_PERROR 1 16460786Sps 16560786Sps/* 16660786Sps * HAVE_TIME is 1 if your system has the time() call. 16760786Sps */ 16860786Sps#define HAVE_TIME 1 16960786Sps 17060786Sps/* 17160786Sps * HAVE_SHELL is 1 if your system supports a SHELL command interpreter. 17260786Sps */ 17360786Sps#define HAVE_SHELL 0 17460786Sps 175128345Stjr/* 176128345Stjr * Default shell metacharacters and meta-escape character. 177128345Stjr */ 178128345Stjr#define DEF_METACHARS "; *?\t\n'\"()<>|&" 179128345Stjr#define DEF_METAESCAPE "" 180128345Stjr 18160786Sps/* 18260786Sps * HAVE_DUP is 1 if your system has the dup() call. 18360786Sps */ 18460786Sps#define HAVE_DUP 1 18560786Sps 18660786Sps/* 18760786Sps * Sizes of various buffers. 18860786Sps */ 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 */ 19860786Sps 19960786Sps/* Define to `long' if <sys/types.h> doesn't define. */ 20060786Sps#if MSDOS_COMPILER==BORLANDC 20160786Sps#define off_t long 20260786Sps#endif 20360786Sps 20460786Sps/* Define if you need to in order for stat and other things to work. */ 20560786Sps/* #undef _POSIX_SOURCE */ 20660786Sps 20760786Sps/* Define as the return type of signal handlers (int or void). */ 20860786Sps#define RETSIGTYPE void 20960786Sps 21060786Sps 21160786Sps/* 21260786Sps * Regular expression library. 21360786Sps * Define exactly one of the following to be 1: 21460786Sps * HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h 21560786Sps * HAVE_RE_COMP: BSD re_comp() 21660786Sps * HAVE_REGCMP: System V regcmp() 21760786Sps * HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h 21860786Sps * NO_REGEX: pattern matching is supported, but without metacharacters. 21960786Sps */ 22060786Sps/* #undef HAVE_POSIX_REGCOMP */ 22160786Sps/* #undef HAVE_RE_COMP */ 22260786Sps/* #undef HAVE_REGCMP */ 22360786Sps/* #undef HAVE_V8_REGCOMP */ 22460786Sps#if MSDOS_COMPILER==DJGPPC 22560786Sps#define HAVE_POSIX_REGCOMP 1 22660786Sps#else 22760786Sps#define NO_REGEX 1 22860786Sps#endif 22960786Sps 23060786Sps/* Define HAVE_VOID if your compiler supports the "void" type. */ 23160786Sps#define HAVE_VOID 1 23260786Sps 23360786Sps/* Define HAVE_CONST if your compiler supports the "const" modifier. */ 23460786Sps#define HAVE_CONST 1 23560786Sps 23660786Sps/* Define HAVE_TIME_T if your system supports the "time_t" type. */ 23760786Sps#define HAVE_TIME_T 1 23860786Sps 23960786Sps/* Define HAVE_STRERROR if you have the strerror() function. */ 24060786Sps#define HAVE_STRERROR 1 24160786Sps 24260786Sps/* Define HAVE_FILENO if you have the fileno() macro. */ 24360786Sps#define HAVE_FILENO 1 24460786Sps 24560786Sps/* Define HAVE_ERRNO if you have the errno variable */ 24660786Sps/* Define MUST_DEFINE_ERRNO if you have errno but it is not defined 24760786Sps * in errno.h */ 24860786Sps#if MSDOS_COMPILER==MSOFTC || MSDOS_COMPILER==DJGPPC 24960786Sps#define HAVE_ERRNO 1 25060786Sps#define MUST_DEFINE_ERRNO 0 25160786Sps#else 25260786Sps#define HAVE_ERRNO 1 25360786Sps#define MUST_DEFINE_ERRNO 1 25460786Sps#endif 25560786Sps 25660786Sps/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */ 25760786Sps#define HAVE_SYS_ERRLIST 1 25860786Sps 25960786Sps/* Define HAVE_OSPEED if your termcap library has the ospeed variable */ 26060786Sps/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined 26160786Sps * in termcap.h. */ 26260786Sps#define HAVE_OSPEED 0 26360786Sps#define MUST_DEFINE_OSPEED 0 26460786Sps 26560786Sps/* Define HAVE_LOCALE if you have locale.h and setlocale. */ 26689019Sps#define HAVE_LOCALE 0 26760786Sps 26860786Sps/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */ 26960786Sps#define HAVE_TERMIOS_FUNCS 0 27060786Sps 27160786Sps/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */ 27260786Sps#define HAVE_UPPER_LOWER 1 27360786Sps 27460786Sps/* Define if you have the _setjmp function. */ 27560786Sps#if MSDOS_COMPILER==MSOFTC || MSDOS_COMPILER==DJGPPC 27660786Sps#define HAVE__SETJMP 0 27760786Sps#else 27860786Sps#define HAVE__SETJMP 1 27960786Sps#endif 28060786Sps 28160786Sps/* Define if you have the memcpy function. */ 28260786Sps#define HAVE_MEMCPY 1 28360786Sps 28460786Sps/* Define if you have the popen function. */ 28560786Sps#if MSDOS_COMPILER==DJGPPC 28660786Sps#define HAVE_POPEN 1 28760786Sps#else 28860786Sps#define HAVE_POPEN 0 28960786Sps#endif 29060786Sps 29160786Sps/* Define if you have the sigsetmask function. */ 29260786Sps#define HAVE_SIGSETMASK 0 29360786Sps 29463128Sps/* Define if you have the sigprocmask function. */ 29563128Sps#define HAVE_SIGPROCMASK 0 29663128Sps 29763128Sps/* Define if you have the sigset_t type and sigemptyset macro */ 29863128Sps#define HAVE_SIGSET_T 0 29963128Sps#define HAVE_SIGEMPTYSET 0 30063128Sps 30160786Sps/* Define if you have the stat function. */ 30260786Sps#define HAVE_STAT 1 30360786Sps 30460786Sps/* Define if you have the strchr function. */ 30560786Sps#define HAVE_STRCHR 1 30660786Sps 30760786Sps/* Define if you have the system function. */ 30860786Sps#define HAVE_SYSTEM 1 30960786Sps 310161475Sdelphij/* Define if you have the snprintf function. */ 311161475Sdelphij#define HAVE_SNPRINTF 0 312161475Sdelphij 31360786Sps/* Define if you have the <ctype.h> header file. */ 31460786Sps#define HAVE_CTYPE_H 1 31560786Sps 31660786Sps/* Define if you have the <errno.h> header file. */ 31760786Sps#define HAVE_ERRNO_H 1 31860786Sps 31960786Sps/* Define if you have the <fcntl.h> header file. */ 32060786Sps#define HAVE_FCNTL_H 1 32160786Sps 32260786Sps/* Define if you have the <limits.h> header file. */ 32360786Sps#define HAVE_LIMITS_H 1 32460786Sps 32560786Sps/* Define if you have the <stdio.h> header file. */ 32660786Sps#define HAVE_STDIO_H 1 32760786Sps 32860786Sps/* Define if you have the <stdlib> header file. */ 32960786Sps#define HAVE_STDLIB_H 1 33060786Sps 33160786Sps/* Define if you have the <string.h> header file. */ 33260786Sps#define HAVE_STRING_H 1 33360786Sps 33460786Sps/* Define if you have the <sys/ioctl.h> header file. */ 33560786Sps#define HAVE_SYS_IOCTL_H 0 33660786Sps 33760786Sps/* Define if you have the <sys/ptem.h> header file. */ 33860786Sps#define HAVE_SYS_PTEM_H 0 33960786Sps 34060786Sps/* Define if you have the <sys/stream.h> header file. */ 34160786Sps#define HAVE_SYS_STREAM_H 0 34260786Sps 34360786Sps/* Define if you have the <termcap.h> header file. */ 34460786Sps#define HAVE_TERMCAP_H 0 34560786Sps 34660786Sps/* Define if you have the <termio.h> header file. */ 34760786Sps#define HAVE_TERMIO_H 0 34860786Sps 34960786Sps/* Define if you have the <termios.h> header file. */ 35060786Sps#define HAVE_TERMIOS_H 0 35160786Sps 35260786Sps/* Define if you have the <time.h> header file. */ 35360786Sps#define HAVE_TIME_H 1 35460786Sps 35560786Sps/* Define if you have the <unistd.h> header file. */ 35660786Sps#if MSDOS_COMPILER==DJGPPC 35760786Sps#define HAVE_UNISTD_H 1 35860786Sps#else 35960786Sps#define HAVE_UNISTD_H 0 36060786Sps#endif 36160786Sps 36260786Sps/* Define if you have the <values.h> header file. */ 36360786Sps#if MSDOS_COMPILER==MSOFTC 36460786Sps#define HAVE_VALUES_H 0 36560786Sps#else 36660786Sps#define HAVE_VALUES_H 1 36760786Sps#endif 36860786Sps 36960786Sps#if MSDOS_COMPILER == MSOFTC && _MSC_VER >= 700 37060786Sps/* 37160786Sps * The names of these things changed in Microsoft C version 7.0. 37260786Sps */ 37360786Sps#define videoconfig _videoconfig 37460786Sps#define rccoord _rccoord 37560786Sps#define O_RDONLY _O_RDONLY 37660786Sps#define O_WRONLY _O_WRONLY 37760786Sps#define O_APPEND _O_APPEND 37860786Sps#define O_BINARY _O_BINARY 37960786Sps#define O_TEXT _O_TEXT 38060786Sps#define find_t _find_t 38160786Sps#define stat _stat 38260786Sps#define S_IFMT _S_IFMT 38360786Sps#define S_IFDIR _S_IFDIR 38460786Sps#define S_IFREG _S_IFREG 38560786Sps#define dup _dup 38660786Sps#define open _open 38760786Sps#define lseek _lseek 38860786Sps#define write _write 38960786Sps#define creat _creat 39060786Sps#define fstat _fstat 39160786Sps#define isatty _isatty 39260786Sps#define close _close 39360786Sps#define read _read 39460786Sps#define ungetch _ungetch 39560786Sps#define kbhit _kbhit 39660786Sps#define getch _getch 39760786Sps#endif 398