Splitted from libmytinfo
This commit is contained in:
parent
9e6f124826
commit
f849e2cf15
12
usr.bin/tconv/Makefile
Normal file
12
usr.bin/tconv/Makefile
Normal file
@ -0,0 +1,12 @@
|
||||
# Makefile for tconv
|
||||
# $Id$
|
||||
|
||||
PROG= tconv
|
||||
SRCS= tconv.c quit.c
|
||||
MLINKS= tconv.1 tic.1 tconv.1 captoinfo.1
|
||||
LINKS= ${BINDIR}/tconv ${BINDIR}/tic ${BINDIR}/tconv ${BINDIR}/captoinfo
|
||||
CFLAGS+= -I/usr/src/lib/libmytinfo -Wall
|
||||
DPADD= $(LIBMYTINFO)
|
||||
LDADD= -lmytinfo
|
||||
|
||||
.include <bsd.prog.mk>
|
72
usr.bin/tconv/quit.c
Normal file
72
usr.bin/tconv/quit.c
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* quit.c
|
||||
*
|
||||
* By Ross Ridge
|
||||
* Public Domain
|
||||
* 92/02/01 07:30:14
|
||||
*
|
||||
* quit with a diagnostic message printed on stderr
|
||||
*
|
||||
*/
|
||||
|
||||
#define NOTLIB
|
||||
#include "defs.h"
|
||||
|
||||
#ifdef USE_SCCS_IDS
|
||||
static const char SCCSid[] = "@(#) mytinfo quit.c 3.2 92/02/01 public domain, By Ross Ridge";
|
||||
#endif
|
||||
|
||||
char *prg_name;
|
||||
|
||||
#if defined(USE_PROTOTYPES) && !defined(lint)
|
||||
void (*cleanup)(int);
|
||||
#else
|
||||
void (*cleanup)();
|
||||
#endif
|
||||
|
||||
/* PRINTFLIKE2 */
|
||||
noreturn
|
||||
#ifdef USE_STDARG
|
||||
#ifdef USE_PROTOTYPES
|
||||
void
|
||||
quit(int e, char *fmt, ...)
|
||||
#else
|
||||
void quit(e, fmt)
|
||||
int e;
|
||||
char *fmt;
|
||||
#endif
|
||||
#else
|
||||
void quit(va_alist)
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
#ifndef USE_STDARG
|
||||
int e;
|
||||
char *fmt;
|
||||
#endif
|
||||
va_list ap;
|
||||
|
||||
#ifdef USE_STDARG
|
||||
va_start(ap, fmt);
|
||||
#else
|
||||
va_start(ap);
|
||||
e = va_arg(ap, int);
|
||||
fmt = va_arg(ap, char *);
|
||||
#endif
|
||||
|
||||
(*cleanup)(e);
|
||||
|
||||
if (e != 0)
|
||||
fprintf(stderr, "%s: ", prg_name);
|
||||
#ifdef USE_DOPRNT
|
||||
_doprnt(fmt, ap, stderr);
|
||||
#else
|
||||
vfprintf(stderr, fmt, ap);
|
||||
#endif
|
||||
putc('\n', stderr);
|
||||
if (e > 0 && e < sys_nerr) {
|
||||
fprintf(stderr, "%d - %s\n", e, sys_errlist[e]);
|
||||
}
|
||||
fflush(stderr);
|
||||
exit(e);
|
||||
}
|
180
usr.bin/tconv/tconv.1
Normal file
180
usr.bin/tconv/tconv.1
Normal file
@ -0,0 +1,180 @@
|
||||
.\" @(#) mytinfo tconv.1 3.2 92/02/01 public domain, By Ross Ridge
|
||||
.TH TCONV 1 "92/02/01" "mytinfo"
|
||||
.SH NAME
|
||||
tconv \- convert between termcap, terminfo source and terminfo binary
|
||||
.SH SYNOPSIS
|
||||
.B tconv
|
||||
[\fB\-b\fR]
|
||||
[\fB\-c\fR\ [\fB\-OUGd\fR]]
|
||||
[\fB\-i\fR]
|
||||
[\fB\-B\fR\ [\fB\-D\fR\ dir]]
|
||||
[\fB\-I\fR]
|
||||
[\fB\-k\fR]
|
||||
[\fB\-V\fR]
|
||||
[\fB\-t\fR\ term]
|
||||
[file]
|
||||
.br
|
||||
.B tic
|
||||
[file]
|
||||
.br
|
||||
.B captoinfo
|
||||
[\fB\-t\fR\ term]
|
||||
[\fB\-OUGdk\fR]]
|
||||
[file]
|
||||
.SH DESCRIPTION
|
||||
.I tconv
|
||||
converts between the three terminal descriptions,
|
||||
termcap, terminfo source, and terminfo binary,
|
||||
that the
|
||||
.I tinfo
|
||||
library uses.
|
||||
It performs the same functions of
|
||||
.IR captoinfo (1M)
|
||||
and
|
||||
.IR tic (1M)
|
||||
of System V.
|
||||
It also can be used to generate a terminfo source listing from a terminfo
|
||||
binary, one of the functions of System V's
|
||||
.IR infocmp (1M).
|
||||
.SS Translation Options
|
||||
.PD 0
|
||||
.TP
|
||||
.B \-c
|
||||
convert from termcap
|
||||
.TP
|
||||
.B \-i
|
||||
convert from terminfo source
|
||||
.TP
|
||||
.B \-b
|
||||
convert from terminfo binary
|
||||
.TP
|
||||
.B \-B
|
||||
convert to terminfo binary
|
||||
.TP
|
||||
.B \-I
|
||||
convert to terminfo source
|
||||
.PD
|
||||
.PP
|
||||
If a file is specified, one of
|
||||
.B \-c
|
||||
or
|
||||
.B \-i
|
||||
must specified and the whole file while be translated.
|
||||
If no file is specified then the input options will only restrict looking
|
||||
for the terminal to be translated in places likely have descriptions
|
||||
of the desired type
|
||||
(ie. with the
|
||||
.B -c
|
||||
option in the
|
||||
.B TERMCAP
|
||||
environment variable, and in
|
||||
.IR /etc/termcap ,
|
||||
with the
|
||||
.B -i
|
||||
option in the
|
||||
.B TERMINFO
|
||||
environment variable, and in
|
||||
.IR /usr/lib/terminfo ),
|
||||
otherwise
|
||||
.I tconv
|
||||
will look in all available databases.
|
||||
If neither
|
||||
.B \-I
|
||||
or
|
||||
.B \-B
|
||||
are given the
|
||||
.B \-I
|
||||
option will be assumed.
|
||||
If the
|
||||
.B \-B
|
||||
option is used, the compiled output will be put in the the
|
||||
terminfo database, otherwise standard output is used.
|
||||
.PP
|
||||
You cannot translate from terminfo binary to terminfo binary.
|
||||
Translating from terminfo source to terminfo source is possible,
|
||||
but not of much use in most cases, as
|
||||
.B use=
|
||||
fields will be followed and incorporated into the output terminal
|
||||
description.
|
||||
.PP
|
||||
.I tconv
|
||||
should be able translate all standard termcap parameterized strings
|
||||
terminfo format, but complex strings using GNU's %a code may be
|
||||
too hard to translate.
|
||||
If
|
||||
.I tconv
|
||||
thinks a termcap string is already in terminfo format (if a %p
|
||||
code appears in the string), it won't try to translate it.
|
||||
String capabilities that don't take parameters won't be translated.
|
||||
.PP
|
||||
.B
|
||||
.SS Termcap options
|
||||
The following options are available when translating termcap entries
|
||||
(\fB\-c\fR options is used).
|
||||
.PP
|
||||
.PD 0
|
||||
.TP
|
||||
.B \-d
|
||||
don't supply any defaults for missing capabilities
|
||||
.TP
|
||||
.B \-O
|
||||
include obsolete termcap capabilities
|
||||
.TP
|
||||
.B \-G
|
||||
include GNU capabilities
|
||||
.TP
|
||||
.B \-U
|
||||
include UW capabilities
|
||||
.PD
|
||||
.SS Other Options
|
||||
.PD 0
|
||||
.TP
|
||||
.B \-k
|
||||
keep comments when translating a file
|
||||
.TP
|
||||
.B \-V
|
||||
print version information and exit
|
||||
.TP
|
||||
.BI \-D " " dir
|
||||
directory to put terminfo binaries in
|
||||
.TP
|
||||
.BI \-t " " term
|
||||
terminal name to translate
|
||||
.PD
|
||||
.PP
|
||||
If no terminal specified with the
|
||||
.B \-t
|
||||
option, then the terminal name to to translate will be taken from the
|
||||
environment variable
|
||||
.BR TERM .
|
||||
.SH FILES
|
||||
.PD 0
|
||||
.TP 2i
|
||||
.B /usr/lib/terminfo
|
||||
The default location to get and put terminfo binaries.
|
||||
.TP
|
||||
.B /usr/lib/terminfo/terminfo.src
|
||||
The default filename of the terminfo source file.
|
||||
.TP
|
||||
.B /etc/termcap
|
||||
The default filename of the termcap database.
|
||||
.PD
|
||||
.SH "SEE ALSO"
|
||||
captoinfo(1M),
|
||||
tic(1M),
|
||||
infocmp(1M),
|
||||
termcap(3),
|
||||
curses(3X),
|
||||
term(4),
|
||||
termcap(4),
|
||||
terminfo(4).
|
||||
.SH DIAGNOSTICS
|
||||
The line number of a warning message when translating a file
|
||||
may refer to the last line of an entry instead of the line in the entry
|
||||
that generated the warning.
|
||||
.SH BUGS
|
||||
More warning messages could be generated.
|
||||
.I tconv
|
||||
can't translate to termcap. Binaries generated will have cancelled
|
||||
capabilities marked as cancelled, which is incompatible with
|
||||
System V Release 2.0 terminfo.
|
1384
usr.bin/tconv/tconv.c
Normal file
1384
usr.bin/tconv/tconv.c
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user