Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses Rename variables refering to termcap capabilit...



details:   https://anonhg.NetBSD.org/src/rev/46f7c73fdfc3
branches:  trunk
changeset: 500872:46f7c73fdfc3
user:      jdc <jdc%NetBSD.org@localhost>
date:      Tue Dec 19 21:34:24 2000 +0000

description:
Rename variables refering to termcap capabilities from NN to __tc_nn.  Case
adjusted to match termcap capability.  A few other variable names renamed too
(ones related to or derived from termcap variables).

diffstat:

 lib/libcurses/acs.c            |   12 +-
 lib/libcurses/addbytes.c       |    6 +-
 lib/libcurses/attributes.c     |   24 +-
 lib/libcurses/bell.c           |   20 +-
 lib/libcurses/color.c          |   57 ++++----
 lib/libcurses/cr_put.c         |  120 +++++++++---------
 lib/libcurses/curs_set.c       |   16 +-
 lib/libcurses/curses.c         |   48 ++++--
 lib/libcurses/curses.h         |   24 +---
 lib/libcurses/curses_private.h |   39 +++++-
 lib/libcurses/initscr.c        |    6 +-
 lib/libcurses/keypad.c         |    6 +-
 lib/libcurses/meta.c           |   12 +-
 lib/libcurses/pause.c          |    6 +-
 lib/libcurses/refresh.c        |  259 +++++++++++++++++++++-------------------
 lib/libcurses/scroll.c         |    6 +-
 lib/libcurses/setterm.c        |  184 +++++++++++++++-------------
 lib/libcurses/standout.c       |    6 +-
 lib/libcurses/tstp.c           |   14 +-
 lib/libcurses/tty.c            |   15 +-
 lib/libcurses/underscore.c     |    8 +-
 21 files changed, 470 insertions(+), 418 deletions(-)

diffs (truncated from 1976 to 300 lines):

diff -r cb46561c6ae9 -r 46f7c73fdfc3 lib/libcurses/acs.c
--- a/lib/libcurses/acs.c       Tue Dec 19 21:31:11 2000 +0000
+++ b/lib/libcurses/acs.c       Tue Dec 19 21:34:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acs.c,v 1.7 2000/04/24 14:09:42 blymn Exp $    */
+/*     $NetBSD: acs.c,v 1.8 2000/12/19 21:34:24 jdc Exp $      */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: acs.c,v 1.7 2000/04/24 14:09:42 blymn Exp $");
+__RCSID("$NetBSD: acs.c,v 1.8 2000/12/19 21:34:24 jdc Exp $");
 #endif                         /* not lint */
 
 #include "curses.h"
@@ -89,10 +89,10 @@
        ACS_VLINE = '|';
        ACS_BULLET = 'o';
 
-       if (AC == NULL)
+       if (__tc_ac == NULL)
                return;
 
-       aofac = AC;
+       aofac = __tc_ac;
 
        while (*aofac != '\0') {
                if ((acs = *aofac) == '\0')
@@ -110,6 +110,6 @@
 #endif
        }
 
-       if (Ea != NULL)
-               tputs(Ea, 0, __cputchar);
+       if (__tc_eA != NULL)
+               tputs(__tc_eA, 0, __cputchar);
 }
diff -r cb46561c6ae9 -r 46f7c73fdfc3 lib/libcurses/addbytes.c
--- a/lib/libcurses/addbytes.c  Tue Dec 19 21:31:11 2000 +0000
+++ b/lib/libcurses/addbytes.c  Tue Dec 19 21:34:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: addbytes.c,v 1.20 2000/04/28 22:44:33 mycroft Exp $    */
+/*     $NetBSD: addbytes.c,v 1.21 2000/12/19 21:34:24 jdc Exp $        */
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)addbytes.c 8.4 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: addbytes.c,v 1.20 2000/04/28 22:44:33 mycroft Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.21 2000/12/19 21:34:24 jdc Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -198,7 +198,7 @@
                        SYNCH_OUT;
                        wclrtoeol(win);
                        SYNCH_IN;
-                       if (!NONL)
+                       if (!__NONL)
                                x = 0;
                        goto newline;
                case '\r':
