* Remove termcap globals from public interface

* Clean up commented out code
This commit is contained in:
blymn 2001-12-11 11:18:17 +00:00
parent b327c956d1
commit 51344953b1
7 changed files with 45 additions and 178 deletions

View File

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.34 2001/12/02 09:14:20 blymn Exp $
# $NetBSD: Makefile,v 1.35 2001/12/11 11:18:17 blymn Exp $
# @(#)Makefile 8.2 (Berkeley) 1/2/94
CPPFLAGS+=#-DTFILE=\"/dev/ttyp0\"
CPPFLAGS+=-D_CURSES_PRIVATE -I${.CURDIR} -I${.CURDIR}/../libterm
CPPFLAGS+=-I${.CURDIR} -I${.CURDIR}/../libterm
.if defined(DEBUG_CURSES)
CFLAGS+=-g
.if defined(FULL_DEBUG)

View File

@ -1,4 +1,4 @@
/* $NetBSD: color.c,v 1.15 2001/12/02 09:14:20 blymn Exp $ */
/* $NetBSD: color.c,v 1.16 2001/12/11 11:18:17 blymn Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: color.c,v 1.15 2001/12/02 09:14:20 blymn Exp $");
__RCSID("$NetBSD: color.c,v 1.16 2001/12/11 11:18:17 blymn Exp $");
#endif /* not lint */
#include "curses.h"
@ -47,27 +47,9 @@ __RCSID("$NetBSD: color.c,v 1.15 2001/12/02 09:14:20 blymn Exp $");
/* Flags for colours and pairs */
#define __USED 0x01
/* List of colours */
/*struct color {
short num;
short red;
short green;
short blue;
int flags;
} colors[MAX_COLORS];*/
/* List of colour pairs */
/*struct pair {
short fore;
short back;
int flags;
} pairs[MAX_PAIRS];*/
/* Attributes that clash with colours */
attr_t __nca;
/*int __color_type = COLOR_NONE;*/
static void
__change_pair __P((short));
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: curs_set.c,v 1.6 2001/12/02 09:14:20 blymn Exp $ */
/* $NetBSD: curs_set.c,v 1.7 2001/12/11 11:18:17 blymn Exp $ */
/*-
* Copyright (c) 1998-2000 Brett Lymn
@ -31,14 +31,12 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: curs_set.c,v 1.6 2001/12/02 09:14:20 blymn Exp $");
__RCSID("$NetBSD: curs_set.c,v 1.7 2001/12/11 11:18:17 blymn Exp $");
#endif /* not lint */
#include "curses.h"
#include "curses_private.h"
/*static int old_mode = 2;*/ /* cursor is set to high vis on start */
/*
* curs_set --
* Set the visibility of the cursor, 0 means invisible, 1 means normal

View File

@ -1,4 +1,4 @@
/* $NetBSD: curses.h,v 1.63 2001/12/02 22:43:44 christos Exp $ */
/* $NetBSD: curses.h,v 1.64 2001/12/11 11:18:17 blymn Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@ -64,137 +64,17 @@ typedef char bool;
#define FALSE (/*CONSTCOND*/0)
#endif
/*
* The following #defines and #includes are present for backward
* compatibility only. They should not be used in future code.
*
* START BACKWARD COMPATIBILITY ONLY.
*/
#ifndef _CURSES_PRIVATE
#define _puts(s) tputs(s, 0, __cputchar)
#define _putchar(c) __cputchar(c)
#define _puts(s) tputs(s, 0, __cputchar)
#define _putchar(c) __cputchar(c)
/* Old-style terminal modes access. */
#define crmode() cbreak()
#define nocrmode() nocbreak()
#define ospeed baudrate()
#define crmode() cbreak()
#define nocrmode() nocbreak()
#define ospeed baudrate()
#endif /* _CURSES_PRIVATE */
/* Termcap capabilities. */
extern char __tc_am, __tc_bs, __tc_cc, __tc_da, __tc_eo,
__tc_hc, __tc_hl, __tc_in, __tc_mi, __tc_ms,
__tc_nc, __tc_ns, __tc_os, __tc_ul, __tc_ut,
__tc_xb, __tc_xn, __tc_xt, __tc_xs, __tc_xx;
extern char __CA;
extern int __tc_pa, __tc_Co, __tc_NC;
extern char *__tc_ac, *__tc_AB, *__tc_ae, *__tc_AF, *__tc_AL,
*__tc_al, *__tc_as, *__tc_bc, *__tc_bl, *__tc_bt,
*__tc_cd, *__tc_ce, *__tc_cl, *__tc_cm, *__tc_cr,
*__tc_cs, *__tc_dc, *__tc_DL, *__tc_dl, *__tc_dm,
*__tc_DO, *__tc_do, *__tc_eA, *__tc_ed, *__tc_ei,
*__tc_ho, *__tc_Ic, *__tc_ic, *__tc_im, *__tc_Ip,
*__tc_ip, *__tc_k0, *__tc_k1, *__tc_k2, *__tc_k3,
*__tc_k4, *__tc_k5, *__tc_k6, *__tc_k7, *__tc_k8,
*__tc_k9, *__tc_kd, *__tc_ke, *__tc_kh, *__tc_kl,
*__tc_kr, *__tc_ks, *__tc_ku, *__tc_LE, *__tc_ll,
*__tc_ma, *__tc_mb, *__tc_md, *__tc_me, *__tc_mh,
*__tc_mk, *__tc_mm, *__tc_mo, *__tc_mp, *__tc_mr,
*__tc_nd, *__tc_nl, *__tc_oc, *__tc_op,
*__tc_rc, *__tc_RI, *__tc_Sb, *__tc_sc, *__tc_se,
*__tc_SF, *__tc_Sf, *__tc_sf, *__tc_so, *__tc_sp,
*__tc_SR, *__tc_sr, *__tc_ta, *__tc_te, *__tc_ti,
*__tc_uc, *__tc_ue, *__tc_UP, *__tc_up, *__tc_us,
*__tc_vb, *__tc_ve, *__tc_vi, *__tc_vs;
#ifdef _CURSES_TERMCAP_COMPAT
#define AM __tc_am
#define BS __tc_bs
#define CA __tc_cc
#define DA __tc_da
#define EO __tc_eo
#define HC __tc_hc
#define IN __tc_in
#define MI __tc_mi
#define MS __tc_ms
#define NC __tc_nc
#define NS __tc_ns
#define OS __tc_os
#define UL __tc_ul
#define XB __tc_xb
#define XN __tc_xn
#define XT __tc_xt
#define XS __tc_xs
#define XX __tc_xx
#define AL __tc_AL
#define BC __tc_bc
#define BT __tc_bt
#define CD __tc_cd
#define CE __tc_ce
#define CL __tc_cl
#define CM __tc_cm
#define CR __tc_cr
#define CS __tc_cs
#define DC __tc_dc
#define DL __tc_DL
#define DM __tc_dm
#define DO __tc_do
#define ED __tc_ed
#define EI __tc_ei
#define K0 __tc_k0
#define K1 __tc_k1
#define K2 __tc_k2
#define K3 __tc_k3
#define K4 __tc_k4
#define K5 __tc_k5
#define K6 __tc_k6
#define K7 __tc_k7
#define K8 __tc_k8
#define K9 __tc_k9
#define HO __tc_ho
#define IC __tc_ic
#define IM __tc_im
#define IP __tc_ip
#define KD __tc_kd
#define KE __tc_ke
#define KH __tc_kh
#define KL __tc_kl
#define KR __tc_kr
#define KS __tc_ks
#define KU __tc_ku
#define LL __tc_ll
#define MA __tc_ma
#define ND __tc_nd
#define NL __tc_nl
#define RC __tc_rc
#define SC __tc_sc
#define SE __tc_se
#define SF __tc_SF
#define SO __tc_so
#define SR __tc_SR
#define TA __tc_ta
#define TE __tc_te
#define TI __tc_ti
#define UC __tc_uc
#define UE __tc_ue
#define UP __tc_up
#define US __tc_us
#define VB __tc_vb
#define VS __tc_vs
#define VE __tc_ve
#define al __tc_al
#define dl __tc_dl
#define sf __tc_sf
#define sr __tc_sr
#define AL_PARM __tc_AL
#define DL_PARM __tc_DL
#define UP_PARM __tc_UP
#define DOWN_PARM __tc_DO
#define LEFT_PARM __tc_LE
#define RIGHT_PARM __tc_RI
#endif /* _CURSES_TERMCAP_COMPAT */
/* END BACKWARD COMPATIBILITY ONLY. */
/* symbols for values returned by getch in keypad mode */
#define KEY_MIN 0x101 /* minimum extended key value */
@ -432,8 +312,6 @@ extern int LINES; /* Lines on the screen. */
extern int COLORS; /* Max colours on the screen. */
extern int COLOR_PAIRS; /* Max colour pairs on the screen. */
extern char *ttytype; /* Full name of current terminal. */
#define ERR (0) /* Error return. */
#define OK (1) /* Success return. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: curses_private.h,v 1.17 2001/12/02 09:14:21 blymn Exp $ */
/* $NetBSD: curses_private.h,v 1.18 2001/12/11 11:18:17 blymn Exp $ */
/*-
* Copyright (c) 1998-2000 Brett Lymn
@ -32,6 +32,33 @@
#include <termios.h>
/* Private structure definitions for curses. */
/* Termcap capabilities. */
extern char __tc_am, __tc_bs, __tc_cc, __tc_da, __tc_eo,
__tc_hc, __tc_hl, __tc_in, __tc_mi, __tc_ms,
__tc_nc, __tc_ns, __tc_os, __tc_ul, __tc_ut,
__tc_xb, __tc_xn, __tc_xt, __tc_xs, __tc_xx;
extern char __CA;
extern int __tc_pa, __tc_Co, __tc_NC;
extern char *__tc_ac, *__tc_AB, *__tc_ae, *__tc_AF, *__tc_AL,
*__tc_al, *__tc_as, *__tc_bc, *__tc_bl, *__tc_bt,
*__tc_cd, *__tc_ce, *__tc_cl, *__tc_cm, *__tc_cr,
*__tc_cs, *__tc_dc, *__tc_DL, *__tc_dl, *__tc_dm,
*__tc_DO, *__tc_do, *__tc_eA, *__tc_ed, *__tc_ei,
*__tc_ho, *__tc_Ic, *__tc_ic, *__tc_im, *__tc_Ip,
*__tc_ip, *__tc_k0, *__tc_k1, *__tc_k2, *__tc_k3,
*__tc_k4, *__tc_k5, *__tc_k6, *__tc_k7, *__tc_k8,
*__tc_k9, *__tc_kd, *__tc_ke, *__tc_kh, *__tc_kl,
*__tc_kr, *__tc_ks, *__tc_ku, *__tc_LE, *__tc_ll,
*__tc_ma, *__tc_mb, *__tc_md, *__tc_me, *__tc_mh,
*__tc_mk, *__tc_mm, *__tc_mo, *__tc_mp, *__tc_mr,
*__tc_nd, *__tc_nl, *__tc_oc, *__tc_op,
*__tc_rc, *__tc_RI, *__tc_Sb, *__tc_sc, *__tc_se,
*__tc_SF, *__tc_Sf, *__tc_sf, *__tc_so, *__tc_sp,
*__tc_SR, *__tc_sr, *__tc_ta, *__tc_te, *__tc_ti,
*__tc_uc, *__tc_ue, *__tc_UP, *__tc_up, *__tc_us,
*__tc_vb, *__tc_ve, *__tc_vi, *__tc_vs;
/*
* A window an array of __LINE structures pointed to by the 'lines' pointer.
* A line is an array of __LDATA structures pointed to by the 'line' pointer.

View File

@ -1,4 +1,4 @@
/* $NetBSD: newwin.c,v 1.26 2001/12/02 09:14:22 blymn Exp $ */
/* $NetBSD: newwin.c,v 1.27 2001/12/11 11:18:17 blymn Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)newwin.c 8.3 (Berkeley) 7/27/94";
#else
__RCSID("$NetBSD: newwin.c,v 1.26 2001/12/02 09:14:22 blymn Exp $");
__RCSID("$NetBSD: newwin.c,v 1.27 2001/12/11 11:18:17 blymn Exp $");
#endif
#endif /* not lint */
@ -206,7 +206,7 @@ __makenew(SCREEN *screen, int nlines, int ncols, int by, int bx, int sub)
#ifdef DEBUG
__CTRACE("makenew: (%d, %d, %d, %d)\n", nlines, ncols, by, bx);
#endif
if ((win = malloc(sizeof(*win))) == NULL)
if ((win = malloc(sizeof(WINDOW))) == NULL)
return (NULL);
#ifdef DEBUG
__CTRACE("makenew: nlines = %d\n", nlines);

