aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/progs
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2001-05-17 08:21:06 +0000
committerPeter Wemm <peter@FreeBSD.org>2001-05-17 08:21:06 +0000
commit7a69bbfb278952228c9aa1eca241e65fcdef425e (patch)
treee83b2ef47811e687a6c54035c9af6d4a2b7f14e1 /contrib/ncurses/progs
parent18259542b2f8fa7e3f76f4bb0dd37995dfd424aa (diff)
downloadsrc-7a69bbfb278952228c9aa1eca241e65fcdef425e.tar.gz
src-7a69bbfb278952228c9aa1eca241e65fcdef425e.zip
Import ncurses-5.2-20010512 onto the vendor branch
Obtained from: ftp://dickey.his.com/ncurses/
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=76726
Diffstat (limited to 'contrib/ncurses/progs')
-rw-r--r--contrib/ncurses/progs/Makefile.in37
-rw-r--r--contrib/ncurses/progs/dump_entry.c4
-rw-r--r--contrib/ncurses/progs/infocmp.c13
-rw-r--r--contrib/ncurses/progs/progs.priv.h6
-rw-r--r--contrib/ncurses/progs/tic.c38
-rw-r--r--contrib/ncurses/progs/tput.c6
-rw-r--r--contrib/ncurses/progs/tset.c16
7 files changed, 72 insertions, 48 deletions
diff --git a/contrib/ncurses/progs/Makefile.in b/contrib/ncurses/progs/Makefile.in
index 8898c149f36f..f0d772ad3494 100644
--- a/contrib/ncurses/progs/Makefile.in
+++ b/contrib/ncurses/progs/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.49 2000/09/30 23:08:58 tom Exp $
+# $Id: Makefile.in,v 1.52 2001/03/24 19:53:31 tom Exp $
##############################################################################
-# Copyright (c) 1998-2000 Free Software Foundation, Inc. #
+# Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@@ -59,6 +59,8 @@ libdir = @libdir@
includedir = @includedir@
datadir = @datadir@
+LIBTOOL = @LIBTOOL@
+
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
transform = @program_transform_name@
@@ -76,6 +78,7 @@ CPPFLAGS = -I../progs -I$(srcdir) @CPPFLAGS@ \
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
+CFLAGS_LIBTOOL = $(CCFLAGS)
CFLAGS_NORMAL = $(CCFLAGS)
CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
CFLAGS_PROFILE = $(CCFLAGS) -pg
@@ -84,10 +87,11 @@ CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
LD = @LD@
-LINK = @LINK_PROGS@ $(CC)
+LINK = @LINK_PROGS@ $(LIBTOOL) $(CC)
LDFLAGS = @EXTRA_LDFLAGS@ \
@PROG_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@
+LDFLAGS_LIBTOOL = $(LDFLAGS)
LDFLAGS_NORMAL = $(LDFLAGS)
LDFLAGS_DEBUG = $(LDFLAGS) @CC_G_OPT@
LDFLAGS_PROFILE = $(LDFLAGS) -pg
@@ -143,12 +147,12 @@ transform.h :
echo "#define PROG_INIT \"$(actual_init)\"" >>$@
install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
- $(INSTALL_PROGRAM) tic$x $(DESTDIR)$(bindir)/$(actual_tic)
- $(INSTALL_PROGRAM) toe$x $(DESTDIR)$(bindir)/$(actual_toe)
- $(INSTALL_PROGRAM) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
- $(INSTALL_PROGRAM) clear$x $(DESTDIR)$(bindir)/$(actual_clear)
- $(INSTALL_PROGRAM) tput$x $(DESTDIR)$(bindir)/$(actual_tput)
- $(INSTALL_PROGRAM) tset$x $(DESTDIR)$(bindir)/$(actual_tset)
+ $(LIBTOOL) $(INSTALL_PROGRAM) tic$x $(DESTDIR)$(bindir)/$(actual_tic)
+ $(LIBTOOL) $(INSTALL_PROGRAM) toe$x $(DESTDIR)$(bindir)/$(actual_toe)
+ $(LIBTOOL) $(INSTALL_PROGRAM) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
+ $(LIBTOOL) $(INSTALL_PROGRAM) clear$x $(DESTDIR)$(bindir)/$(actual_clear)
+ $(LIBTOOL) $(INSTALL_PROGRAM) tput$x $(DESTDIR)$(bindir)/$(actual_tput)
+ $(LIBTOOL) $(INSTALL_PROGRAM) tset$x $(DESTDIR)$(bindir)/$(actual_tset)
@echo "linking $(actual_captoinfo) to $(actual_tic)"
-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
@@ -160,12 +164,12 @@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
uninstall.progs:
- -@rm -f $(DESTDIR)$(bindir)/$(actual_tic)
- -@rm -f $(DESTDIR)$(bindir)/$(actual_toe)
- -@rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
- -@rm -f $(DESTDIR)$(bindir)/$(actual_clear)
- -@rm -f $(DESTDIR)$(bindir)/$(actual_tput)
- -@rm -f $(DESTDIR)$(bindir)/$(actual_tset)
+ -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tic)
+ -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_toe)
+ -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
+ -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_clear)
+ -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tput)
+ -@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tset)
-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
@@ -231,12 +235,13 @@ tags:
@MAKE_UPPER_TAGS@ etags *.[ch]
mostlyclean ::
- -rm -f core tags TAGS *~ *.ln *.atac trace
+ -rm -f core tags TAGS *~ *.i *.ln *.atac trace
-rm -f $(TESTPROGS)
clean :: mostlyclean
-rm -f $(AUTO_SRC)
-rm -f $(PROGS)
+ -rm -rf .libs
distclean :: clean
-rm -f Makefile
diff --git a/contrib/ncurses/progs/dump_entry.c b/contrib/ncurses/progs/dump_entry.c
index 60c88d3f9cab..4320c09b6de0 100644
--- a/contrib/ncurses/progs/dump_entry.c
+++ b/contrib/ncurses/progs/dump_entry.c
@@ -38,7 +38,7 @@
#include "termsort.c" /* this C file is generated */
#include <parametrized.h> /* so is this */
-MODULE_ID("$Id: dump_entry.c,v 1.54 2000/10/01 01:34:06 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.55 2001/03/10 19:45:51 tom Exp $")
#define INDENT 8
#define DISCARD(string) string = ABSENT_STRING
@@ -773,7 +773,7 @@ fmt_entry(TERMTYPE * tterm,
* It gives an idea of which entries are deadly to even *scan past*,
* as opposed to *use*.
*/
- return (infodump ? len : termcap_length(outbuf.text));
+ return (infodump ? len : (int) termcap_length(outbuf.text));
}
int
diff --git a/contrib/ncurses/progs/infocmp.c b/contrib/ncurses/progs/infocmp.c
index bf7ff1c54b07..5d1a11113493 100644
--- a/contrib/ncurses/progs/infocmp.c
+++ b/contrib/ncurses/progs/infocmp.c
@@ -41,7 +41,7 @@
#include <term_entry.h>
#include <dump_entry.h>
-MODULE_ID("$Id: infocmp.c,v 1.57 2000/10/01 01:26:25 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.60 2001/02/24 22:03:12 tom Exp $")
#define L_CURL "{"
#define R_CURL "}"
@@ -710,7 +710,6 @@ file_comparison(int argc, char *argv[])
/* someday we may allow comparisons on more files */
int filecount = 0;
ENTRY *heads[MAXCOMPARE];
- ENTRY *tails[MAXCOMPARE];
ENTRY *qp, *rp;
int i, n;
@@ -744,7 +743,6 @@ file_comparison(int argc, char *argv[])
}
heads[filecount] = _nc_head;
- tails[filecount] = _nc_tail;
filecount++;
}
@@ -949,7 +947,7 @@ name_initializer(const char *type)
(void) sprintf(initializer, "%s_data_%s", type, entries->tterm.term_names);
for (s = initializer; *s != 0 && *s != '|'; s++) {
- if (!isalnum(*s))
+ if (!isalnum(CharOf(*s)))
*s = '_';
}
*s = 0;
@@ -1029,10 +1027,13 @@ dump_initializers(TERMTYPE * term)
for (sp = term->Strings[n];
*sp != 0 && (tp - buf) < MAX_STRING - 6;
sp++) {
- if (isascii(*sp) && isprint(*sp) && *sp != '\\' && *sp != '"')
+ if (isascii(CharOf(*sp))
+ && isprint(CharOf(*sp))
+ && *sp != '\\'
+ && *sp != '"')
*tp++ = *sp;
else {
- (void) sprintf(tp, "\\%03o", *sp & 0xff);
+ (void) sprintf(tp, "\\%03o", CharOf(*sp));
tp += 4;
}
}
diff --git a/contrib/ncurses/progs/progs.priv.h b/contrib/ncurses/progs/progs.priv.h
index d704c0989b33..18262759f3c3 100644
--- a/contrib/ncurses/progs/progs.priv.h
+++ b/contrib/ncurses/progs/progs.priv.h
@@ -30,7 +30,7 @@
* Author: Thomas E. Dickey <dickey@clark.net> 1997,1998 *
****************************************************************************/
/*
- * $Id: progs.priv.h,v 1.24 2000/10/01 01:33:34 tom Exp $
+ * $Id: progs.priv.h,v 1.26 2000/11/05 00:22:05 tom Exp $
*
* progs.priv.h
*
@@ -165,10 +165,12 @@ extern int optind;
#if !HAVE_ISASCII
# undef isascii
# if ('z'-'a' == 25) && ('z' < 127) && ('Z'-'A' == 25) && ('Z' < 127) && ('9' < 127)
-# define isascii(c) (((c) & 0xff) <= 127)
+# define isascii(c) (CharOf(c) <= 127)
# else
# define isascii(c) 1 /* not really ascii anyway */
# endif
#endif
+#define CharOf(c) ((unsigned char)(c))
+
#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
diff --git a/contrib/ncurses/progs/tic.c b/contrib/ncurses/progs/tic.c
index 9ab0f10776d0..c74afc36ab89 100644
--- a/contrib/ncurses/progs/tic.c
+++ b/contrib/ncurses/progs/tic.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -44,7 +44,7 @@
#include <term_entry.h>
#include <transform.h>
-MODULE_ID("$Id: tic.c,v 1.82 2000/10/01 02:11:39 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.90 2001/04/15 00:21:31 tom Exp $")
const char *_nc_progname = "tic";
@@ -52,6 +52,7 @@ static FILE *log_fp;
static FILE *tmp_fp;
static bool showsummary = FALSE;
static const char *to_remove;
+static int tparm_errs;
static void (*save_check_termtype) (TERMTYPE *);
static void check_termtype(TERMTYPE * tt);
@@ -292,12 +293,12 @@ put_translate(int c)
static char *
stripped(char *src)
{
- while (isspace(*src))
+ while (isspace(CharOf(*src)))
src++;
if (*src != '\0') {
char *dst = strcpy(malloc(strlen(src) + 1), src);
size_t len = strlen(dst);
- while (--len != 0 && isspace(dst[len]))
+ while (--len != 0 && isspace(CharOf(dst[len])))
dst[len] = '\0';
return dst;
}
@@ -705,7 +706,7 @@ main(int argc, char *argv[])
printf("# length=%d\n", len);
}
}
- if (!namelst) {
+ if (!namelst && _nc_tail) {
int c, oldc = '\0';
bool in_comment = FALSE;
bool trailing_comment = FALSE;
@@ -761,27 +762,29 @@ TERMINAL *cur_term; /* tweak to avoid linking lib_cur_term.c */
* Returns the expected number of parameters for the given capability.
*/
static int
-expected_params(char *name)
+expected_params(const char *name)
{
/* *INDENT-OFF* */
static const struct {
const char *name;
int count;
} table[] = {
+ { "S0", 1 }, /* 'screen' extension */
{ "birep", 2 },
{ "chr", 1 },
{ "colornm", 1 },
{ "cpi", 1 },
+ { "csnm", 1 },
{ "csr", 2 },
{ "cub", 1 },
{ "cud", 1 },
{ "cuf", 1 },
{ "cup", 2 },
- { "cvr", 1 },
{ "cuu", 1 },
+ { "cvr", 1 },
{ "cwin", 5 },
{ "dch", 1 },
- { "dclk", 2 },
+ { "defc", 3 },
{ "dial", 1 },
{ "dispc", 1 },
{ "dl", 1 },
@@ -803,11 +806,13 @@ expected_params(char *name)
{ "pfxl", 3 },
{ "pln", 2 },
{ "qdial", 1 },
+ { "rcsd", 1 },
{ "rep", 2 },
{ "rin", 1 },
{ "sclk", 3 },
{ "scp", 1 },
{ "scs", 1 },
+ { "scsd", 2 },
{ "setab", 1 },
{ "setaf", 1 },
{ "setb", 1 },
@@ -822,7 +827,7 @@ expected_params(char *name)
{ "smglr", 2 },
{ "smgrp", 1 },
{ "smgtb", 2 },
- { "smgtp", 2 },
+ { "smgtp", 1 },
{ "tsl", 1 },
{ "u6", -1 },
{ "vpa", 1 },
@@ -850,7 +855,7 @@ expected_params(char *name)
* markers.
*/
static void
-check_params(TERMTYPE * tp, char *name, char *value)
+check_params(TERMTYPE * tp, const char *name, char *value)
{
int expected = expected_params(name);
int actual = 0;
@@ -907,8 +912,15 @@ similar_sgr(char *a, char *b)
{
while (*b != 0) {
while (*a != *b) {
- if (*a == 0)
+ if (*a == 0) {
+ if (b[0] == '$'
+ && b[1] == '<') {
+ _nc_warning("Did not find delay %s", _nc_visbuf(b));
+ } else {
+ _nc_warning("Unmatched portion %s", _nc_visbuf(b));
+ }
return FALSE;
+ }
a++;
}
a++;
@@ -930,6 +942,7 @@ check_sgr(TERMTYPE * tp, char *zero, int num, char *cap, const char *name)
num == 7,
num == 8,
num == 9);
+ tparm_errs += _nc_tparm_err;
if (test != 0) {
if (PRESENT(cap)) {
if (!similar_sgr(test, cap)) {
@@ -1030,6 +1043,7 @@ check_termtype(TERMTYPE * tp)
ANDMISSING(change_scroll_region, save_cursor);
ANDMISSING(change_scroll_region, restore_cursor);
+ tparm_errs = 0;
if (PRESENT(set_attributes)) {
char *zero = tparm(set_attributes, 0, 0, 0, 0, 0, 0, 0, 0, 0);
@@ -1044,6 +1058,8 @@ check_termtype(TERMTYPE * tp)
CHECK_SGR(8, enter_protected_mode);
CHECK_SGR(9, enter_alt_charset_mode);
free(zero);
+ if (tparm_errs)
+ _nc_warning("stack error in sgr string");
}
/*
diff --git a/contrib/ncurses/progs/tput.c b/contrib/ncurses/progs/tput.c
index a72a2e892fdf..7aab90908a40 100644
--- a/contrib/ncurses/progs/tput.c
+++ b/contrib/ncurses/progs/tput.c
@@ -45,7 +45,7 @@
#endif
#include <transform.h>
-MODULE_ID("$Id: tput.c,v 1.24 2000/10/05 00:05:04 tom Exp $")
+MODULE_ID("$Id: tput.c,v 1.26 2001/03/24 21:59:48 tom Exp $")
#define PUTS(s) fputs(s, stdout)
#define PUTCHAR(c) putchar(c)
@@ -96,7 +96,7 @@ check_aliases(const char *name)
* in tparm() to decide how to parse the varargs list.
*/
static TParams
-tparm_type(char *name)
+tparm_type(const char *name)
{
#define TD(code, longname, ti, tc) {code,longname},{code,ti},{code,tc}
TParams result = Numbers;
@@ -376,7 +376,7 @@ main(int argc, char **argv)
/* crack the argument list into a dope vector */
for (cp = buf; *cp; cp++) {
- if (isspace(*cp))
+ if (isspace(CharOf(*cp)))
*cp = '\0';
else if (cp == buf || cp[-1] == 0)
argvec[argnum++] = cp;
diff --git a/contrib/ncurses/progs/tset.c b/contrib/ncurses/progs/tset.c
index d8dbda4974f5..f6e02dbb2f99 100644
--- a/contrib/ncurses/progs/tset.c
+++ b/contrib/ncurses/progs/tset.c
@@ -103,7 +103,7 @@ char *ttyname(int fd);
#include <dump_entry.h>
#include <transform.h>
-MODULE_ID("$Id: tset.c,v 0.47 2000/10/08 01:01:08 tom Exp $")
+MODULE_ID("$Id: tset.c,v 0.49 2001/02/24 23:29:33 tom Exp $")
extern char **environ;
@@ -120,7 +120,7 @@ static int intrchar = -1; /* new interrupt character */
static int tkillchar = -1; /* new kill character */
static int tlines, tcolumns; /* window size */
-#define LOWERCASE(c) ((isalpha(c) && isupper(c)) ? tolower(c) : (c))
+#define LOWERCASE(c) ((isalpha(CharOf(c)) && isupper(CharOf(c))) ? tolower(CharOf(c)) : (c))
static int
CaselessCmp(const char *a, const char *b)
@@ -159,14 +159,14 @@ failed(const char *msg)
static void
cat(char *file)
{
- register int fd, nr, nw;
+ register int fd, nr;
char buf[BUFSIZ];
if ((fd = open(file, O_RDONLY, 0)) < 0)
failed(file);
while ((nr = read(fd, buf, sizeof(buf))) > 0)
- if ((nw = write(STDERR_FILENO, buf, (size_t) nr)) == -1)
+ if (write(STDERR_FILENO, buf, (size_t) nr) == -1)
failed("write to stderr");
if (nr != 0)
failed(file);
@@ -495,7 +495,7 @@ mapped(const char *type)
static const char *
get_termcap_entry(char *userarg)
{
- int rval, errret;
+ int errret;
char *p;
const char *ttype;
#if HAVE_GETTTYNAM
@@ -534,7 +534,7 @@ get_termcap_entry(char *userarg)
while (fgets(buffer, sizeof(buffer) - 1, fp) != 0) {
for (s = buffer, t = d = 0; *s; s++) {
- if (isspace(*s))
+ if (isspace(CharOf(*s)))
*s = '\0';
else if (t == 0)
t = s;
@@ -588,8 +588,8 @@ get_termcap_entry(char *userarg)
ttype = askuser(0);
}
/* Find the terminfo entry. If it doesn't exist, ask the user. */
- while ((rval = setupterm((NCURSES_CONST char *) ttype, STDOUT_FILENO,
- &errret)) != OK) {
+ while (setupterm((NCURSES_CONST char *) ttype, STDOUT_FILENO, &errret)
+ != OK) {
if (errret == 0) {
(void) fprintf(stderr, "tset: unknown terminal type %s\n",
ttype);