home *** CD-ROM | disk | FTP | other *** search
- /*
- * Setup the variables for the kef subroutines.
- * This header file includes config.h which has
- * been generated from config.h.SH by the Configure script,
- * which in turn was generated by metaconfig.
- *
- * config.h includes only simple definitions for variables.
- * If you want to have complex ones we have to do it yourself.
- * This comes from the way metaconfig is working. Maybe a future version
- * has this problem fixed.
- *
- * sccsid = @(#) setup.h (v1.3 4/24/90)
- *
- */
-
- # include "config.h"
-
- /*
- * Several ways are possible to determine whether input is available.
- * there is at least one character available.
- *
- * - USE_SELECT : select(2) is available and works. This is usually the case
- * on 4BSD derived systems like 43BSD, SunOS 3.5.
- * returns:
- * 0 : no characters available, timeout
- * -1: some error, like intr, error number in errno.
- * else : (1 << fd) : filedescriptor for which stuff is available
- * - USE_RDCHK : rdchk is available. Call as
- * ret = rdchk(fd)
- * it returns : -1 : error, 0 : no char available, 1 : char available
- * This is usually the case on SYS III derived systems
- * - USE_FIONREAD: there is an ioctl which returns the number of characters
- * available.
- * Call it as:
- * ret = ioctl (fd, FIONREAD, &num)
- * int num;
- * where the number of characters is returned in num.
- * This is usually the case on 4BSD systems. On some systems both
- * rdchk and FIONREAD are available (Sinix 2.1), on some both
- * select and FIONREAD are possible (BSD), use select then.
- */
-
- /*
- * What method should the "wait" routine use to wait for input
- * to become available?
- * One of the flags
- * WAITSELECT
- * SEERDCHK
- * must be set.
- * Define symbol KEF_SEE_C with one of the symbols USE_SELECT or USE_RDCHK.
- * If you specify WAITSELECT the "wait" routine calls "select". The operating
- * system (UNIX) stops the process and wakens it if either a specified
- * timeout expired or some character(s) are available. Thus your process
- * does not spend time.
- * If you specify WAITRDCHK the "wait" routine will execute a loop when
- * it is waiting for characters checking with the "see" routine in each
- * pass through the loop for input. This is only done when the prefix of
- * a string in the database is found, and typically does not spend much
- * processor time. For example, if you push a key that sends "\E[A" the
- * three characters are made available rather quickly to the program.
- * If you are lucky it takes only one read to get them, most often it takes
- * 2 reads : "[" and "A" are made available while the "\E" is being processed
- * by the program.
- */
-
- /*
- * Some parts of the program uses a routine to copy memory from
- * one place to another. The destination does never overlap the target.
- * BSD systems have bcopy, SYS 5 systems have memcpy. If your system
- * has both, bcopy is preferred, if your system has none, I supply my own.
- * Define FASTCOPY(source,target,length)
- */
- #ifdef BCOPY
- # define FASTCOPY(s,t,l) (void)bcopy(s,t,l)
- #endif
- #if defined(MEMCPY) && ! defined(BCOPY)
- # define FASTCOPY(s,t,l) (void)memcpy(t,s,l)
- #endif
-