summaryrefslogtreecommitdiff
path: root/usr.bin/tic
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-03-11 21:08:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-03-11 21:08:11 +0000
commit640b9f688de759128da89029f54f793d30d6223c (patch)
tree18bcd910c121a9687562684c32cc1cd3ff639059 /usr.bin/tic
parenteab8b0ecfb1469caaf357d26cbe3e5ec524de182 (diff)
Add -G flag; ncurses-4.2-990306
Diffstat (limited to 'usr.bin/tic')
-rw-r--r--usr.bin/tic/dump_entry.c8
-rw-r--r--usr.bin/tic/dump_entry.h6
-rw-r--r--usr.bin/tic/tic.19
-rw-r--r--usr.bin/tic/tic.c14
4 files changed, 23 insertions, 14 deletions
diff --git a/usr.bin/tic/dump_entry.c b/usr.bin/tic/dump_entry.c
index 84a61b1cfaa..7d3e1090d6a 100644
--- a/usr.bin/tic/dump_entry.c
+++ b/usr.bin/tic/dump_entry.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump_entry.c,v 1.4 1999/03/02 06:23:55 millert Exp $ */
+/* $OpenBSD: dump_entry.c,v 1.5 1999/03/11 21:08:08 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999 Free Software Foundation, Inc. *
@@ -40,7 +40,7 @@
#include <termsort.c> /* this C file is generated */
#include <parametrized.h> /* so is this */
-MODULE_ID("$From: dump_entry.c,v 1.35 1999/03/02 01:23:01 tom Exp $")
+MODULE_ID("$From: dump_entry.c,v 1.36 1999/03/06 23:37:55 tom Exp $")
#define INDENT 8
@@ -466,7 +466,7 @@ int fmt_entry(TERMTYPE *tterm,
int (*pred)(int type, int idx),
bool suppress_untranslatable,
bool infodump,
- bool numbers)
+ int numbers)
{
int i, j;
char buffer[MAX_TERMINFO_LENGTH];
@@ -730,7 +730,7 @@ bool outcount = 0;
return(infodump ? len : termcap_length(outbuf));
}
-int dump_entry(TERMTYPE *tterm, bool limited, bool numbers, int (*pred)(int type, int idx))
+int dump_entry(TERMTYPE *tterm, bool limited, int numbers, int (*pred)(int type, int idx))
/* dump a single entry */
{
int len, critlen;
diff --git a/usr.bin/tic/dump_entry.h b/usr.bin/tic/dump_entry.h
index dffea03745e..b49634d248f 100644
--- a/usr.bin/tic/dump_entry.h
+++ b/usr.bin/tic/dump_entry.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump_entry.h,v 1.3 1999/03/02 06:23:55 millert Exp $ */
+/* $OpenBSD: dump_entry.h,v 1.4 1999/03/11 21:08:09 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999 Free Software Foundation, Inc. *
@@ -54,8 +54,8 @@
extern NCURSES_CONST char *nametrans(const char *);
extern void dump_init(const char *, int, int, int, int, bool);
-extern int fmt_entry(TERMTYPE *, int (*)(int, int), bool, bool, bool);
-extern int dump_entry(TERMTYPE *, bool, bool, int (*)(int, int));
+extern int fmt_entry(TERMTYPE *, int (*)(int, int), bool, bool, int);
+extern int dump_entry(TERMTYPE *, bool, int, int (*)(int, int));
extern int dump_uses(const char *, bool);
extern void compare_entry(void (*)(int, int, const char *), TERMTYPE *);
diff --git a/usr.bin/tic/tic.1 b/usr.bin/tic/tic.1
index 1559a0771d8..06000fdaa39 100644
--- a/usr.bin/tic/tic.1
+++ b/usr.bin/tic/tic.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tic.1,v 1.5 1999/03/03 00:42:16 millert Exp $
+.\" $OpenBSD: tic.1,v 1.6 1999/03/11 21:08:09 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998,1999 Free Software Foundation, Inc. *
@@ -28,7 +28,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: tic.1m,v 1.24 1999/02/23 02:18:15 tom Exp $
+.\" $From: tic.1m,v 1.25 1999/03/07 02:07:06 tom Exp $
.TH tic 1 ""
.ds n 5
.ds d /usr/share/terminfo
@@ -106,6 +106,10 @@ names, but also translates terminfo strings to termcap format. Capabilities
that are not translatable are left in the entry under their terminfo names
but commented out with two preceding dots.
.TP
+\fB-G\fR
+Display constant literals in decimal form
+rather than their character equivalents.
+.TP
\fB-I\fR
Force source translation to terminfo format.
.TP
@@ -246,6 +250,7 @@ error messages, and can be parsed by GNU Emacs's compile facility.
The
\fB-o\fR,
+\fB-G\fR,
\fB-I\fR,
\fB-C\fR,
\fB-N\fR,
diff --git a/usr.bin/tic/tic.c b/usr.bin/tic/tic.c
index 5ae08f3d565..9fb56ae65a8 100644
--- a/usr.bin/tic/tic.c
+++ b/usr.bin/tic/tic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tic.c,v 1.7 1999/03/02 06:23:55 millert Exp $ */
+/* $OpenBSD: tic.c,v 1.8 1999/03/11 21:08:10 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999 Free Software Foundation, Inc. *
@@ -44,7 +44,7 @@
#include <dump_entry.h>
#include <term_entry.h>
-MODULE_ID("$From: tic.c,v 1.48 1999/03/01 00:26:51 tom Exp $")
+MODULE_ID("$From: tic.c,v 1.49 1999/03/07 01:21:14 tom Exp $")
const char *_nc_progname = "tic";
@@ -86,6 +86,7 @@ static void usage(void)
" -T remove size-restrictions on compiled description",
" -c check only, validate input without compiling or translating",
" -f format complex strings for readability",
+ " -G format %{number} to %'char'",
" -g format %'char' to %{number}",
" -e<names> translate/compile only entries named by comma-separated list",
" -o<dir> set output directory for compiled entry writes",
@@ -386,7 +387,7 @@ int sortmode = S_TERMINFO; /* sort_mode */
int fd;
int width = 60;
bool formatted = FALSE; /* reformat complex strings? */
-bool numbers = TRUE; /* format "%'char'" to "%{number}" */
+bool numbers = 0; /* format "%'char'" to/from "%{number}" */
bool infodump = FALSE; /* running as captoinfo? */
bool capdump = FALSE; /* running as infotocap? */
bool forceresolve = FALSE; /* force resolution */
@@ -415,7 +416,7 @@ bool check_only = FALSE;
* design decision to allow the numeric values for -w, -v options to
* be optional.
*/
- while ((this_opt = getopt(argc, argv, "0123456789CILNR:TVce:fgo:rsvwx")) != EOF) {
+ while ((this_opt = getopt(argc, argv, "0123456789CILNR:TVce:fGgo:rsvwx")) != -1) {
if (isdigit(this_opt)) {
switch (last_opt) {
case 'v':
@@ -469,8 +470,11 @@ bool check_only = FALSE;
case 'f':
formatted = TRUE;
break;
+ case 'G':
+ numbers = 1;
+ break;
case 'g':
- numbers = FALSE;
+ numbers = -1;
break;
case 'o':
outdir = optarg;