View File

@ -1,4 +1,4 @@
/* $NetBSD: setterm.c,v 1.29 2001/12/02 09:14:23 blymn Exp $ */
/* $NetBSD: setterm.c,v 1.30 2001/12/11 11:18:18 blymn Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)setterm.c 8.8 (Berkeley) 10/25/94";
#else
__RCSID("$NetBSD: setterm.c,v 1.29 2001/12/02 09:14:23 blymn Exp $");
__RCSID("$NetBSD: setterm.c,v 1.30 2001/12/11 11:18:18 blymn Exp $");
#endif
#endif /* not lint */
@ -357,25 +357,7 @@ zap(SCREEN *screen)
screen->int_count++;
} while (*namp);
/* calculate the size of tspace.... */
nampstr = "ABacaeAFALalasbcblbtcdceclcmcrcsdcDLdldmDOdoeAedeihoIcicimIpipk0k1k2k3k4k5k6k7k8k9kdkekhklkrkskuLEllmambmdmemhmkmmmompmrndnlocoppcrcRISbscseSFSfsfsospSRsrtatetiucueUPupusvbvevivs";
/* namp = nampstr; */
/* tspace_size = 0; */
/* do { */
/* *tmp = *namp; */
/* *(tmp + 1) = *(namp + 1); */
/* t_getstr(tinfo, tmp, NULL, &i); */
/* tspace_size += i + 1; */
/* namp += 2; */
/* } while (*namp); */
/* if ((screen->tspace = (char *) malloc(tspace_size)) == NULL) */
/* return ERR; */
/* #ifdef DEBUG */
/* __CTRACE("Allocated %d (0x%x) size buffer for tspace\n", tspace_size, */
/* tspace_size); */
/* #endif */
/* screen->aoftspace = screen->tspace; */
namp = nampstr;
sp = &screen->tc_AB;