mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-26 18:01:03 +02:00
13955: boolnames et al., not boolcodes
This commit is contained in:
parent
e05ca62a9c
commit
43cd922cd8
4 changed files with 39 additions and 12 deletions
|
@ -1,5 +1,8 @@
|
|||
2001-04-12 Clint Adams <schizo@debian.org>
|
||||
|
||||
* 13955: acconfig.h, configure.in, Src/Modules/terminfo.c:
|
||||
s/codes/names/.
|
||||
|
||||
* 13953: acconfig.h, configure.in, Src/Modules/terminfo.c:
|
||||
have configure check for the existence of boolcodes,
|
||||
numcodes, and strcodes symbols, and presume that they
|
||||
|
|
|
@ -208,16 +208,16 @@ scanterminfo(HashTable ht, ScanFunc func, int flags)
|
|||
int num;
|
||||
char **capname, *tistr;
|
||||
|
||||
#ifndef HAVE_BOOLCODES
|
||||
static char *boolcodes[] = {
|
||||
#ifndef HAVE_BOOLNAMES
|
||||
static char *boolnames[] = {
|
||||
"bw", "am", "bce", "ccc", "xhp", "xhpa", "cpix", "crxm", "xt", "xenl",
|
||||
"eo", "gn", "hc", "chts", "km", "daisy", "hs", "hls", "in", "lpix",
|
||||
"da", "db", "mir", "msgr", "nxon", "xsb", "npc", "ndscr", "nrrmc",
|
||||
"os", "mc5i", "xvpa", "sam", "eslok", "hz", "ul", "xon", NULL};
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_NUMCODES
|
||||
static char *numcodes[] = {
|
||||
#ifndef HAVE_NUMNAMES
|
||||
static char *numnames[] = {
|
||||
"cols", "it", "lh", "lw", "lines", "lm", "xmc", "ma", "colors",
|
||||
"pairs", "wnum", "ncv", "nlab", "pb", "vt", "wsl", "bitwin",
|
||||
"bitype", "bufsz", "btns", "spinh", "spinv", "maddr", "mjump",
|
||||
|
@ -225,8 +225,8 @@ scanterminfo(HashTable ht, ScanFunc func, int flags)
|
|||
NULL};
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCODES
|
||||
static char *strcodes[] = {
|
||||
#ifndef HAVE_STRNAMES
|
||||
static char *strnames[] = {
|
||||
"acsc", "cbt", "bel", "cr", "cpi", "lpi", "chr", "cvr", "csr", "rmp",
|
||||
"tbc", "mgc", "clear", "el1", "el", "ed", "hpa", "cmdch", "cwin",
|
||||
"cup", "cud1", "home", "civis", "cub1", "mrcup", "cnorm", "cuf1",
|
||||
|
@ -288,7 +288,7 @@ scanterminfo(HashTable ht, ScanFunc func, int flags)
|
|||
pm->old = NULL;
|
||||
|
||||
pm->flags = PM_READONLY | PM_SCALAR;
|
||||
for (capname = (char **)boolcodes; *capname; capname++) {
|
||||
for (capname = (char **)boolnames; *capname; capname++) {
|
||||
if ((num = tigetflag(*capname)) != -1) {
|
||||
pm->u.str = num ? dupstring("yes") : dupstring("no");
|
||||
pm->nam = dupstring(*capname);
|
||||
|
@ -297,7 +297,7 @@ scanterminfo(HashTable ht, ScanFunc func, int flags)
|
|||
}
|
||||
|
||||
pm->flags = PM_READONLY | PM_INTEGER;
|
||||
for (capname = (char **)numcodes; *capname; capname++) {
|
||||
for (capname = (char **)numnames; *capname; capname++) {
|
||||
if (((num = tigetnum(*capname)) != -1) && (num != -2)) {
|
||||
pm->u.val = num;
|
||||
pm->nam = dupstring(*capname);
|
||||
|
@ -306,7 +306,7 @@ scanterminfo(HashTable ht, ScanFunc func, int flags)
|
|||
}
|
||||
|
||||
pm->flags = PM_READONLY | PM_SCALAR;
|
||||
for (capname = (char **)strcodes; *capname; capname++) {
|
||||
for (capname = (char **)strnames; *capname; capname++) {
|
||||
if ((tistr = (char *)tigetstr(*capname)) != NULL &&
|
||||
tistr != (char *)-1) {
|
||||
pm->u.str = dupstring(tistr);
|
||||
|
|
15
acconfig.h
15
acconfig.h
|
@ -300,11 +300,20 @@
|
|||
/* Define to 1 if h_errno is not defined by the system */
|
||||
#undef USE_LOCAL_H_ERRNO
|
||||
|
||||
/* Define if you have the terminfo boolcodes symbol. */
|
||||
/* Define if you have the termcap boolcodes symbol. */
|
||||
#undef HAVE_BOOLCODES
|
||||
|
||||
/* Define if you have the terminfo numcodes symbol. */
|
||||
/* Define if you have the termcap numcodes symbol. */
|
||||
#undef HAVE_NUMCODES
|
||||
|
||||
/* Define if you have the terminfo strcodes symbol. */
|
||||
/* Define if you have the termcap strcodes symbol. */
|
||||
#undef HAVE_STRCODES
|
||||
|
||||
/* Define if you have the terminfo boolnames symbol. */
|
||||
#undef HAVE_BOOLNAMES
|
||||
|
||||
/* Define if you have the terminfo numnames symbol. */
|
||||
#undef HAVE_NUMNAMES
|
||||
|
||||
/* Define if you have the terminfo strnames symbol. */
|
||||
#undef HAVE_STRNAMES
|
||||
|
|
15
configure.in
15
configure.in
|
@ -530,6 +530,21 @@ AC_TRY_COMPILE([#include <curses.h>
|
|||
#include <term.h>], [char **test = strcodes;],
|
||||
AC_DEFINE(HAVE_STRCODES) strcodes=yes, strcodes=no)
|
||||
AC_MSG_RESULT($strcodes)
|
||||
AC_MSG_CHECKING(if boolnames is available)
|
||||
AC_TRY_COMPILE([#include <curses.h>
|
||||
#include <term.h>], [char **test = boolnames;],
|
||||
AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes, boolnames=no)
|
||||
AC_MSG_RESULT($boolnames)
|
||||
AC_MSG_CHECKING(if numnames is available)
|
||||
AC_TRY_COMPILE([#include <curses.h>
|
||||
#include <term.h>], [char **test = numnames;],
|
||||
AC_DEFINE(HAVE_NUMNAMES) numnames=yes, numnames=no)
|
||||
AC_MSG_RESULT($numnames)
|
||||
AC_MSG_CHECKING(if strnames is available)
|
||||
AC_TRY_COMPILE([#include <curses.h>
|
||||
#include <term.h>], [char **test = strnames;],
|
||||
AC_DEFINE(HAVE_STRNAMES) strnames=yes, strnames=no)
|
||||
AC_MSG_RESULT($strnames)
|
||||
|
||||
dnl Some systems (Solaris 2.x, Linux Redhat 5.x) require
|
||||
dnl libnsl (Network Services Library) to find yp_all
|
||||
|
|
Loading…
Reference in a new issue