From 74dba12aeff366a9bb34f80802898d7ff29b842d Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sat, 3 Aug 2019 23:22:59 -0400 Subject: [PATCH] and this --- curses.h | 3 ++- curspriv.h | 1 - pdcurses/initscr.c | 20 ++++++++++---------- pdcurses/refresh.c | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/curses.h b/curses.h index 5a5b6981..1b8633b2 100644 --- a/curses.h +++ b/curses.h @@ -28,7 +28,7 @@ Defined by this header: **man-end****************************************************************/ #define PDCURSES 1 /* PDCurses-only routines */ -#define PDC_BUILD 3807 +#define PDC_BUILD 3808 #define PDC_VER_MAJOR 3 #define PDC_VER_MINOR 8 #define PDC_VERDOT "3.8" @@ -357,6 +357,7 @@ typedef struct #endif short line_color; /* color of line attributes - default -1 */ attr_t termattrs; /* attribute capabilities */ + WINDOW *lastscr; /* the last screen image */ bool color_started; /* TRUE after start_color() */ bool dirty; /* redraw on napms() after init_color() */ } SCREEN; diff --git a/curspriv.h b/curspriv.h index e4a90900..43f501a6 100644 --- a/curspriv.h +++ b/curspriv.h @@ -42,7 +42,6 @@ typedef struct /* structure for ripped off lines */ #define _DWCHAR 0x17 /* Delete Word char (^W) */ #define _DLCHAR 0x15 /* Delete Line char (^U) */ -extern WINDOW *pdc_lastscr; extern FILE *pdc_dbfp; /* tracing file pointer (NULL = off) */ extern unsigned long pdc_key_modifiers; extern MOUSE_STATUS pdc_mouse_status; diff --git a/pdcurses/initscr.c b/pdcurses/initscr.c index 7e4905d3..dad33efa 100644 --- a/pdcurses/initscr.c +++ b/pdcurses/initscr.c @@ -106,7 +106,6 @@ const char *_curses_notice = "PDCurses " PDC_VERDOT " - " __DATE__; SCREEN *SP = (SCREEN*)NULL; /* curses variables */ WINDOW *curscr = (WINDOW *)NULL; /* the current screen image */ WINDOW *stdscr = (WINDOW *)NULL; /* the default screen window */ -WINDOW *pdc_lastscr = (WINDOW *)NULL; /* the last screen image */ int LINES = 0; /* current terminal height */ int COLS = 0; /* current terminal width */ @@ -149,6 +148,7 @@ WINDOW *Xinitscr(int argc, char *argv[]) SP->linesrippedoffontop = 0; SP->delaytenths = 0; SP->line_color = -1; + SP->lastscr = (WINDOW *)NULL; SP->color_started = FALSE; SP->dirty = FALSE; @@ -171,15 +171,15 @@ WINDOW *Xinitscr(int argc, char *argv[]) exit(2); } - pdc_lastscr = newwin(LINES, COLS, 0, 0); - if (!pdc_lastscr) + SP->lastscr = newwin(LINES, COLS, 0, 0); + if (!SP->lastscr) { - fprintf(stderr, "initscr(): Unable to create pdc_lastscr.\n"); + fprintf(stderr, "initscr(): Unable to create SP->lastscr.\n"); exit(2); } - wattrset(pdc_lastscr, (chtype)(-1)); - werase(pdc_lastscr); + wattrset(SP->lastscr, (chtype)(-1)); + werase(SP->lastscr); PDC_slk_initialize(); LINES -= SP->slklines; @@ -294,10 +294,10 @@ void delscreen(SCREEN *sp) delwin(stdscr); delwin(curscr); - delwin(pdc_lastscr); + delwin(SP->lastscr); stdscr = (WINDOW *)NULL; curscr = (WINDOW *)NULL; - pdc_lastscr = (WINDOW *)NULL; + SP->lastscr = (WINDOW *)NULL; SP->alive = FALSE; @@ -319,10 +319,10 @@ int resize_term(int nlines, int ncols) if (wresize(curscr, SP->lines, SP->cols) == ERR || wresize(stdscr, LINES, COLS) == ERR || - wresize(pdc_lastscr, SP->lines, SP->cols) == ERR) + wresize(SP->lastscr, SP->lines, SP->cols) == ERR) return ERR; - werase(pdc_lastscr); + werase(SP->lastscr); curscr->_clear = TRUE; if (SP->slk_winptr) diff --git a/pdcurses/refresh.c b/pdcurses/refresh.c index 89c3f6bf..812cb59e 100644 --- a/pdcurses/refresh.c +++ b/pdcurses/refresh.c @@ -132,7 +132,7 @@ int doupdate(void) PDC_LOG(("doupdate() - called\n")); - if (!curscr) + if (!SP || !curscr) return ERR; if (isendwin()) /* coming back after endwin() called */ @@ -155,7 +155,7 @@ int doupdate(void) int first, last; chtype *src = curscr->_y[y]; - chtype *dest = pdc_lastscr->_y[y]; + chtype *dest = SP->lastscr->_y[y]; if (clearall) { @@ -187,7 +187,7 @@ int doupdate(void) ) len++; - /* update the screen, and pdc_lastscr */ + /* update the screen, and SP->lastscr */ if (len) {