120006a0bStron/* 2*e4a6e799Ssimonb * Copyright (C) 1984-2023 Mark Nudelman 320006a0bStron * 420006a0bStron * You may distribute under the terms of either the GNU General Public 520006a0bStron * License or the Less License, as specified in the README file. 620006a0bStron * 7749ad2faStron * For more information, see the README file. 820006a0bStron */ 920006a0bStron 1020006a0bStron 1120006a0bStron/* Windows definition file for less. */ 1220006a0bStron/* 1320006a0bStron * This file has 2 sections: 1420006a0bStron * User preferences. 1520006a0bStron * Settings always true for Windows systems. 1620006a0bStron */ 1720006a0bStron 1820006a0bStron 1920006a0bStron/* User preferences. */ 2020006a0bStron 2120006a0bStron/* 2220006a0bStron * SECURE is 1 if you wish to disable a bunch of features in order to 2320006a0bStron * be safe to run by unprivileged users. 2420006a0bStron */ 2520006a0bStron#define SECURE 0 2620006a0bStron 2720006a0bStron/* 2820006a0bStron * SHELL_ESCAPE is 1 if you wish to allow shell escapes. 2920006a0bStron * (This is possible only if your system supplies the system() function.) 3020006a0bStron */ 3120006a0bStron#define SHELL_ESCAPE (!SECURE) 3220006a0bStron 3320006a0bStron/* 3420006a0bStron * EXAMINE is 1 if you wish to allow examining files by name from within less. 3520006a0bStron */ 3620006a0bStron#define EXAMINE (!SECURE) 3720006a0bStron 3820006a0bStron/* 3920006a0bStron * TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key 4020006a0bStron * to complete filenames at prompts. 4120006a0bStron */ 4220006a0bStron#define TAB_COMPLETE_FILENAME (!SECURE) 4320006a0bStron 4420006a0bStron/* 4520006a0bStron * CMD_HISTORY is 1 if you wish to allow keys to cycle through 4620006a0bStron * previous commands at prompts. 4720006a0bStron */ 4820006a0bStron#define CMD_HISTORY 1 4920006a0bStron 5020006a0bStron/* 5120006a0bStron * HILITE_SEARCH is 1 if you wish to have search targets to be 5220006a0bStron * displayed in standout mode. 5320006a0bStron */ 5420006a0bStron#define HILITE_SEARCH 1 5520006a0bStron 5620006a0bStron/* 5720006a0bStron * EDITOR is 1 if you wish to allow editor invocation (the "v" command). 5820006a0bStron * (This is possible only if your system supplies the system() function.) 5920006a0bStron * EDIT_PGM is the name of the (default) editor to be invoked. 6020006a0bStron */ 6120006a0bStron#define EDITOR (!SECURE) 6220006a0bStron#define EDIT_PGM "edit" 6320006a0bStron 6420006a0bStron/* 6520006a0bStron * TAGS is 1 if you wish to support tag files. 6620006a0bStron */ 6720006a0bStron#define TAGS (!SECURE) 6820006a0bStron 6920006a0bStron/* 7020006a0bStron * USERFILE is 1 if you wish to allow a .less file to specify 7120006a0bStron * user-defined key bindings. 7220006a0bStron */ 7320006a0bStron#define USERFILE (!SECURE) 7420006a0bStron 7520006a0bStron/* 7620006a0bStron * GLOB is 1 if you wish to have shell metacharacters expanded in filenames. 7720006a0bStron * This will generally work if your system provides the "popen" function 7820006a0bStron * and the "echo" shell command. 7920006a0bStron */ 8020006a0bStron#define GLOB 0 8120006a0bStron 8220006a0bStron/* 8320006a0bStron * PIPEC is 1 if you wish to have the "|" command 8420006a0bStron * which allows the user to pipe data into a shell command. 8520006a0bStron */ 8620006a0bStron#define PIPEC 1 8720006a0bStron 8820006a0bStron/* 89*e4a6e799Ssimonb * LOGFILE is 1 if you wish to allow the -o option (to create log files). 9020006a0bStron */ 9120006a0bStron#define LOGFILE (!SECURE) 9220006a0bStron 9320006a0bStron/* 9420006a0bStron * GNU_OPTIONS is 1 if you wish to support the GNU-style command 9520006a0bStron * line options --help and --version. 9620006a0bStron */ 9720006a0bStron#define GNU_OPTIONS 1 9820006a0bStron 9920006a0bStron/* 10020006a0bStron * ONLY_RETURN is 1 if you want RETURN to be the only input which 10120006a0bStron * will continue past an error message. 10220006a0bStron * Otherwise, any key will continue past an error message. 10320006a0bStron */ 10420006a0bStron#define ONLY_RETURN 0 10520006a0bStron 10620006a0bStron/* 10720006a0bStron * LESSKEYFILE is the filename of the default lesskey output file 10820006a0bStron * (in the HOME directory). 10920006a0bStron * LESSKEYFILE_SYS is the filename of the system-wide lesskey output file. 11020006a0bStron * DEF_LESSKEYINFILE is the filename of the default lesskey input 11120006a0bStron * (in the HOME directory). 11220006a0bStron * LESSHISTFILE is the filename of the history file 11320006a0bStron * (in the HOME directory). 11420006a0bStron */ 11520006a0bStron#define LESSKEYFILE "_less" 11620006a0bStron#define LESSKEYFILE_SYS "c:\\_sysless" 11720006a0bStron#define DEF_LESSKEYINFILE "_lesskey" 118*e4a6e799Ssimonb#define LESSKEYINFILE_SYS "c:\\_syslesskey" 11920006a0bStron#define LESSHISTFILE "_lesshst" 12020006a0bStron 12120006a0bStron 12220006a0bStron/* Settings always true for Windows systems. */ 12320006a0bStron 12420006a0bStron#define MSDOS_COMPILER WIN32C 12520006a0bStron 12620006a0bStron/* 12720006a0bStron * Pathname separator character. 12820006a0bStron */ 12920006a0bStron#define PATHNAME_SEP "\\" 13020006a0bStron 13120006a0bStron/* 132*e4a6e799Ssimonb * HAVE_ANSI_PROTOS is 1 if your compiler supports ANSI function prototypes. 133*e4a6e799Ssimonb */ 134*e4a6e799Ssimonb#define HAVE_ANSI_PROTOS 1 135*e4a6e799Ssimonb 136*e4a6e799Ssimonb/* 13720006a0bStron * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>. 13820006a0bStron */ 13920006a0bStron#define HAVE_SYS_TYPES_H 1 14020006a0bStron 14120006a0bStron/* 14220006a0bStron * Define if you have the <sgstat.h> header file. 14320006a0bStron */ 14420006a0bStron#define HAVE_SGSTAT_H 0 14520006a0bStron 14620006a0bStron/* 14720006a0bStron * HAVE_PERROR is 1 if your system has the perror() call. 14820006a0bStron * (Actually, if it has sys_errlist, sys_nerr and errno.) 14920006a0bStron */ 15020006a0bStron#define HAVE_PERROR 1 15120006a0bStron 15220006a0bStron/* 15320006a0bStron * HAVE_TIME is 1 if your system has the time() call. 15420006a0bStron */ 15520006a0bStron#define HAVE_TIME 1 15620006a0bStron 15720006a0bStron/* 15820006a0bStron * HAVE_SHELL is 1 if your system supports a SHELL command interpreter. 15920006a0bStron */ 16020006a0bStron#define HAVE_SHELL 0 16120006a0bStron 16220006a0bStron/* 16320006a0bStron * Default shell metacharacters and meta-escape character. 16420006a0bStron */ 16520006a0bStron#define DEF_METACHARS "; *?\t\n'\"()<>|&" 16620006a0bStron#define DEF_METAESCAPE "" 16720006a0bStron 16820006a0bStron/* 16920006a0bStron * HAVE_DUP is 1 if your system has the dup() call. 17020006a0bStron */ 17120006a0bStron#define HAVE_DUP 1 17220006a0bStron 173*e4a6e799Ssimonb/* Define to 1 to support reading lesskey source files (not just binary). */ 174*e4a6e799Ssimonb#define HAVE_LESSKEYSRC 1 175*e4a6e799Ssimonb 17620006a0bStron/* 17720006a0bStron * Sizes of various buffers. 17820006a0bStron */ 179*e4a6e799Ssimonb#if 0 /* old sizes for small memory machines */ 18020006a0bStron#define CMDBUF_SIZE 512 /* Buffer for multichar commands */ 18120006a0bStron#define UNGOT_SIZE 100 /* Max chars to unget() */ 18220006a0bStron#define LINEBUF_SIZE 1024 /* Max size of line in input file */ 18320006a0bStron#define OUTBUF_SIZE 1024 /* Output buffer */ 18420006a0bStron#define PROMPT_SIZE 200 /* Max size of prompt string */ 18520006a0bStron#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ 18620006a0bStron#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ 18720006a0bStron#define TAGLINE_SIZE 512 /* Max size of line in tags file */ 18820006a0bStron#define TABSTOP_MAX 32 /* Max number of custom tab stops */ 189749ad2faStron#else /* more reasonable sizes for modern machines */ 190749ad2faStron#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ 191749ad2faStron#define UNGOT_SIZE 200 /* Max chars to unget() */ 192749ad2faStron#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ 193749ad2faStron#define OUTBUF_SIZE 1024 /* Output buffer */ 194749ad2faStron#define PROMPT_SIZE 2048 /* Max size of prompt string */ 195749ad2faStron#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ 196749ad2faStron#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ 197749ad2faStron#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ 198749ad2faStron#define TABSTOP_MAX 128 /* Max number of custom tab stops */ 199749ad2faStron#endif 20020006a0bStron 20120006a0bStron/* Define to `long' if <sys/types.h> doesn't define. */ 20220006a0bStron/* #define off_t long */ 20320006a0bStron 20420006a0bStron/* Define if you need to in order for stat and other things to work. */ 20520006a0bStron/* #undef _POSIX_SOURCE */ 20620006a0bStron 20720006a0bStron/* Define as the return type of signal handlers (int or void). */ 20820006a0bStron#define RETSIGTYPE void 20920006a0bStron 21020006a0bStron 21120006a0bStron/* 21220006a0bStron * Regular expression library. 21320006a0bStron * Define exactly one of the following to be 1: 21420006a0bStron * HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h 21520006a0bStron * HAVE_RE_COMP: BSD re_comp() 21620006a0bStron * HAVE_REGCMP: System V regcmp() 21720006a0bStron * HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h 21820006a0bStron * NO_REGEX: pattern matching is supported, but without metacharacters. 21920006a0bStron */ 22020006a0bStron/* #undef HAVE_POSIX_REGCOMP */ 22120006a0bStron/* #undef HAVE_RE_COMP */ 22220006a0bStron/* #undef HAVE_REGCMP */ 223*e4a6e799Ssimonb#ifdef MINGW 224*e4a6e799Ssimonb #ifdef USE_POSIX_REGCOMP 225*e4a6e799Ssimonb #define HAVE_POSIX_REGCOMP 1 226*e4a6e799Ssimonb #else 227*e4a6e799Ssimonb #ifdef USE_GNU_REGEX 228*e4a6e799Ssimonb #define HAVE_GNU_REGEX 1 229*e4a6e799Ssimonb #else 230*e4a6e799Ssimonb #ifdef USE_REGEXP_C 231*e4a6e799Ssimonb #define HAVE_V8_REGCOMP 1 232*e4a6e799Ssimonb #define HAVE_REGEXEC2 1 233*e4a6e799Ssimonb #else 234*e4a6e799Ssimonb #define NO_REGEX 1 235*e4a6e799Ssimonb #endif 236*e4a6e799Ssimonb #endif 237*e4a6e799Ssimonb #endif 238*e4a6e799Ssimonb#else 23920006a0bStron#define HAVE_V8_REGCOMP 1 24020006a0bStron/* #undef NO_REGEX */ 24120006a0bStron#define HAVE_REGEXEC2 1 242*e4a6e799Ssimonb#endif 24320006a0bStron 24420006a0bStron/* Define HAVE_VOID if your compiler supports the "void" type. */ 24520006a0bStron#define HAVE_VOID 1 24620006a0bStron 24720006a0bStron/* Define HAVE_CONST if your compiler supports the "const" modifier. */ 24820006a0bStron#define HAVE_CONST 1 24920006a0bStron 25020006a0bStron/* Define HAVE_TIME_T if your system supports the "time_t" type. */ 25120006a0bStron#define HAVE_TIME_T 1 25220006a0bStron 25320006a0bStron/* Define HAVE_STRERROR if you have the strerror() function. */ 25420006a0bStron#define HAVE_STRERROR 1 25520006a0bStron 25620006a0bStron/* Define HAVE_FILENO if you have the fileno() macro. */ 25720006a0bStron#define HAVE_FILENO 1 25820006a0bStron 25920006a0bStron/* Define HAVE_ERRNO if you have the errno variable */ 26020006a0bStron/* Define MUST_DEFINE_ERRNO if you have errno but it is not define 26120006a0bStron * in errno.h */ 26220006a0bStron#define HAVE_ERRNO 1 263*e4a6e799Ssimonb#define MUST_DEFINE_ERRNO 0 26420006a0bStron 26520006a0bStron/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */ 26620006a0bStron#define HAVE_SYS_ERRLIST 1 26720006a0bStron 26820006a0bStron/* Define HAVE_OSPEED if your termcap library has the ospeed variable */ 26920006a0bStron#define HAVE_OSPEED 0 27020006a0bStron/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined 27120006a0bStron * in termcap.h. */ 27220006a0bStron#define MUST_DEFINE_OSPEED 0 27320006a0bStron 27420006a0bStron/* Define HAVE_LOCALE if you have locale.h and setlocale. */ 27520006a0bStron#define HAVE_LOCALE 0 27620006a0bStron 27720006a0bStron/* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */ 27820006a0bStron#define HAVE_TERMIOS_FUNCS 0 27920006a0bStron 28020006a0bStron/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */ 28120006a0bStron#define HAVE_UPPER_LOWER 1 28220006a0bStron 28320006a0bStron/* Define if you have the _setjmp function. */ 28420006a0bStron#define HAVE__SETJMP 1 28520006a0bStron 28620006a0bStron/* Define if you have the memcpy function. */ 28720006a0bStron#define HAVE_MEMCPY 1 28820006a0bStron 28920006a0bStron/* Define if you have the popen function. */ 29020006a0bStron#define HAVE_POPEN 1 29120006a0bStron 29220006a0bStron/* Define if you have the sigsetmask function. */ 29320006a0bStron#define HAVE_SIGSETMASK 0 29420006a0bStron 29520006a0bStron/* Define if you have the sigprocmask function. */ 29620006a0bStron#define HAVE_SIGPROCMASK 0 29720006a0bStron 29820006a0bStron/* Define if you have the sigset_t type and sigemptyset macro */ 29920006a0bStron#define HAVE_SIGSET_T 0 30020006a0bStron#define HAVE_SIGEMPTYSET 0 30120006a0bStron 30220006a0bStron/* Define if you have the stat function. */ 30320006a0bStron#define HAVE_STAT 1 30420006a0bStron 30520006a0bStron/* Define if you have the strchr function. */ 30620006a0bStron#define HAVE_STRCHR 1 30720006a0bStron 30820006a0bStron/* Define if you have the system function. */ 30920006a0bStron#define HAVE_SYSTEM 1 31020006a0bStron 31120006a0bStron/* Define if you have the snprintf function. */ 31220006a0bStron#define HAVE_SNPRINTF 1 31320006a0bStron 31420006a0bStron/* Define if you have the <ctype.h> header file. */ 31520006a0bStron#define HAVE_CTYPE_H 1 31620006a0bStron 31720006a0bStron/* Define if you have the <wctype.h> header file. */ 31820006a0bStron#define HAVE_WCTYPE_H 1 31920006a0bStron 32020006a0bStron/* Define if you have the <errno.h> header file. */ 32120006a0bStron#define HAVE_ERRNO_H 1 32220006a0bStron 32320006a0bStron/* Define if you have the <fcntl.h> header file. */ 32420006a0bStron#define HAVE_FCNTL_H 1 32520006a0bStron 32620006a0bStron/* Define if you have the <limits.h> header file. */ 32720006a0bStron#define HAVE_LIMITS_H 1 32820006a0bStron 32920006a0bStron/* Define if you have the <stdio.h> header file. */ 33020006a0bStron#define HAVE_STDIO_H 1 33120006a0bStron 33220006a0bStron/* Define if you have the <string.h> header file. */ 33320006a0bStron#define HAVE_STRING_H 1 33420006a0bStron 33520006a0bStron/* Define if you have the <stdlib> header file. */ 33620006a0bStron#define HAVE_STDLIB_H 1 33720006a0bStron 33820006a0bStron/* Define if you have the <sys/ioctl.h> header file. */ 33920006a0bStron#define HAVE_SYS_IOCTL_H 0 34020006a0bStron 34120006a0bStron/* Define if you have the <sys/ptem.h> header file. */ 34220006a0bStron#define HAVE_SYS_PTEM_H 0 34320006a0bStron 34420006a0bStron/* Define if you have the <sys/stream.h> header file. */ 34520006a0bStron#define HAVE_SYS_STREAM_H 0 34620006a0bStron 34720006a0bStron/* Define if you have the <termcap.h> header file. */ 34820006a0bStron#define HAVE_TERMCAP_H 0 34920006a0bStron 35020006a0bStron/* Define if you have the <termio.h> header file. */ 35120006a0bStron#define HAVE_TERMIO_H 0 35220006a0bStron 35320006a0bStron/* Define if you have the <termios.h> header file. */ 35420006a0bStron#define HAVE_TERMIOS_H 0 35520006a0bStron 35620006a0bStron/* Define if you have the <time.h> header file. */ 35720006a0bStron#define HAVE_TIME_H 1 35820006a0bStron 35920006a0bStron/* Define if you have the <unistd.h> header file. */ 360*e4a6e799Ssimonb#ifdef MINGW 361*e4a6e799Ssimonb#define HAVE_UNISTD_H 1 362*e4a6e799Ssimonb#else 36320006a0bStron#define HAVE_UNISTD_H 0 364*e4a6e799Ssimonb#endif 36520006a0bStron 36620006a0bStron/* Define if you have the <values.h> header file. */ 36720006a0bStron#ifdef _MSC_VER 36820006a0bStron#define HAVE_VALUES_H 0 36920006a0bStron#else 370*e4a6e799Ssimonb#ifdef MINGW 371*e4a6e799Ssimonb#define HAVE_VALUES_H 0 372*e4a6e799Ssimonb#else 37320006a0bStron#define HAVE_VALUES_H 1 37420006a0bStron#endif 375*e4a6e799Ssimonb#endif 37620006a0bStron 37720006a0bStron#define popen _popen 378*e4a6e799Ssimonb#if !defined(_MSC_VER) || (_MSC_VER < 1900) 37920006a0bStron#define snprintf _snprintf 380*e4a6e799Ssimonb#endif 38120006a0bStron 382*e4a6e799Ssimonb#ifndef MINGW 38320006a0bStron#pragma warning(disable:4996) 384*e4a6e799Ssimonb#endif 385