diff -r cb46561c6ae9 -r 46f7c73fdfc3 lib/libcurses/attributes.c
--- a/lib/libcurses/attributes.c        Tue Dec 19 21:31:11 2000 +0000
+++ b/lib/libcurses/attributes.c        Tue Dec 19 21:34:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: attributes.c,v 1.8 2000/05/11 22:44:45 jdc Exp $       */
+/*     $NetBSD: attributes.c,v 1.9 2000/12/19 21:34:25 jdc Exp $       */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: attributes.c,v 1.8 2000/05/11 22:44:45 jdc Exp $");
+__RCSID("$NetBSD: attributes.c,v 1.9 2000/12/19 21:34:25 jdc Exp $");
 #endif                         /* not lint */
 
 #include "curses.h"
@@ -94,18 +94,18 @@
        __CTRACE ("wattron: win %0.2o, attr %08x\n", win, attr);
 #endif
        /* If can enter modes, set the relevent attribute bits. */
-       if (ME != NULL) {
-               if ((attr_t) attr & __BLINK && MB != NULL)
+       if (__tc_me != NULL) {
+               if ((attr_t) attr & __BLINK && __tc_mb != NULL)
                        win->wattr |= __BLINK;
-               if ((attr_t) attr & __BOLD && MD != NULL)
+               if ((attr_t) attr & __BOLD && __tc_md != NULL)
                        win->wattr |= __BOLD;
-               if ((attr_t) attr & __DIM && MH != NULL)
+               if ((attr_t) attr & __DIM && __tc_mh != NULL)
                        win->wattr |= __DIM;
-               if ((attr_t) attr & __BLANK && MK != NULL)
+               if ((attr_t) attr & __BLANK && __tc_mk != NULL)
                        win->wattr |= __BLANK;
-               if ((attr_t) attr & __PROTECT && MP != NULL)
+               if ((attr_t) attr & __PROTECT && __tc_mp != NULL)
                        win->wattr |= __PROTECT;
-               if ((attr_t) attr & __REVERSE && MR != NULL)
+               if ((attr_t) attr & __REVERSE && __tc_mr != NULL)
                        win->wattr |= __REVERSE;
        }
        if ((attr_t) attr & __STANDOUT)
@@ -119,7 +119,7 @@
                /* If another color pair is set, turn that off first. */
                win->wattr &= ~__COLOR;
                /* If can do color video, set the color pair bits. */
-               if (cO != NULL) {
+               if (__tc_Co != NULL) {
                        win->wattr |= attr & __COLOR;
                        win->wattr &= ~__nca;
                }
@@ -141,7 +141,7 @@
        __CTRACE ("wattroff: win %0.2o, attr %08x\n", win, attr);
 #endif
        /* If can do exit modes, unset the relevent attribute bits. */
-       if (ME != NULL) {
+       if (__tc_me != NULL) {
                if ((attr_t) attr & __BLINK)
                        win->wattr &= ~__BLINK;
                if ((attr_t) attr & __BOLD)
@@ -160,7 +160,7 @@
        if ((attr_t) attr & __UNDERSCORE)
                wunderend(win);
        if ((attr_t) attr & __COLOR) {
-               if (cO != NULL)
+               if (__tc_Co != NULL)
                        win->wattr &= ~__COLOR;
        }
        return (OK);
diff -r cb46561c6ae9 -r 46f7c73fdfc3 lib/libcurses/bell.c
--- a/lib/libcurses/bell.c      Tue Dec 19 21:31:11 2000 +0000
+++ b/lib/libcurses/bell.c      Tue Dec 19 21:34:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bell.c,v 1.4 2000/04/24 14:09:42 blymn Exp $   */
+/*     $NetBSD: bell.c,v 1.5 2000/12/19 21:34:24 jdc Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: bell.c,v 1.4 2000/04/24 14:09:42 blymn Exp $");
+__RCSID("$NetBSD: bell.c,v 1.5 2000/12/19 21:34:24 jdc Exp $");
 #endif                         /* not lint */
 
 #include "curses.h"
@@ -51,16 +51,16 @@
 int
 beep(void)
 {
-       if (BL != NULL) {
+       if (__tc_bl != NULL) {
 #ifdef DEBUG
                __CTRACE("beep: bl\n");
 #endif
-               tputs(BL, 0, __cputchar);
-       } else if (VB != NULL) {
+               tputs(__tc_bl, 0, __cputchar);
+       } else if (__tc_vb != NULL) {
 #ifdef DEBUG
                __CTRACE("beep: vb\n");
 #endif
-               tputs(VB, 0, __cputchar);
+               tputs(__tc_vb, 0, __cputchar);
        }
        return (1);
 }
@@ -72,16 +72,16 @@
 int
 flash(void)
 {
-       if (VB != NULL) {
+       if (__tc_vb != NULL) {
 #ifdef DEBUG
                __CTRACE("flash: vb\n");
 #endif
-               tputs(VB, 0, __cputchar);
-       } else if (BL != NULL) {
+               tputs(__tc_vb, 0, __cputchar);
+       } else if (__tc_bl != NULL) {
 #ifdef DEBUG
                __CTRACE("flash: bl\n");
 #endif
-               tputs(BL, 0, __cputchar);
+               tputs(__tc_bl, 0, __cputchar);
        }
        return (1);
 }
diff -r cb46561c6ae9 -r 46f7c73fdfc3 lib/libcurses/color.c
--- a/lib/libcurses/color.c     Tue Dec 19 21:31:11 2000 +0000
+++ b/lib/libcurses/color.c     Tue Dec 19 21:34:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: color.c,v 1.12 2000/05/06 19:03:39 jdc Exp $   */
+/*     $NetBSD: color.c,v 1.13 2000/12/19 21:34:24 jdc Exp $   */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: color.c,v 1.12 2000/05/06 19:03:39 jdc Exp $");
+__RCSID("$NetBSD: color.c,v 1.13 2000/12/19 21:34:24 jdc Exp $");
 #endif                         /* not lint */
 
 #include "curses.h"
@@ -91,8 +91,9 @@
 bool
 has_colors(void)
 {
-       if (cO > 0 && PA > 0 && ((af != NULL && ab != NULL) || iP != NULL ||
-           iC != NULL || (sB != NULL && sF != NULL)))
+       if (__tc_Co > 0 && __tc_pa > 0 && ((__tc_AF != NULL &&
+           __tc_AB != NULL) || __tc_Ip != NULL || __tc_Ic != NULL ||
+           (__tc_Sb != NULL && __tc_Sf != NULL)))
                return(TRUE);
        else
                return(FALSE);
@@ -105,7 +106,7 @@
 bool
 can_change_colors(void)
 {
-       if (CC)
+       if (__tc_cc)
                return(TRUE);
        else
                return(FALSE);
@@ -125,36 +126,36 @@
                return(ERR);
 
        /* Max colours and colour pairs */
-       if (cO == -1)
+       if (__tc_Co == -1)
                COLORS = 0;
        else {
-               COLORS = cO > MAX_COLORS ? MAX_COLORS : cO;
-               if (PA == -1) {
+               COLORS = __tc_Co > MAX_COLORS ? MAX_COLORS : __tc_Co;
+               if (__tc_pa == -1) {
                        COLOR_PAIRS = 0;
                        COLORS = 0;
                } else {
-                       COLOR_PAIRS = PA > MAX_PAIRS ? MAX_PAIRS : PA;
+                       COLOR_PAIRS = __tc_pa > MAX_PAIRS ? MAX_PAIRS : __tc_pa;
                }
        }
        if (!COLORS)
                return (ERR);
 
        /* Reset terminal colour and colour pairs. */
-       if (OC != NULL)
-               tputs(OC, 0, __cputchar);
-       if (OP != NULL) {
-               tputs(OP, 0, __cputchar);
-               curscr->wattr &= __mask_OP;
+       if (__tc_oc != NULL)
+               tputs(__tc_oc, 0, __cputchar);
+       if (__tc_op != NULL) {
+               tputs(__tc_op, 0, __cputchar);
+               curscr->wattr &= __mask_op;
        }
 
        /* Type of colour manipulation - ANSI/TEK/HP/other */
-       if (af != NULL && ab != NULL)
+       if (__tc_AF != NULL && __tc_AB != NULL)
                __color_type = COLOR_ANSI;
-       else if (iP != NULL)
+       else if (__tc_Ip != NULL)
                __color_type = COLOR_HP;
-       else if (iC != NULL)
+       else if (__tc_Ic != NULL)
                __color_type = COLOR_TEK;
-       else if (sB != NULL && sF != NULL)
+       else if (__tc_Sb != NULL && __tc_Sf != NULL)
                __color_type = COLOR_OTHER;
        else
                return(ERR);            /* Unsupported colour method */
@@ -183,7 +184,7 @@
         * Store these in an attr_t for wattrset()/wattron().
         */
        __nca = __NORMAL;
-       if (nc != -1) {
+       if (__tc_NC != -1) {
                temp_nc = (attr_t) t_getnum(_cursesi_genbuf, "NC");
                if (temp_nc & 0x0001)
                        __nca |= __STANDOUT;
@@ -274,7 +275,7 @@
        pairs[pair].fore = fore;
        pairs[pair].back = back;
 



Home | Main Index | Thread Index | Old Index