home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / CMDS / less_332.lzh / less_332 / defines.ds < prev    next >
Text File  |  1998-03-03  |  10KB  |  391 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. #ifdef __DJGPP__
  97. #define    GLOB        (!SECURE)
  98. #else
  99. #define    GLOB        0
  100. #endif
  101.  
  102. /*
  103.  * PIPEC is 1 if you wish to have the "|" command
  104.  * which allows the user to pipe data into a shell command.
  105.  */
  106. #ifdef __DJGPP__
  107. #define    PIPEC        (!SECURE)
  108. #else
  109. #define    PIPEC        0
  110. #endif
  111.  
  112. /*
  113.  * LOGFILE is 1 if you wish to allow the -l option (to create log files).
  114.  */
  115. #define    LOGFILE        (!SECURE)
  116.  
  117. /*
  118.  * GNU_OPTIONS is 1 if you wish to support the GNU-style command
  119.  * line options --help and --version.
  120.  */
  121. #define    GNU_OPTIONS    1
  122.  
  123. /*
  124.  * ONLY_RETURN is 1 if you want RETURN to be the only input which
  125.  * will continue past an error message.
  126.  * Otherwise, any key will continue past an error message.
  127.  */
  128. #define    ONLY_RETURN    0
  129.  
  130. /*
  131.  * LESSKEYFILE is the filename of the default lesskey output file 
  132.  * (in the HOME directory).
  133.  * DEF_LESSKEYINFILE is the filename of the default lesskey input 
  134.  * (in the HOME directory).
  135.  */
  136. #define    LESSKEYFILE        "_less"
  137. #define    DEF_LESSKEYINFILE    "_lesskey"
  138.  
  139.  
  140. /* Settings always true for MS-DOS systems.  */
  141.  
  142. /*
  143.  * Define MSDOS_COMPILER if compiling for MS-DOS.
  144.  */
  145. #ifdef __DJGPP__
  146. #define    MSDOS_COMPILER        DJGPPC
  147. #else
  148. #ifdef __BORLANDC__
  149. #define    MSDOS_COMPILER        BORLANDC
  150. #else
  151. #define    MSDOS_COMPILER        MSOFTC
  152. #endif
  153. #endif
  154.  
  155. /*
  156.  * Pathname separator character.
  157.  */
  158. #define    PATHNAME_SEP    "\\"
  159.  
  160. /*
  161.  * HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>.
  162.  */
  163. #define HAVE_SYS_TYPES_H    1
  164.  
  165. /*
  166.  * Define if you have the <sgstat.h> header file.
  167.  */
  168. #define HAVE_SGSTAT_H    0
  169.  
  170. /*
  171.  * HAVE_PERROR is 1 if your system has the perror() call.
  172.  * (Actually, if it has sys_errlist, sys_nerr and errno.)
  173.  */
  174. #define    HAVE_PERROR    1
  175.  
  176. /*
  177.  * HAVE_TIME is 1 if your system has the time() call.
  178.  */
  179. #define    HAVE_TIME    1
  180.  
  181. /*
  182.  * HAVE_SHELL is 1 if your system supports a SHELL command interpreter.
  183.  */
  184. #define    HAVE_SHELL    0
  185.  
  186. /* 
  187.  * HAVE_DUP is 1 if your system has the dup() call.
  188.  */
  189. #define    HAVE_DUP    1
  190.  
  191. /*
  192.  * Sizes of various buffers.
  193.  */
  194. #define    CMDBUF_SIZE    512    /* Buffer for multichar commands */
  195. #define    UNGOT_SIZE    100    /* Max chars to unget() */
  196. #define    LINEBUF_SIZE    1024    /* Max size of line in input file */
  197. #define    OUTBUF_SIZE    1024    /* Output buffer */
  198. #define    PROMPT_SIZE    200    /* Max size of prompt string */
  199. #define    TERMBUF_SIZE    2048    /* Termcap buffer for tgetent */
  200. #define    TERMSBUF_SIZE    1024    /* Buffer to hold termcap strings */
  201. #define    TAGLINE_SIZE    512    /* Max size of line in tags file */
  202.  
  203. /* Define to `long' if <sys/types.h> doesn't define.  */
  204. #if MSDOS_COMPILER==BORLANDC
  205. #define    off_t    long 
  206. #endif
  207.  
  208. /* Define if you need to in order for stat and other things to work.  */
  209. /* #undef _POSIX_SOURCE */
  210.  
  211. /* Define as the return type of signal handlers (int or void).  */
  212. #define RETSIGTYPE void
  213.  
  214. /* Define if you have the ANSI C header files.  */
  215. #define STDC_HEADERS    1
  216.  
  217. /*
  218.  * Regular expression library.
  219.  * Define exactly one of the following to be 1:
  220.  * HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h
  221.  * HAVE_RE_COMP: BSD re_comp()
  222.  * HAVE_REGCMP: System V regcmp()
  223.  * HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h
  224.  * NO_REGEX: pattern matching is supported, but without metacharacters.
  225.  */
  226. /* #undef HAVE_POSIX_REGCOMP */
  227. /* #undef HAVE_RE_COMP */
  228. /* #undef HAVE_REGCMP */
  229. /* #undef HAVE_V8_REGCOMP */
  230. #if MSDOS_COMPILER==DJGPPC
  231. #define    HAVE_POSIX_REGCOMP 1
  232. #else
  233. #define NO_REGEX 1
  234. #endif
  235.  
  236. /* Define HAVE_VOID if your compiler supports the "void" type. */
  237. #define HAVE_VOID 1
  238.  
  239. /* Define HAVE_CONST if your compiler supports the "const" modifier. */
  240. #define HAVE_CONST 1
  241.  
  242. /* Define HAVE_TIME_T if your system supports the "time_t" type. */
  243. #define HAVE_TIME_T 1
  244.  
  245. /* Define HAVE_STRERROR if you have the strerror() function. */
  246. #define HAVE_STRERROR 1
  247.  
  248. /* Define HAVE_FILENO if you have the fileno() macro. */
  249. #define HAVE_FILENO 1
  250.  
  251. /* Define HAVE_ERRNO if you have the errno variable */
  252. /* Define MUST_DEFINE_ERRNO if you have errno but it is not defined
  253.  * in errno.h */
  254. #if MSDOS_COMPILER==MSOFTC || MSDOS_COMPILER==DJGPPC
  255. #define HAVE_ERRNO 1
  256. #define MUST_DEFINE_ERRNO 0
  257. #else
  258. #define HAVE_ERRNO 1
  259. #define MUST_DEFINE_ERRNO 1
  260. #endif
  261.  
  262. /* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
  263. #define HAVE_SYS_ERRLIST 1
  264.  
  265. /* Define HAVE_OSPEED if your termcap library has the ospeed variable */
  266. /* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined
  267.  * in termcap.h. */
  268. #define HAVE_OSPEED 0
  269. #define MUST_DEFINE_OSPEED 0
  270.  
  271. /* Define HAVE_LOCALE if you have locale.h and setlocale. */
  272. #define HAVE_LOCALE 1
  273.  
  274. /* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */
  275. #define HAVE_TERMIOS_FUNCS 0
  276.  
  277. /* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */
  278. #define HAVE_UPPER_LOWER 1
  279.  
  280. /* Define if you have the _setjmp function.  */
  281. #if MSDOS_COMPILER==MSOFTC || MSDOS_COMPILER==DJGPPC
  282. #define HAVE__SETJMP    0
  283. #else
  284. #define HAVE__SETJMP    1
  285. #endif
  286.  
  287. /* Define if you have the memcpy function.  */
  288. #define HAVE_MEMCPY 1
  289.  
  290. /* Define if you have the popen function.  */
  291. #if MSDOS_COMPILER==DJGPPC
  292. #define HAVE_POPEN    1
  293. #else
  294. #define HAVE_POPEN    0
  295. #endif
  296.  
  297. /* Define if you have the sigsetmask function.  */
  298. #define HAVE_SIGSETMASK    0
  299.  
  300. /* Define if you have the stat function.  */
  301. #define HAVE_STAT 1
  302.  
  303. /* Define if you have the strchr function.  */
  304. #define HAVE_STRCHR 1
  305.  
  306. /* Define if you have the system function.  */
  307. #define HAVE_SYSTEM    1
  308.  
  309. /* Define if you have the <ctype.h> header file.  */
  310. #define HAVE_CTYPE_H 1
  311.  
  312. /* Define if you have the <errno.h> header file.  */
  313. #define HAVE_ERRNO_H 1
  314.  
  315. /* Define if you have the <fcntl.h> header file.  */
  316. #define HAVE_FCNTL_H 1
  317.  
  318. /* Define if you have the <limits.h> header file.  */
  319. #define HAVE_LIMITS_H 1
  320.  
  321. /* Define if you have the <stdio.h> header file.  */
  322. #define HAVE_STDIO_H 1
  323.  
  324. /* Define if you have the <string.h> header file.  */
  325. #define HAVE_STRING_H 1
  326.  
  327. /* Define if you have the <sys/ioctl.h> header file.  */
  328. #define HAVE_SYS_IOCTL_H 0
  329.  
  330. /* Define if you have the <sys/ptem.h> header file.  */
  331. #define HAVE_SYS_PTEM_H    0
  332.  
  333. /* Define if you have the <sys/stream.h> header file.  */
  334. #define HAVE_SYS_STREAM_H    0
  335.  
  336. /* Define if you have the <termcap.h> header file.  */
  337. #define HAVE_TERMCAP_H    0
  338.  
  339. /* Define if you have the <termio.h> header file.  */
  340. #define HAVE_TERMIO_H    0
  341.  
  342. /* Define if you have the <termios.h> header file.  */
  343. #define HAVE_TERMIOS_H 0
  344.  
  345. /* Define if you have the <time.h> header file.  */
  346. #define HAVE_TIME_H 1
  347.  
  348. /* Define if you have the <unistd.h> header file.  */
  349. #if MSDOS_COMPILER==DJGPPC
  350. #define HAVE_UNISTD_H 1
  351. #else
  352. #define HAVE_UNISTD_H 0
  353. #endif
  354.  
  355. /* Define if you have the <values.h> header file.  */
  356. #if MSDOS_COMPILER==MSOFTC
  357. #define HAVE_VALUES_H 0
  358. #else
  359. #define HAVE_VALUES_H 1
  360. #endif
  361.  
  362. #if MSDOS_COMPILER == MSOFTC && _MSC_VER >= 700
  363. /*
  364.  * The names of these things changed in Microsoft C version 7.0.
  365.  */
  366. #define videoconfig    _videoconfig
  367. #define rccoord        _rccoord
  368. #define O_RDONLY    _O_RDONLY
  369. #define O_WRONLY    _O_WRONLY
  370. #define O_APPEND    _O_APPEND
  371. #define O_BINARY    _O_BINARY
  372. #define O_TEXT        _O_TEXT
  373. #define find_t        _find_t
  374. #define stat        _stat
  375. #define S_IFMT        _S_IFMT
  376. #define S_IFDIR        _S_IFDIR
  377. #define S_IFREG        _S_IFREG
  378. #define dup        _dup
  379. #define open        _open
  380. #define lseek        _lseek
  381. #define write        _write
  382. #define creat        _creat
  383. #define fstat        _fstat
  384. #define isatty        _isatty
  385. #define close        _close
  386. #define read        _read
  387. #define ungetch        _ungetch
  388. #define kbhit        _kbhit
  389. #define getch        _getch
  390. #endif
  391.