home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / less-321-src.tgz / tar.out / fsf / less / defines.dos < prev    next >
Text File  |  1996-09-28  |  10KB  |  368 lines

  1. /*
  2.  * Copyright (c) 1984,1985,1989,1994,1995,1996  Mark Nudelman
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice in the documentation and/or other materials provided with 
  12.  *    the distribution.
  13.  *
  14.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
  15.  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  16.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
  17.  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
  18.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
  19.  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
  20.  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
  21.  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
  22.  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
  23.  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 
  24.  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25.  */
  26.  
  27.  
  28. /* DOS definition file for less.  */
  29. /*
  30.  * This file has 2 sections:
  31.  * User preferences.
  32.  * Settings always true for MS-DOS systems. 
  33.  */
  34.  
  35. /* User preferences.  */
  36.  
  37. /*
  38.  * SECURE is 1 if you wish to disable a bunch of features in order to
  39.  * be safe to run by unprivileged users.
  40.  */
  41. #define    SECURE        0
  42.  
  43. /*
  44.  * SHELL_ESCAPE is 1 if you wish to allow shell escapes.
  45.  * (This is possible only if your system supplies the system() function.)
  46.  */
  47. #define    SHELL_ESCAPE    (!SECURE)
  48.  
  49. /*
  50.  * EXAMINE is 1 if you wish to allow examining files by name from within less.
  51.  */
  52. #define    EXAMINE        (!SECURE)
  53.  
  54. /*
  55.  * TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key
  56.  * to complete filenames at prompts.
  57.  */
  58. #define    TAB_COMPLETE_FILENAME    (!SECURE)
  59.  
  60. /*
  61.  * CMD_HISTORY is 1 if you wish to allow keys to cycle through
  62.  * previous commands at prompts.
  63.  */
  64. #define    CMD_HISTORY    1
  65.  
  66. /*
  67.  * HILITE_SEARCH is 1 if you wish to have search targets to be 
  68.  * displayed in standout mode.
  69.  */
  70. #define    HILITE_SEARCH    1
  71.  
  72. /*
  73.  * EDITOR is 1 if you wish to allow editor invocation (the "v" command).
  74.  * (This is possible only if your system supplies the system() function.)
  75.  * EDIT_PGM is the name of the (default) editor to be invoked.
  76.  */
  77. #define    EDITOR        (!SECURE)
  78. #define    EDIT_PGM    "vi"
  79.  
  80. /*
  81.  * TAGS is 1 if you wish to support tag files.
  82.  */
  83. #define    TAGS        (!SECURE)
  84.  
  85. /*
  86.  * USERFILE is 1 if you wish to allow a .less file to specify 
  87.  * user-defined key bindings.
  88.  */
  89. #define    USERFILE    (!SECURE)
  90.  
  91. /*
  92.  * GLOB is 1 if you wish to have shell metacharacters expanded in filenames.
  93.  * This will generally work if your system provides the "popen" function
  94.  * and the "echo" shell command.
  95.  */
  96. #define    GLOB        0
  97.  
  98. /*
  99.  * PIPEC is 1 if you wish to have the "|" command
  100.  * which allows the user to pipe data into a shell command.
  101.  */
  102. #define    PIPEC        0
  103.  
  104. /*
  105.  * LOGFILE is 1 if you wish to allow the -l option (to create log files).
  106.  */
  107. #define    LOGFILE        (!SECURE)
  108.  
  109. /*
  110.  * GNU_OPTIONS is 1 if you wish to support the GNU-style command
  111.  * line options --help and --version.
  112.  */
  113. #define    GNU_OPTIONS    1
  114.  
  115. /*
  116.  * ONLY_RETURN is 1 if you want RETURN to be the only input which
  117.  * will continue past an error message.
  118.  * Otherwise, any key will continue past an error message.
  119.  */
  120. #define    ONLY_RETURN    0
  121.  
  122. /*
  123.  * LESSKEYFILE is the filename of the default lesskey output file 
  124.  * (in the HOME directory).
  125.  * DEF_LESSKEYINFILE is the filename of the default lesskey input 
  126.  * (in the HOME directory).
  127.  */
  128. #define    LESSKEYFILE        "_less"
  129. #define    DEF_LESSKEYINFILE    "_lesskey"
  130.  
  131.  
  132. /* Settings always true for MS-DOS systems.  */
  133.  
  134. /*
  135.  * Define MSDOS_COMPILER if compiling for MS-DOS.
  136.  *  MSOFTC == Microsoft C
  137.  *  BORLANDC == Turbo/Borland C
  138.  */
  139. #ifdef __BORLANDC__
  140. #define    MSDOS_COMPILER        BORLANDC
  141. #else
  142. #define    MSDOS_COMPILER        MSOFTC
  143. #endif
  144.  
  145. /*
  146.  * Pathname separator character.
  147.  */
  148. #define    PATHNAME_SEP    "\\"
  149.  
  150. /*
  151.  * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>.
  152.  */
  153. #define HAVE_SYS_TYPES_H    1
  154.  
  155. /*
  156.  * Define if you have the <sgstat.h> header file.
  157.  */
  158. #define HAVE_SGSTAT_H    0
  159.  
  160. /*
  161.  * HAVE_STAT is 1 if your system has the stat() call.
  162.  */
  163. #define    HAVE_STAT    1
  164.  
  165. /*
  166.  * HAVE_PERROR is 1 if your system has the perror() call.
  167.  * (Actually, if it has sys_errlist, sys_nerr and errno.)
  168.  */
  169. #define    HAVE_PERROR    1
  170.  
  171. /*
  172.  * HAVE_TIME is 1 if your system has the time() call.
  173.  */
  174. #define    HAVE_TIME    1
  175.  
  176. /*
  177.  * HAVE_SHELL is 1 if your system supports a SHELL command interpreter.
  178.  */
  179. #define    HAVE_SHELL    0
  180.  
  181. /* 
  182.  * HAVE_DUP is 1 if your system has the dup() call.
  183.  */
  184. #define    HAVE_DUP    1
  185.  
  186. /*
  187.  * Sizes of various buffers.
  188.  */
  189. #define    CMDBUF_SIZE    512    /* Buffer for multichar commands */
  190. #define    UNGOT_SIZE    100    /* Max chars to unget() */
  191. #define    LINEBUF_SIZE    1024    /* Max size of line in input file */
  192. #define    OUTBUF_SIZE    1024    /* Output buffer */
  193. #define    PROMPT_SIZE    200    /* Max size of prompt string */
  194. #define    TERMBUF_SIZE    2048    /* Termcap buffer for tgetent */
  195. #define    TERMSBUF_SIZE    1024    /* Buffer to hold termcap strings */
  196. #define    TAGLINE_SIZE    512    /* Max size of line in tags file */
  197.  
  198. /* Define to `long' if <sys/types.h> doesn't define.  */
  199. #if MSDOS_COMPILER==BORLANDC
  200. #define    off_t    long 
  201. #endif
  202.  
  203. /* Define if you need to in order for stat and other things to work.  */
  204. /* #undef _POSIX_SOURCE */
  205.  
  206. /* Define as the return type of signal handlers (int or void).  */
  207. #define RETSIGTYPE void
  208.  
  209. /* Define if you have the ANSI C header files.  */
  210. #define STDC_HEADERS    1
  211.  
  212. /*
  213.  * Regular expression library.
  214.  * Define exactly one of the following to be 1:
  215.  * HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h
  216.  * HAVE_RE_COMP: BSD re_comp()
  217.  * HAVE_REGCMP: System V regcmp()
  218.  * HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h
  219.  * NO_REGEX: pattern matching is supported, but without metacharacters.
  220.  */
  221. /* #undef HAVE_POSIX_REGCOMP */
  222. /* #undef HAVE_RE_COMP */
  223. /* #undef HAVE_REGCMP */
  224. /* #undef HAVE_V8_REGCOMP */
  225. #define NO_REGEX 1
  226.  
  227. /* Define HAVE_VOID if your compiler supports the "void" type. */
  228. #define HAVE_VOID 1
  229.  
  230. /* Define HAVE_CONST if your compiler supports the "const" modifier. */
  231. #define HAVE_CONST 1
  232.  
  233. /* Define HAVE_TIME_T if your system supports the "time_t" type. */
  234. #define HAVE_TIME_T 1
  235.  
  236. /* Define HAVE_STRERROR if you have the strerror() function. */
  237. #define HAVE_STRERROR 1
  238.  
  239. /* Define HAVE_FILENO if you have the fileno() macro. */
  240. #define HAVE_FILENO 1
  241.  
  242. /* Define HAVE_ERRNO if you have the errno variable */
  243. /* Define MUST_DEFINE_ERRNO if you have errno but it is not define 
  244.  * in errno.h */
  245. #if MSDOS_COMPILER==MSOFTC
  246. #define HAVE_ERRNO 1
  247. #define MUST_DEFINE_ERRNO 0
  248. #else
  249. #define HAVE_ERRNO 1
  250. #define MUST_DEFINE_ERRNO 1
  251. #endif
  252.  
  253. /* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
  254. #define HAVE_SYS_ERRLIST 1
  255.  
  256. /* Define HAVE_OSPEED if your termcap library has the ospeed variable */
  257. /* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined
  258.  * in termcap.h. */
  259. #define HAVE_OSPEED 0
  260. #define MUST_DEFINE_OSPEED 0
  261.  
  262. /* Define HAVE_LOCALE if you have locale.h and setlocale. */
  263. #define HAVE_LOCALE 1
  264.  
  265. /* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */
  266. #define HAVE_TERMIOS_FUNCS 0
  267.  
  268. /* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */
  269. #define HAVE_UPPER_LOWER 1
  270.  
  271. /* Define if you have the _setjmp function.  */
  272. #if MSDOS_COMPILER==MSOFTC
  273. #define HAVE__SETJMP    0
  274. #else
  275. #define HAVE__SETJMP    1
  276. #endif
  277.  
  278. /* Define if you have the memcpy function.  */
  279. #define HAVE_MEMCPY 1
  280.  
  281. /* Define if you have the sigsetmask function.  */
  282. #define HAVE_SIGSETMASK    0
  283.  
  284. /* Define if you have the strchr function.  */
  285. #define HAVE_STRCHR 1
  286.  
  287. /* Define if you have the system function.  */
  288. #define HAVE_SYSTEM    1
  289.  
  290. /* Define if you have the <ctype.h> header file.  */
  291. #define HAVE_CTYPE_H 1
  292.  
  293. /* Define if you have the <errno.h> header file.  */
  294. #define HAVE_ERRNO_H 1
  295.  
  296. /* Define if you have the <fcntl.h> header file.  */
  297. #define HAVE_FCNTL_H 1
  298.  
  299. /* Define if you have the <limits.h> header file.  */
  300. #define HAVE_LIMITS_H 1
  301.  
  302. /* Define if you have the <stdio.h> header file.  */
  303. #define HAVE_STDIO_H 1
  304.  
  305. /* Define if you have the <string.h> header file.  */
  306. #define HAVE_STRING_H 1
  307.  
  308. /* Define if you have the <sys/ioctl.h> header file.  */
  309. #define HAVE_SYS_IOCTL_H 0
  310.  
  311. /* Define if you have the <sys/ptem.h> header file.  */
  312. #define HAVE_SYS_PTEM_H    0
  313.  
  314. /* Define if you have the <sys/stream.h> header file.  */
  315. #define HAVE_SYS_STREAM_H    0
  316.  
  317. /* Define if you have the <termcap.h> header file.  */
  318. #define HAVE_TERMCAP_H    0
  319.  
  320. /* Define if you have the <termio.h> header file.  */
  321. #define HAVE_TERMIO_H    0
  322.  
  323. /* Define if you have the <termios.h> header file.  */
  324. #define HAVE_TERMIOS_H 0
  325.  
  326. /* Define if you have the <time.h> header file.  */
  327. #define HAVE_TIME_H 1
  328.  
  329. /* Define if you have the <unistd.h> header file.  */
  330. #define HAVE_UNISTD_H 0
  331.  
  332. /* Define if you have the <values.h> header file.  */
  333. #if MSDOS_COMPILER==MSOFTC
  334. #define HAVE_VALUES_H 0
  335. #else
  336. #define HAVE_VALUES_H 1
  337. #endif
  338.  
  339. #if MSDOS_COMPILER == MSOFTC && _MSC_VER >= 700
  340. /*
  341.  * The names of these things changed in Microsoft C version 7.0.
  342.  */
  343. #define videoconfig    _videoconfig
  344. #define rccoord        _rccoord
  345. #define O_RDONLY    _O_RDONLY
  346. #define O_WRONLY    _O_WRONLY
  347. #define O_APPEND    _O_APPEND
  348. #define O_BINARY    _O_BINARY
  349. #define O_TEXT        _O_TEXT
  350. #define find_t        _find_t
  351. #define stat        _stat
  352. #define S_IFMT        _S_IFMT
  353. #define S_IFDIR        _S_IFDIR
  354. #define S_IFREG        _S_IFREG
  355. #define dup        _dup
  356. #define open        _open
  357. #define lseek        _lseek
  358. #define write        _write
  359. #define creat        _creat
  360. #define fstat        _fstat
  361. #define isatty        _isatty
  362. #define close        _close
  363. #define read        _read
  364. #define ungetch        _ungetch
  365. #define kbhit        _kbhit
  366. #define getch        _getch
  367. #endif
  368.