WARNSify, use <termcap.h> instead of <curses.h>

This commit is contained in:
lukem 1997-10-14 01:46:32 +00:00
parent 2122942c25
commit a04cd750cc
3 changed files with 21 additions and 19 deletions

View File

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.5 1997/03/24 21:59:55 christos Exp $
# $NetBSD: Makefile,v 1.6 1997/10/14 01:46:32 lukem Exp $
# @(#)Makefile 8.1 (Berkeley) 6/6/93
WARNS?= 1
PROG= tput
DPADD= ${LIBTERMCAP}
LDADD= -ltermcap

View File

@ -1,4 +1,4 @@
.\" $NetBSD: tput.1,v 1.4 1994/12/07 08:49:10 jtc Exp $
.\" $NetBSD: tput.1,v 1.5 1997/10/14 01:46:35 lukem Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@ -40,13 +40,13 @@
.Nm tput
.Nd terminal capability interface
.Sh SYNOPSIS
.Nm tput
.Nm
.Op Fl T Ar term
.Ar attribute
.Op Ar attribute-args
.Ar ...
.Sh DESCRIPTION
.Nm Tput
.Nm
makes terminal-dependent information available to users or shell
applications.
The options are as follows:
@ -56,18 +56,18 @@ The terminal name as specified in the
.Xr termcap
database, for example, ``vt100'' or ``xterm''.
If not specified,
.Nm tput
.Nm
retrieves the
.Dq Ev TERM
variable from the environment.
.El
.Pp
.Nm Tput
.Nm
outputs a string if the
.Ar attribute
is of type string; a number if it is of type integer.
Otherwise,
.Nm tput
.Nm
exits 0 if the terminal has the capability and 1 if it does not,
without further action.
.Pp
@ -97,16 +97,16 @@ Reset the terminal (the
``rs'' sequence).
.Sh DIAGNOSTICS
The exit value of
.Nm tput
.Nm
is based on the last attribute specified.
If the attribute is of type string or of type integer,
.Nm tput
.Nm
exits 0 if the attribute is defined for this terminal type and 1
if it is not.
If the attribute is of type boolean,
.Nm tput
.Nm
exits 0 if the terminal has this attribute, and 1 if it does not.
.Nm Tput
.Nm
exits 2 if any error occurred.
.Sh EXAMPLES
.Bl -tag -width "tput cm 6 11 DC 6" -compact
@ -119,7 +119,7 @@ goto line 6 column 11 and delete 6 characters
.Xr termcap 3 ,
.Xr termcap 5
.Sh BUGS
.Nm Tput
.Nm
can't really distinguish between different types of attributes.
.Sh HISTORY
The

View File

@ -1,4 +1,4 @@
/* $NetBSD: tput.c,v 1.8 1995/08/31 22:11:37 jtc Exp $ */
/* $NetBSD: tput.c,v 1.9 1997/10/14 01:46:38 lukem Exp $ */
/*-
* Copyright (c) 1980, 1988, 1993
@ -33,30 +33,31 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1980, 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1980, 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)tput.c 8.3 (Berkeley) 4/28/95";
#endif
static char rcsid[] = "$NetBSD: tput.c,v 1.8 1995/08/31 22:11:37 jtc Exp $";
__RCSID("$NetBSD: tput.c,v 1.9 1997/10/14 01:46:38 lukem Exp $");
#endif /* not lint */
#include <termios.h>
#include <err.h>
#include <curses.h>
#include <stdio.h>
#include <stdlib.h>
#include <termcap.h>
#include <unistd.h>
int main __P((int, char **));
static void outc __P((int));
static void prlongname __P((char *));
static void setospeed __P((void));
static void outc __P((int));
static void usage __P((void));
static char **process __P((char *, char *, char **));