v04i077: PC Curses miscellaneous stuff, fixes
Steve Creps
creps at silver.bacs.indiana.edu
Mon Sep 19 11:38:56 AEST 1988
Posting-number: Volume 4, Issue 77
Submitted-by: "Steve Creps" <creps at silver.bacs.indiana.edu>
Archive-name: pc-curses/Patch1
In the PC Curses package that was posted here some time ago, there are a
few bugs. The worst of the bugs seems to be somewhere in the assembly code,
and has caused me many a headache by locking up my machine. The original
cursesio.asm file contains assembly routines, all of which are merely calls
to DOS functions. I decided to rewrite this set of routines in C, using the
int86() routine. Since the old routines were just calls into to OS, I don't
think the C version will slow things down much, if at all. At least it didn't
seem to on one of the programs I tested this on.
Once I had the C code, cursesio.c, written, I compiled it, created the
library, and linked a program that was locking up with the asm code. Sure
enough, it now worked. (By the way, as I was going through the asm code to
see what it was supposed to do, I noticed the asm bug may be caused by not
handling long/short jumps correctly, but didn't investigate further.)
Some assemblers do not generate lower case symbols, so that also caused
some inconvenience. The C code does not have this problem.
The README file has more info on the other files, which contain patches,
some of which I posted to .bugs months ago, etc.
Send any bug reports on cursesio.c to me at the addresses below.
- - - - - - - - - -
Steve Creps, Indiana University, Bloomington, home of the "Hoosiers"
creps at silver.bacs.indiana.edu (192.12.206.2)
{inuxc,rutgers,pyramid,pur-ee}!iuvax!silver!creps
creps at iubacs.bitnet (forwarded)
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 1 (of 1)."
# Contents: Makefile README curses.cmd cursesio.c diffs.1 diffs.2
# setmode.c
# Wrapped by creps at silver on Fri Sep 2 10:05:43 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(3866 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X#################################################################
X# PCCURSES #
X# Makefile to generate scurses.lib, ccurses.lib, mcurses.lib, #
X# lcurses.lib for MicroSoft 'C'. Use MicroSoft 'C' v.4.0! #
X# #
X# This makefile will generate subdirectories and call itself #
X# recursively... #
X#################################################################
X# 1.0: Release: 870515 #
X#################################################################
X
X# The following are the directories where your lib and include files
X# will be installed
X
XLIBDIR= \usr\lib
XINCDIR= \usr\include
XMODEL= S
XCFLAGS= /Ox /A$(MODEL)
X
X# General definitions:
X
XOBJS= attrib.obj beep.obj boxes.obj charadd.obj \
X chardel.obj charget.obj charins.obj charpick.obj \
X clrtobot.obj clrtoeol.obj endwin.obj initscr.obj \
X linedel.obj lineins.obj longname.obj move.obj \
X mvcursor.obj newwin.obj options.obj overlay.obj \
X prntscan.obj refresh.obj scrreg.obj setterm.obj \
X stradd.obj strget.obj termmisc.obj tabsize.obj \
X unctrl.obj update.obj winclear.obj windel.obj \
X winerase.obj winmove.obj winscrol.obj wintouch.obj \
X setmode.obj cursesio.obj
X
X.c.obj:; msc $*.c $(CFLAGS);
X
X#################################################################
X# The following copies the header files to their proper place #
X#################################################################
X
Xheaders: $(INCDIR)\curses.h $(INCDIR)\curspriv.h
X
X$(INCDIR)\curses.h: curses.h
X copy curses.h $(INCDIR)\curses.h
X
X$(INCDIR)\curspriv.h: curspriv.h
X copy curspriv.h $(INCDIR)\curspriv.h
X
X$(MODEL)curses: $(MODEL)curses.lib
X
X#################################################################
X# Put together the library in file tmp.lib, then copy it to #
X# the appropriate name for the memory model in question, and #
X# delete the temporary file #
X#################################################################
X
X$(MODEL)curses.lib: headers $(OBJS)
X del $(MODEL)curses.lib
X lib @curses.cmd
X mv curses.lib $(MODEL)curses.lib
X
X#################################################################
X# commands and dependencies for individual modules #
X#################################################################
X
Xattrib.obj: attrib.c curses.h curspriv.h
X
Xbeep.obj: beep.c curses.h curspriv.h
X
Xboxes.obj: boxes.c curses.h curspriv.h
X
Xcharadd.obj: charadd.c curses.h curspriv.h
X
Xchardel.obj: chardel.c curses.h curspriv.h
X
Xcharget.obj: charget.c curses.h curspriv.h
X
Xcharins.obj: charins.c curses.h curspriv.h
X
Xcharpick.obj: charpick.c curses.h curspriv.h
X
Xclrtobot.obj: clrtobot.c curses.h curspriv.h
X
Xclrtoeol.obj: clrtoeol.c curses.h curspriv.h
X
Xendwin.obj: endwin.c curses.h curspriv.h
X
Xinitscr.obj: initscr.c curses.h curspriv.h
X
Xlinedel.obj: linedel.c curses.h curspriv.h
X
Xlineins.obj: lineins.c curses.h curspriv.h
X
Xlongname.obj: longname.c curses.h curspriv.h
X
Xmove.obj: move.c curses.h curspriv.h
X
Xmvcursor.obj: mvcursor.c curses.h curspriv.h
X
Xnewwin.obj: newwin.c curses.h curspriv.h
X
Xoptions.obj: options.c curses.h curspriv.h
X
Xoverlay.obj: overlay.c curses.h curspriv.h
X
Xprntscan.obj: prntscan.c curses.h curspriv.h
X
Xrefresh.obj: refresh.c curses.h curspriv.h
X
Xscrreg.obj: scrreg.c curses.h curspriv.h
X
Xsetterm.obj: setterm.c curses.h curspriv.h
X
Xstradd.obj: stradd.c curses.h curspriv.h
X
Xstrget.obj: strget.c curses.h curspriv.h
X
Xtabsize.obj: tabsize.c curses.h curspriv.h
X
Xtermmisc.obj: termmisc.c curses.h curspriv.h
X
Xunctrl.obj: unctrl.c curses.h curspriv.h
X
Xupdate.obj: update.c curses.h curspriv.h
X
Xwinclear.obj: winclear.c curses.h curspriv.h
X
Xwindel.obj: windel.c curses.h curspriv.h
X
Xwinerase.obj: winerase.c curses.h curspriv.h
X
Xwinmove.obj: winmove.c curses.h curspriv.h
X
Xwinscrol.obj: winscrol.c curses.h curspriv.h
X
Xwintouch.obj: wintouch.c curses.h curspriv.h
X
Xsetmode.obj: setmode.c curses.h curspriv.h
X
Xcursesio.obj: cursesio.c
END_OF_FILE
if test 3866 -ne `wc -c <'Makefile'`; then
echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'README' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(1239 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
X This archive contains context diffs to the original PC Curses
Xdistribution to get it working properly under MSC 4.0. The first
Xdiffs file is mainly corrections to the code dealing with the maximum
Xnumber of lines in a window. The problem solved is that this field
Xwas off by a factor of one with respect to the corresponding field
Xin Unix Curses. There may also be some other changes in this file,
Xwhich I have forgotten about at this time.
X The second diffs file makes a few changes to parameters in calls
Xto the routines formerly residing in cursesio.asm. I have rewritten
Xthis module in C because the assembly language module was pretty much
Xa pain in the butt, as well as having some elusive bugs. I haven't
Xnoticed any slowdown due to this, but there may be some. The assembly
Xroutines were just calls to DOS functions, and MSC handles these nicely.
XThe C source is in cursesio.c, and replaces cursesio.asm.
X I've also included setmode.c, which was added in the Turbo C release
Xof this package.
X Finally I've included my makefile and a response file for creating
Xthe library.
X Send bug reports on cursesio.c to me at creps at silver.bacs.indiana.edu,
X{pur-ee rutgers}!iuvax!silver!creps, or creps at iubacs.bitnet.
X--Steve Creps
END_OF_FILE
if test 1239 -ne `wc -c <'README'`; then
echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'curses.cmd' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'curses.cmd'\"
else
echo shar: Extracting \"'curses.cmd'\" \(619 characters\)
sed "s/^X//" >'curses.cmd' <<'END_OF_FILE'
Xcurses
Xy
Xattrib.obj &
X+beep.obj &
X+boxes.obj &
X+charadd.obj &
X+chardel.obj &
X+charget.obj &
X+charins.obj &
X+charpick.obj &
X+clrtobot.obj &
X+clrtoeol.obj &
X+cursesio.obj &
X+endwin.obj &
X+initscr.obj &
X+linedel.obj &
X+lineins.obj &
X+longname.obj &
X+move.obj &
X+mvcursor &
X+newwin.obj &
X+options.obj &
X+overlay.obj &
X+prntscan.obj &
X+refresh.obj &
X+scrreg.obj &
X+setmode.obj &
X+setterm.obj &
X+stradd.obj &
X+strget.obj &
X+tabsize.obj &
X+termmisc.obj &
X+unctrl.obj &
X+update.obj &
X+winclear.obj &
X+windel.obj &
X+winerase.obj &
X+winmove.obj &
X+winscrol.obj &
X+wintouch.obj
Xnul
END_OF_FILE
if test 619 -ne `wc -c <'curses.cmd'`; then
echo shar: \"'curses.cmd'\" unpacked with wrong size!
fi
# end of 'curses.cmd'
fi
if test -f 'cursesio.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'cursesio.c'\"
else
echo shar: Extracting \"'cursesio.c'\" \(2185 characters\)
sed "s/^X//" >'cursesio.c' <<'END_OF_FILE'
X/* cursesio.c: MSC 4.0 replacement for cursesio.asm in the PC Curses package. */
X/* Steve Creps, creps at silver.bacs.indiana.edu, 8-27-88 */
X
X#include <dos.h>
X
Xstatic union REGS regs;
X
Xvoid
X_cursescattr(chr, attr)
Xchar chr, attr;
X{
X regs.h.ah = 0x09;
X regs.h.al = (unsigned char)chr;
X regs.h.bh = 0x00;
X regs.h.bl = (unsigned char)attr;
X regs.x.cx = 0x01;
X int86(0x10, ®s, ®s);
X return;
X}
X
Xvoid
X_cursescursor(row, column)
Xint row, column;
X{
X regs.h.ah = 0x02;
X regs.h.bh = 0x00;
X regs.h.dh = (unsigned char)row;
X regs.h.dl = (unsigned char)column;
X int86(0x10, ®s, ®s);
X return;
X}
X
Xint
X_cursesgcols()
X{
X regs.h.ah = 0x0f;
X int86(0x10, ®s, ®s);
X return (int)regs.h.ah;
X}
X
Xvoid
X_cursesputc(chr, color)
Xchar chr, color;
X{
X regs.h.ah = 0x0e;
X regs.h.al = (unsigned char)chr;
X regs.h.bh = 0x00;
X regs.h.bl = (unsigned char)color;
X int86(0x10, ®s, ®s);
X return;
X}
X
Xvoid
X_cursesscroll(urow, lcol, lrow, rcol, lines, attr)
Xint urow, lcol, lrow, rcol, lines;
Xchar attr;
X{
X if (lines >= 0) {
X regs.h.ah = 0x06;
X regs.h.al = (unsigned char)lines;
X } else {
X regs.h.ah = 0x07;
X regs.h.al = (unsigned char)(-lines);
X }
X regs.h.bh = (unsigned char)attr;
X regs.h.ch = (unsigned char)urow;
X regs.h.cl = (unsigned char)lcol;
X regs.h.dh = (unsigned char)lrow;
X regs.h.dl = (unsigned char)rcol;
X int86(0x10, ®s, ®s);
X return;
X}
X
Xint
X_cursesgcmode()
X{
X regs.h.ah = 0x03;
X regs.h.bh = 0x00;
X int86(0x10, ®s, ®s);
X return (int)regs.x.cx;
X}
X
Xvoid
X_cursescmode(startrow, endrow)
Xint startrow, endrow;
X{
X regs.h.ah = 0x01;
X regs.h.ch = (unsigned char)startrow;
X regs.h.cl = (unsigned char)endrow;
X int86(0x10, ®s, ®s);
X return;
X}
X
Xint
X_curseskey()
X{
X regs.h.ah = 0x00;
X int86(0x16, ®s, ®s);
X if (regs.h.al != 0) return (int)(regs.x.ax & 0x00ff);
X return (int)regs.x.ax;
X}
X
Xint
X_curseskeytst()
X{
X regs.h.ah = 0x01;
X int86(0x16, ®s, ®s);
X return (regs.x.cflag & 0x40) ? 1 : 0;
X}
X
Xint
X_cursesgcb()
X{
X regs.h.ah = 0x33;
X regs.h.al = 0x00;
X int86(0x21, ®s, ®s);
X return (int)regs.h.dl;
X}
X
Xvoid
X_cursesscb(setting)
Xint setting;
X{
X regs.h.ah = 0x33;
X regs.h.al = 0x00;
X regs.h.dl = (unsigned char)(setting ? 1 : 0);
X int86(0x21, ®s, ®s);
X return;
X}
END_OF_FILE
if test 2185 -ne `wc -c <'cursesio.c'`; then
echo shar: \"'cursesio.c'\" unpacked with wrong size!
fi
# end of 'cursesio.c'
fi
if test -f 'diffs.1' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'diffs.1'\"
else
echo shar: Extracting \"'diffs.1'\" \(26365 characters\)
sed "s/^X//" >'diffs.1' <<'END_OF_FILE'
X*** c:\tmp\boxes.c
X--- c:\src\curses\boxes.c
X**************
X*** 36,42
X int i;
X
X if (ymax == 0)
X! ymax = win->_maxy;
X if (xmax == 0)
X xmax = win->_maxx;
X
X--- 36,42 -----
X int i;
X
X if (ymax == 0)
X! ymax = win->_maxy - 1;
X if (xmax == 0)
X xmax = win->_maxx - 1;
X
X**************
X*** 38,44
X if (ymax == 0)
X ymax = win->_maxy;
X if (xmax == 0)
X! xmax = win->_maxx;
X
X if (ymin >= win->_maxy || ymax > win->_maxy ||
X xmin >= win->_maxx || xmax > win->_maxx ||
X--- 38,44 -----
X if (ymax == 0)
X ymax = win->_maxy - 1;
X if (xmax == 0)
X! xmax = win->_maxx - 1;
X
X if (ymin >= win->_maxy || ymax > win->_maxy ||
X xmin >= win->_maxx || xmax > win->_maxx ||
X*** c:\tmp\charadd.c
X--- c:\src\curses\charadd.c
X**************
X*** 51,57
X int ts = win->_tabsize;
X
X ch &= 0xff; /* kill any sing-extend */
X! if (y > win->_maxy || x > win->_maxx || y < 0 || x < 0)
X return(ERR);
X switch (ch)
X {
X--- 51,57 -----
X int ts = win->_tabsize;
X
X ch &= 0xff; /* kill any sing-extend */
X! if (y >= win->_maxy || x >= win->_maxx || y < 0 || x < 0)
X return(ERR);
X switch (ch)
X {
X**************
X*** 95,101
X win->_maxchng[y] = x;
X } /* if */
X win->_line[y][x++] = ch;
X! if (x > win->_maxx) /* wrap around test */
X {
X x = 0;
X if ((y = newline(win, y)) < 0)
X--- 95,101 -----
X win->_maxchng[y] = x;
X } /* if */
X win->_line[y][x++] = ch;
X! if (x >= win->_maxx) /* wrap around test */
X {
X x = 0;
X if ((y = newline(win, y)) < 0)
X*** c:\tmp\chardel.c
X--- c:\src\curses\chardel.c
X**************
X*** 28,34
X int *end;
X short y = win->_cury;
X short x = win->_curx;
X! short maxx = win->_maxx;
X
X end = &win->_line[y][maxx];
X temp1 = &win->_line[y][x];
X--- 28,34 -----
X int *end;
X short y = win->_cury;
X short x = win->_curx;
X! short maxx = win->_maxx - 1;
X
X end = &win->_line[y][maxx];
X temp1 = &win->_line[y][x];
X*** c:\tmp\charget.c
X--- c:\src\curses\charget.c
X**************
X*** 14,19
X #include <curses.h>
X #include <curspriv.h>
X
X static int rawgetch(); /* get raw char via BIOS */
X static int sysgetch(); /* get char via system */
X static int validchar(); /* keypad xlate and char check */
X--- 14,23 -----
X #include <curses.h>
X #include <curspriv.h>
X
X+ /* NDP 1/88 Moved undef from just sysgetch() to here so it covers
X+ flushinp(). This caused raw() call to crash */
X+ #undef getch /* we use MSC getch() below */
X+
X static int rawgetch(); /* get raw char via BIOS */
X static int sysgetch(); /* get char via system */
X static int validchar(); /* keypad xlate and char check */
X**************
X*** 101,107
X
X void flushinp()
X {
X! while(_curseskeytst) /* empty keyboard buffer */
X _curseskey();
X while(kbhit()) /* empty system's buffers */
X getch();
X--- 105,111 -----
X
X void flushinp()
X {
X! while(_curseskeytst()) /* empty keyboard buffer */
X _curseskey();
X while(kbhit()) /* empty system's buffers */
X getch();
X**************
X*** 181,187
X /* mode is active in the window, then sysgetch() returns -1 if */
X /* no character is available. */
X /****************************************************************/
X- #undef getch /* we use MSC getch() below */
X
X static int sysgetch()
X {
X--- 185,190 -----
X /* mode is active in the window, then sysgetch() returns -1 if */
X /* no character is available. */
X /****************************************************************/
X
X static int sysgetch()
X {
X**************
X*** 241,246
X if (pindex > gindex) /* buffered char */
X return(TRUE);
X if (_cursvar.raw) /* raw mode test */
X! return(_curseskeytest());
X return(kbhit()); /* normal mode test */
X } /* _cursespendch */
X--- 244,249 -----
X if (pindex > gindex) /* buffered char */
X return(TRUE);
X if (_cursvar.raw) /* raw mode test */
X! return(_curseskeytst());
X return(kbhit()); /* normal mode test */
X } /* _cursespendch */
X*** c:\tmp\charins.c
X--- c:\src\curses\charins.c
X**************
X*** 28,34
X int *end;
X int x = win->_curx;
X int y = win->_cury;
X! int maxx = win->_maxx;
X
X if((c < ' ') && (c == '\n' || c == '\r' || c == '\t' || c == '\b'))
X return(waddch(win, c));
X--- 28,34 -----
X int *end;
X int x = win->_curx;
X int y = win->_cury;
X! int maxx = win->_maxx - 1;
X
X if((c < ' ') && (c == '\n' || c == '\r' || c == '\t' || c == '\b'))
X return(waddch(win, c));
X*** c:\tmp\clrtobot.c
X--- c:\src\curses\clrtobot.c
X**************
X*** 35,41
X for (y = win->_cury; y <= win->_regbottom; y++)
X {
X minx = _NO_CHANGE;
X! end = &win->_line[y][win->_maxx];
X for (ptr = &win->_line[y][startx]; ptr <= end; ptr++)
X {
X if (*ptr != blank)
X--- 35,41 -----
X for (y = win->_cury; y <= win->_regbottom; y++)
X {
X minx = _NO_CHANGE;
X! end = &win->_line[y][win->_maxx - 1];
X for (ptr = &win->_line[y][startx]; ptr <= end; ptr++)
X {
X if (*ptr != blank)
X**************
X*** 63,69
X /* stdscr, and all lines below it with blanks. */
X /****************************************************************/
X
X! int clrbot()
X {
X return(wclrtobot(stdscr));
X } /* clrbot */
X--- 63,69 -----
X /* stdscr, and all lines below it with blanks. */
X /****************************************************************/
X
X! int clrtobot()
X {
X return(wclrtobot(stdscr));
X } /* clrtobot */
X**************
X*** 66,72
X int clrbot()
X {
X return(wclrtobot(stdscr));
X! } /* clrbot */
X
X /****************************************************************/
X /* Mvclrtobot() moves the cursor to a new position in stdscr */
X--- 66,72 -----
X int clrtobot()
X {
X return(wclrtobot(stdscr));
X! } /* clrtobot */
X
X /****************************************************************/
X /* Mvclrtobot() moves the cursor to a new position in stdscr */
X*** c:\tmp\clrtoeol.c
X--- c:\src\curses\clrtoeol.c
X**************
X*** 34,40
X x = win->_curx;
X blank = ' ' | (win->_attrs & ATR_MSK);
X
X! end = &win->_line[y][win->_maxx];
X minx = _NO_CHANGE;
X maxx = &win->_line[y][x];
X for (ptr = maxx; ptr <= end; ptr++)
X--- 34,40 -----
X x = win->_curx;
X blank = ' ' | (win->_attrs & ATR_MSK);
X
X! end = &win->_line[y][win->_maxx - 1];
X minx = _NO_CHANGE;
X maxx = &win->_line[y][x];
X for (ptr = maxx; ptr <= end; ptr++)
X*** c:\tmp\cursesio.asm
X--- c:\src\curses\cursesio.asm
X**************
X*** 1,4
X! TITLE PCcurses BIOS Control Functions for MicroSoft 'C' v.4.0
X NAME CURSESIO
X PAGE 46,132
X ;****************************************************************
X--- 1,5 -----
X! ;TITLE PCcurses BIOS Control Functions for MicroSoft 'C' v.4.0
X! TITLE PCcurses BIOS Control Functions for Turbo C 1.5
X NAME CURSESIO
X PAGE 46,132
X ;****************************************************************
X**************
X*** 22,27
X ;* Revised: *
X ;* 1.0: Release: 870515 *
X ;****************************************************************
X ;
X INCLUDE FARNEAR.INC ;DEFINE FAR OR NEAR CALL SEQUENCE
X INCLUDE SMALHUGE.INC ;DEFINE FAR OR NEAR DATA ACCESS
X--- 23,32 -----
X ;* Revised: *
X ;* 1.0: Release: 870515 *
X ;****************************************************************
X+ ;* Modified by N. Dean Pentcheff (dean at violet.berkeley.edu) for *
X+ ;* Turbo C 1.5. Search for "NDP" to see changes. *
X+ ;* 1/88 *
X+ ;****************************************************************
X ;
X INCLUDE FARNEAR.INC ;DEFINE FAR OR NEAR CALL SEQUENCE
X INCLUDE SMALHUGE.INC ;DEFINE FAR OR NEAR DATA ACCESS
X**************
X*** 29,34
X SYSTEM EQU 21H ;SYSTEM CALL
X BRKCHK EQU 33H ;BREAK SET/CHECK FUNCTION CODE
X ;
X _TEXT SEGMENT BYTE PUBLIC 'CODE'
X ASSUME CS: _TEXT
X ;
X--- 34,43 -----
X SYSTEM EQU 21H ;SYSTEM CALL
X BRKCHK EQU 33H ;BREAK SET/CHECK FUNCTION CODE
X ;
X+ if far_call ; NDP 1/88 Turbo C 1.5
X+ CURSESIO_TEXT SEGMENT BYTE PUBLIC 'CODE' ; NDP 1/88
X+ ASSUME CS: CURSESIO_TEXT ; NDP 1/88
X+ else ; NDP 1/88
X _TEXT SEGMENT BYTE PUBLIC 'CODE'
X ASSUME CS: _TEXT
X endif ; NDP 1/88
X**************
X*** 31,36
X ;
X _TEXT SEGMENT BYTE PUBLIC 'CODE'
X ASSUME CS: _TEXT
X ;
X ;****************************************************************
X ;* Function entry and exit macros, and parameter fetch macro. *
X--- 40,46 -----
X else ; NDP 1/88
X _TEXT SEGMENT BYTE PUBLIC 'CODE'
X ASSUME CS: _TEXT
X+ endif ; NDP 1/88
X ;
X ;****************************************************************
X ;* Function entry and exit macros, and parameter fetch macro. *
X**************
X*** 72,78
X ;
X PAGE
X ;****************************************************************
X! ;* _cursesocattr *
X ;* *
X ;* void _cursescattr(chr,attr) *
X ;* *
X--- 82,88 -----
X ;
X PAGE
X ;****************************************************************
X! ;* _cursescattr *
X ;* *
X ;* void _cursescattr(chr,attr) *
X ;* *
X**************
X*** 235,240
X ;* *
X ;* Returns 1 if a character is available, 0 otherwise. *
X ;****************************************************************
X PUBLIC __curseskeytst
X ;
X c_entry __curseskeytst
X--- 245,258 -----
X ;* *
X ;* Returns 1 if a character is available, 0 otherwise. *
X ;****************************************************************
X+ ;* NDP 1/88 *
X+ ;* The change below bothers me. The original should be correct *
X+ ;* according to the documentation in Peter Norton's Programmer's*
X+ ;* Guide to the IBM PC. The modification agrees with Norton's *
X+ ;* example (which contradicts his description), and seems to *
X+ ;* work here. This has been tested on a Phoenix-BIOS AT clone *
X+ ;* and a Zenith Z-151 PC clone (Zenith BIOS). *
X+ ;****************************************************************
X PUBLIC __curseskeytst
X ;
X c_entry __curseskeytst
X**************
X*** 240,246
X c_entry __curseskeytst
X MOV AH,1
X INT 16H
X! JZ SHORT TST1
X MOV AX,0
X JMP SHORT EXTTST
X TST1: MOV AX,1
X--- 258,264 -----
X c_entry __curseskeytst
X MOV AH,1
X INT 16H
X! JNZ SHORT TST1 ; NDP 1/88 Changed from JZ to JNZ
X MOV AX,0
X JMP SHORT EXTTST
X TST1: MOV AX,1
X**************
X*** 281,286
X SCB1: INT SYSTEM
X c_exit __cursesscb
X ;
X _TEXT ENDS
X if1
X %OUT Pass 1 Completed
X--- 299,307 -----
X SCB1: INT SYSTEM
X c_exit __cursesscb
X ;
X+ if far_call ; NDP 1/88 Turbo C 1.5
X+ CURSESIO_TEXT ENDS ; NDP 1/88
X+ else ; NDP 1/88
X _TEXT ENDS
X endif ; NDP 1/88
X if1
X**************
X*** 282,287
X c_exit __cursesscb
X ;
X _TEXT ENDS
X if1
X %OUT Pass 1 Completed
X else
X--- 303,309 -----
X CURSESIO_TEXT ENDS ; NDP 1/88
X else ; NDP 1/88
X _TEXT ENDS
X+ endif ; NDP 1/88
X if1
X %OUT Pass 1 Completed
X else
X*** c:\tmp\curspriv.h
X--- c:\src\curses\curspriv.h
X**************
X*** 68,73
X
X /* curses internal functions, not to be used by programmers */
X
X extern void _cursescattr();
X extern void _cursescmode();
X extern void _cursescursor();
X--- 68,90 -----
X
X /* curses internal functions, not to be used by programmers */
X
X+ /* For those of us with braindamaged assemblers that only
X+ * produce upper case public identifiers...
X+ */
X+ #ifdef UCMASM
X+ #define _cursescattr _CURSESCATTR
X+ #define _cursescmode _CURSESCMODE
X+ #define _cursescursor _CURSESCURSOR
X+ #define _cursesgcb _CURSESGCB
X+ #define _cursesgcmode _CURSESGCMODE
X+ #define _cursesgcols _CURSESGCOLS
X+ #define _curseskey _CURSESKEY
X+ #define _cursesscroll _CURSESSCROLL
X+ #define _curseskeytst _CURSESKEYTST
X+ #define _cursesputc _CURSESPUTC
X+ #define _cursesscb _CURSESSCB
X+ #endif
X+
X extern void _cursescattr();
X extern void _cursescmode();
X extern void _cursescursor();
X**************
X*** 76,81
X extern int _cursesgcols();
X extern int _curseskey();
X extern int _curseskeytst();
X! extern bool _cursespendch();
X extern void _cursesputc();
X extern void _cursesscb();
X--- 93,99 -----
X extern int _cursesgcols();
X extern int _curseskey();
X extern int _curseskeytst();
X! extern void _cursesscroll(); /* NDP 1/88 Was missing. */
X! extern bool _cursespendch(); /* NDP Note: not asm, in charget() */
X extern void _cursesputc();
X extern void _cursesscb();
X*** c:\tmp\linedel.c
X--- c:\src\curses\linedel.c
X**************
X*** 35,41
X {
X win->_line[y] = win->_line[y+1];
X win->_minchng[y] = 0;
X! win->_maxchng[y] = win->_maxx;
X }
X win->_minchng[y] = 0;
X win->_maxchng[y] = win->_maxx;
X--- 35,41 -----
X {
X win->_line[y] = win->_line[y+1];
X win->_minchng[y] = 0;
X! win->_maxchng[y] = win->_maxx - 1;
X }
X win->_minchng[y] = 0;
X win->_maxchng[y] = win->_maxx - 1;
X**************
X*** 38,44
X win->_maxchng[y] = win->_maxx;
X }
X win->_minchng[y] = 0;
X! win->_maxchng[y] = win->_maxx;
X win->_line[win->_regbottom] = temp;
X for (end = &(temp[win->_maxx]); temp <= end;)
X *temp++ = blank;
X--- 38,44 -----
X win->_maxchng[y] = win->_maxx - 1;
X }
X win->_minchng[y] = 0;
X! win->_maxchng[y] = win->_maxx - 1;
X win->_line[win->_regbottom] = temp;
X for (end = &(temp[win->_maxx - 1]); temp <= end;)
X *temp++ = blank;
X**************
X*** 40,46
X win->_minchng[y] = 0;
X win->_maxchng[y] = win->_maxx;
X win->_line[win->_regbottom] = temp;
X! for (end = &(temp[win->_maxx]); temp <= end;)
X *temp++ = blank;
X return(OK);
X } /* wdeleteln */
X--- 40,46 -----
X win->_minchng[y] = 0;
X win->_maxchng[y] = win->_maxx - 1;
X win->_line[win->_regbottom] = temp;
X! for (end = &(temp[win->_maxx - 1]); temp <= end;)
X *temp++ = blank;
X return(OK);
X } /* wdeleteln */
X*** c:\tmp\lineins.c
X--- c:\src\curses\lineins.c
X**************
X*** 33,39
X {
X win->_line[y] = win->_line[y-1];
X win->_minchng[y] = 0;
X! win->_maxchng[y] = win->_maxx;
X } /* for */
X win->_line[win->_cury] = temp;
X for (end = &temp[win->_maxx]; temp <= end; temp++)
X--- 33,39 -----
X {
X win->_line[y] = win->_line[y-1];
X win->_minchng[y] = 0;
X! win->_maxchng[y] = win->_maxx - 1;
X } /* for */
X win->_line[win->_cury] = temp;
X for (end = &temp[win->_maxx - 1]; temp <= end; temp++)
X**************
X*** 36,42
X win->_maxchng[y] = win->_maxx;
X } /* for */
X win->_line[win->_cury] = temp;
X! for (end = &temp[win->_maxx]; temp <= end; temp++)
X *temp = blank;
X win->_minchng[win->_cury] = 0;
X win->_maxchng[win->_cury] = win->_maxx;
X--- 36,42 -----
X win->_maxchng[y] = win->_maxx - 1;
X } /* for */
X win->_line[win->_cury] = temp;
X! for (end = &temp[win->_maxx - 1]; temp <= end; temp++)
X *temp = blank;
X win->_minchng[win->_cury] = 0;
X win->_maxchng[win->_cury] = win->_maxx - 1;
X**************
X*** 39,45
X for (end = &temp[win->_maxx]; temp <= end; temp++)
X *temp = blank;
X win->_minchng[win->_cury] = 0;
X! win->_maxchng[win->_cury] = win->_maxx;
X return(OK);
X } /* winsertln */
X
X--- 39,45 -----
X for (end = &temp[win->_maxx - 1]; temp <= end; temp++)
X *temp = blank;
X win->_minchng[win->_cury] = 0;
X! win->_maxchng[win->_cury] = win->_maxx - 1;
X return(OK);
X } /* winsertln */
X
X*** c:\tmp\move.c
X--- c:\src\curses\move.c
X**************
X*** 23,29
X int y;
X int x;
X {
X! if ((x < 0)||(x > win->_maxx)||(y < win->_regtop)||(y >win->_regbottom))
X return(ERR);
X win->_curx = x;
X win->_cury = y;
X--- 23,29 -----
X int y;
X int x;
X {
X! if ((x < 0)||(x >= win->_maxx)||(y < win->_regtop)||(y >win->_regbottom))
X return(ERR);
X win->_curx = x;
X win->_cury = y;
X*** c:\tmp\newwin.c
X--- c:\src\curses\newwin.c
X**************
X*** 59,66
X
X win->_curx = 0;
X win->_cury = 0;
X! win->_maxy = num_lines - 1;
X! win->_maxx = num_columns - 1;
X win->_begy = begy;
X win->_begx = begx;
X win->_flags = 0;
X--- 59,66 -----
X
X win->_curx = 0;
X win->_cury = 0;
X! win->_maxy = num_lines;
X! win->_maxx = num_columns;
X win->_begy = begy;
X win->_begx = begx;
X win->_flags = 0;
X**************
X*** 157,164
X if (
X begy < orig->_begy ||
X begx < orig->_begx ||
X! (begy + num_lines) > (orig->_begy + orig->_maxy) ||
X! (begx + num_columns) > (orig->_begx + orig->_maxx)
X )
X return((WINDOW *) ERR);
X
X--- 157,164 -----
X if (
X begy < orig->_begy ||
X begx < orig->_begx ||
X! (begy + num_lines) >= (orig->_begy + orig->_maxy) ||
X! (begx + num_columns) >= (orig->_begx + orig->_maxx)
X )
X return((WINDOW *) ERR);
X
X**************
X*** 163,169
X return((WINDOW *) ERR);
X
X if (num_lines == 0)
X! num_lines = orig->_maxy - (begy - orig->_begy);
X if (num_columns == 0)
X num_columns = orig->_maxx - (begx - orig->_begx);
X if ((win = makenew(num_lines, num_columns, begy, begx)) == (WINDOW *) ERR)
X--- 163,169 -----
X return((WINDOW *) ERR);
X
X if (num_lines == 0)
X! num_lines = orig->_maxy - 1 - (begy - orig->_begy);
X if (num_columns == 0)
X num_columns = orig->_maxx - 1 - (begx - orig->_begx);
X if ((win = makenew(num_lines, num_columns, begy, begx)) == (WINDOW *) ERR)
X**************
X*** 165,171
X if (num_lines == 0)
X num_lines = orig->_maxy - (begy - orig->_begy);
X if (num_columns == 0)
X! num_columns = orig->_maxx - (begx - orig->_begx);
X if ((win = makenew(num_lines, num_columns, begy, begx)) == (WINDOW *) ERR)
X return((WINDOW *) ERR);
X
X--- 165,171 -----
X if (num_lines == 0)
X num_lines = orig->_maxy - 1 - (begy - orig->_begy);
X if (num_columns == 0)
X! num_columns = orig->_maxx - 1 - (begx - orig->_begx);
X if ((win = makenew(num_lines, num_columns, begy, begx)) == (WINDOW *) ERR)
X return((WINDOW *) ERR);
X
X*** c:\tmp\overlay.c
X--- c:\src\curses\overlay.c
X**************
X*** 33,40
X int last_line;
X int last_col;
X
X! last_col = min(win1->_maxx, win2->_maxx);
X! last_line = min(win1->_maxy, win2->_maxy);
X attrs = win2->_attrs & ATR_MSK;
X minchng = win2->_minchng;
X maxchng = win2->_maxchng;
X--- 33,40 -----
X int last_line;
X int last_col;
X
X! last_col = min(win1->_maxx, win2->_maxx) - 1;
X! last_line = min(win1->_maxy, win2->_maxy) - 1;
X attrs = win2->_attrs & ATR_MSK;
X minchng = win2->_minchng;
X maxchng = win2->_maxchng;
X**************
X*** 95,102
X int last_line;
X int last_col;
X
X! last_col = min(win1->_maxx, win2->_maxx);
X! last_line = min(win1->_maxy, win2->_maxy);
X attrs = win2->_attrs & ATR_MSK;
X minchng = win2->_minchng;
X maxchng = win2->_maxchng;
X--- 95,102 -----
X int last_line;
X int last_col;
X
X! last_col = min(win1->_maxx, win2->_maxx) - 1;
X! last_line = min(win1->_maxy, win2->_maxy) - 1;
X attrs = win2->_attrs & ATR_MSK;
X minchng = win2->_minchng;
X maxchng = win2->_maxchng;
X*** c:\tmp\refresh.c
X--- c:\src\curses\refresh.c
X**************
X*** 53,59
X begy = win->_begy;
X begx = win->_begx;
X
X! for (i=0, j=begy; i <= win->_maxy; i++, j++)
X {
X if (win->_minchng[i] != _NO_CHANGE)
X {
X--- 53,59 -----
X begy = win->_begy;
X begx = win->_begx;
X
X! for (i=0, j=begy; i < win->_maxy; i++, j++)
X {
X if (win->_minchng[i] != _NO_CHANGE)
X {
X*** c:\tmp\scrreg.c
X--- c:\src\curses\scrreg.c
X**************
X*** 30,36
X &&
X (win->_cury <= bottom)
X &&
X! (bottom <= win->_maxy)
X )
X {
X win->_regtop = top;
X--- 30,36 -----
X &&
X (win->_cury <= bottom)
X &&
X! (bottom < win->_maxy)
X )
X {
X win->_regtop = top;
X*** c:\tmp\strget.c
X--- c:\src\curses\strget.c
X**************
X*** 147,153
X {
X if (*p == '\t') /* go to next tab */
X x = ((x/ts)+1) * ts;
X! else
X if ((*p < ' ') || (*p == 0x7f)) /* control character */
X x += 2;
X else /* normal char */
X--- 147,153 -----
X {
X if (*p == '\t') /* go to next tab */
X x = ((x/ts)+1) * ts;
X! else {
X if ((*p < ' ') || (*p == 0x7f)) /* control character */
X x += 2;
X else /* normal char */
X**************
X*** 152,158
X x += 2;
X else /* normal char */
X x++;
X! if (x > w->_maxx) /* go to next line? */
X x = 0;
X } /* while */
X if (!(w->_curx)) /* if step-over newline */
X--- 152,159 -----
X x += 2;
X else /* normal char */
X x++;
X! }
X! if (x >= w->_maxx) /* go to next line? */
X x = 0;
X } /* for */
X if (!(w->_curx)) /* if step-over newline */
X**************
X*** 154,160
X x++;
X if (x > w->_maxx) /* go to next line? */
X x = 0;
X! } /* while */
X if (!(w->_curx)) /* if step-over newline */
X nbs = w->_maxx+1 - x;
X else /* in-line tab */
X--- 155,161 -----
X }
X if (x >= w->_maxx) /* go to next line? */
X x = 0;
X! } /* for */
X if (!(w->_curx)) /* if step-over newline */
X nbs = w->_maxx - x;
X else /* in-line tab */
X**************
X*** 156,162
X x = 0;
X } /* while */
X if (!(w->_curx)) /* if step-over newline */
X! nbs = w->_maxx+1 - x;
X else /* in-line tab */
X nbs = w->_curx - x; /* positions to erase */
X } /* if */
X--- 157,163 -----
X x = 0;
X } /* for */
X if (!(w->_curx)) /* if step-over newline */
X! nbs = w->_maxx - x;
X else /* in-line tab */
X nbs = w->_curx - x; /* positions to erase */
X } /* if */
X**************
X*** 168,175
X else
X if (w->_cury) /* if not on top line */
X {
X! mvwaddch(w,w->_cury-1,w->_maxx,' '); /* put space at line end */
X! wmove(w,w->_cury-1,w->_maxx); /* and go there again */
X } /* else */
X } /* while */
X
X--- 169,176 -----
X else
X if (w->_cury) /* if not on top line */
X {
X! mvwaddch(w,w->_cury-1,w->_maxx - 1,' ');/* put space at line end */
X! wmove(w,w->_cury-1,w->_maxx - 1); /* and go there again */
X } /* else */
X } /* while */
X
X*** c:\tmp\windel.c
X--- c:\src\curses\windel.c
X**************
X*** 27,33
X
X if (! (win->_flags & _SUBWIN)) /* subwindow uses 'parent's' lines */
X {
X! for (i = 0; i <= win->_maxy && win->_line[i]; i++)
X free(win->_line[i]);
X }
X free(win->_minchng);
X--- 27,33 -----
X
X if (! (win->_flags & _SUBWIN)) /* subwindow uses 'parent's' lines */
X {
X! for (i = 0; i < win->_maxy && win->_line[i]; i++)
X free(win->_line[i]);
X }
X free(win->_minchng);
X*** c:\tmp\winerase.c
X--- c:\src\curses\winerase.c
X**************
X*** 33,39
X for (y = win->_regtop; y <= win->_regbottom; y++) /* clear all lines */
X {
X start = win->_line[y];
X! end = &start[win->_maxx];
X while (start <= end) /* clear all line */
X *start++ = blank;
X win->_minchng[y] = 0;
X--- 33,39 -----
X for (y = win->_regtop; y <= win->_regbottom; y++) /* clear all lines */
X {
X start = win->_line[y];
X! end = &start[win->_maxx - 1];
X while (start <= end) /* clear all line */
X *start++ = blank;
X win->_minchng[y] = 0;
X**************
X*** 37,43
X while (start <= end) /* clear all line */
X *start++ = blank;
X win->_minchng[y] = 0;
X! win->_maxchng[y] = win->_maxx;
X }
X win->_cury = win->_regtop; /* cursor home */
X win->_curx = 0;
X--- 37,43 -----
X while (start <= end) /* clear all line */
X *start++ = blank;
X win->_minchng[y] = 0;
X! win->_maxchng[y] = win->_maxx - 1;
X }
X win->_cury = win->_regtop; /* cursor home */
X win->_curx = 0;
X*** c:\tmp\winmove.c
X--- c:\src\curses\winmove.c
X**************
X*** 23,29
X WINDOW *win;
X int begy, begx;
X {
X! if ((begy + win->_maxy) > (LINES-1) || (begx + win->_maxx) > (COLS-1))
X return(ERR);
X win->_begy = begy;
X win->_begx = begx;
X--- 23,29 -----
X WINDOW *win;
X int begy, begx;
X {
X! if ((begy + win->_maxy) >= (LINES-1) || (begx + win->_maxx) >= (COLS-1))
X return(ERR);
X win->_begy = begy;
X win->_begx = begx;
X*** c:\tmp\winscrol.c
X--- c:\src\curses\winscrol.c
X**************
X*** 40,46
X {
X win->_line[i] = win->_line[i+1]; /* re-arrange line pointers */
X win->_minchng[i] = 0;
X! win->_maxchng[i] = win->_maxx;
X }
X for (ptr = temp; ptr - temp <= win->_maxx; ptr++)
X *ptr = blank; /* make a blank line */
X--- 40,46 -----
X {
X win->_line[i] = win->_line[i+1]; /* re-arrange line pointers */
X win->_minchng[i] = 0;
X! win->_maxchng[i] = win->_maxx - 1;
X }
X for (ptr = temp; ptr - temp < win->_maxx; ptr++)
X *ptr = blank; /* make a blank line */
X**************
X*** 42,48
X win->_minchng[i] = 0;
X win->_maxchng[i] = win->_maxx;
X }
X! for (ptr = temp; ptr - temp <= win->_maxx; ptr++)
X *ptr = blank; /* make a blank line */
X win->_line[win->_regbottom] = temp;
X if (win->_cury > win->_regtop) /* if not on top line */
X--- 42,48 -----
X win->_minchng[i] = 0;
X win->_maxchng[i] = win->_maxx - 1;
X }
X! for (ptr = temp; ptr - temp < win->_maxx; ptr++)
X *ptr = blank; /* make a blank line */
X win->_line[win->_regbottom] = temp;
X if (win->_cury > win->_regtop) /* if not on top line */
X**************
X*** 48,52
X if (win->_cury > win->_regtop) /* if not on top line */
X win->_cury--; /* cursor scrolls too */
X win->_minchng[win->_regbottom] = 0;
X! win->_maxchng[win->_regbottom] = win->_maxx;
X } /* scroll */
X--- 48,52 -----
X if (win->_cury > win->_regtop) /* if not on top line */
X win->_cury--; /* cursor scrolls too */
X win->_minchng[win->_regbottom] = 0;
X! win->_maxchng[win->_regbottom] = win->_maxx - 1;
X } /* scroll */
X*** c:\tmp\wintouch.c
X--- c:\src\curses\wintouch.c
X**************
X*** 26,33
X int maxy;
X int maxx;
X
X! maxy = win->_maxy;
X! maxx = win->_maxx;
X
X for (y = 0; y <= maxy; y++)
X {
X--- 26,33 -----
X int maxy;
X int maxx;
X
X! maxy = win->_maxy - 1;
X! maxx = win->_maxx - 1;
X
X for (y = 0; y <= maxy; y++)
X {
END_OF_FILE
if test 26365 -ne `wc -c <'diffs.1'`; then
echo shar: \"'diffs.1'\" unpacked with wrong size!
fi
# end of 'diffs.1'
fi
if test -f 'diffs.2' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'diffs.2'\"
else
echo shar: Extracting \"'diffs.2'\" \(2760 characters\)
sed "s/^X//" >'diffs.2' <<'END_OF_FILE'
X*** endwin.c
X--- c:endwin.c
X**************
X*** 26,32
X delwin(curscr);
X delwin(_cursvar.tmpwin);
X curson(); /* turn on cursor if off */
X! _cursescursor(0,LINES-1, 0); /* put at lower left */
X _cursesscb(_cursvar.orgcbr); /* restore original ^BREAK setting */
X return(OK);
X } /* endwin */
X--- 26,33 -----
X delwin(curscr);
X delwin(_cursvar.tmpwin);
X curson(); /* turn on cursor if off */
X! /* _cursescursor(0,LINES-1, 0); /* put at lower left */
X! _cursescursor(LINES - 1, 0); /* put at lower left */
X _cursesscb(_cursvar.orgcbr); /* restore original ^BREAK setting */
X return(OK);
X } /* endwin */
X*** mvcursor.c
X--- c:mvcursor.c
X**************
X*** 26,32
X {
X if ((newy >= LINES) || (newx >= COLS) || (newy < 0) || (newx < 0))
X return(ERR);
X! _cursescursor(0,newy,newx);
X _cursvar.cursrow = newy;
X _cursvar.curscol = newx;
X return(OK);
X--- 26,33 -----
X {
X if ((newy >= LINES) || (newx >= COLS) || (newy < 0) || (newx < 0))
X return(ERR);
X! /* _cursescursor(0,newy,newx);*/
X! _cursescursor(newy, newx);
X _cursvar.cursrow = newy;
X _cursvar.curscol = newx;
X return(OK);
X*** update.c
X--- c:update.c
X**************
X*** 23,29
X static WINDOW *twin; /* used by many routines */
X
X static char atrtab[64] = /* attribute encoding table. */
X! { /* feel free to edit if your */
X 7, /* NORMAL (0) */ /* display board supports all */
X 0x87, /* BLINK */ /* possible combinations */
X 0, /* BLANK */
X--- 23,29 -----
X static WINDOW *twin; /* used by many routines */
X
X static char atrtab[64] = /* attribute encoding table. */
X! { /* feel free to edit if your */
X 7, /* NORMAL (0) */ /* display board supports all */
X 0x87, /* BLINK */ /* possible combinations */
X 0, /* BLANK */
X**************
X*** 223,229
X {
X if((_cursvar.cursrow == row) && (_cursvar.curscol == col))
X return;
X! _cursescursor(0,row,col);
X _cursvar.cursrow = row;
X _cursvar.curscol = col;
X } /* gotoxy */
X--- 223,230 -----
X {
X if((_cursvar.cursrow == row) && (_cursvar.curscol == col))
X return;
X! /* _cursescursor(0,row,col);*/
X! _cursescursor(row, col);
X _cursvar.cursrow = row;
X _cursvar.curscol = col;
X } /* gotoxy */
X**************
X*** 238,242
X int ch;
X {
X if ((_cursvar.cursrow < LINES) || (_cursvar.curscol < COLS))
X! _cursescattr(0,ch,atrtab[(ch >> 8) & 0x3f],1);
X } /* Putchar */
X--- 239,244 -----
X int ch;
X {
X if ((_cursvar.cursrow < LINES) || (_cursvar.curscol < COLS))
X! /* _cursescattr(0,ch,atrtab[(ch >> 8) & 0x3f],1);*/
X! _cursescattr(ch, atrtab[(ch >> 8) & 0x3f]);
X } /* Putchar */
END_OF_FILE
if test 2760 -ne `wc -c <'diffs.2'`; then
echo shar: \"'diffs.2'\" unpacked with wrong size!
fi
# end of 'diffs.2'
fi
if test -f 'setmode.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'setmode.c'\"
else
echo shar: Extracting \"'setmode.c'\" \(2111 characters\)
sed "s/^X//" >'setmode.c' <<'END_OF_FILE'
X/*
X * setmode.c
X * PC Curses versions of:
X * reset_prog_mode();
X * reset_shell_mode();
X * set_prog_mode();
X * set_shell_mode();
X * N. Dean Pentcheff (dean at violet.berkeley.edu)
X * 1/88
X */
X
X#include <curses.h>
X#include <curspriv.h>
X
Xstruct cttyset {
X bool been_set;
X bool oautocr;
X bool ocbreak;
X bool oecho;
X bool oraw;
X};
X
Xstatic struct cttyset sh_tty = {FALSE}; /* tty modes for shell_mode */
Xstatic struct cttyset pr_tty = {FALSE}; /* tty modes for prog_mode */
X
X/****************************************************************/
X/* Def_prog_mode saves the current tty status, to be recalled */
X/* later by reset_prog_mode */
X/****************************************************************/
X
Xvoid def_prog_mode()
X{
X pr_tty.been_set = TRUE;
X pr_tty.oautocr = _cursvar.autocr;
X pr_tty.ocbreak = _cursvar.cbreak;
X pr_tty.oecho = _cursvar.echo;
X pr_tty.oraw = _cursvar.raw;
X} /* def_prog_mode */
X
X
X/****************************************************************/
X/* Reset_prog_mode resets tty modes to the values saved in a */
X/* call to def_prog_mode. */
X/****************************************************************/
Xvoid reset_prog_mode()
X{
X if (pr_tty.been_set == TRUE) {
X _cursvar.autocr = pr_tty.oautocr;
X _cursvar.cbreak = pr_tty.ocbreak;
X _cursvar.echo = pr_tty.oecho;
X _cursvar.raw = pr_tty.oraw;
X }
X}
X
X/****************************************************************/
X/* Def_shell_mode saves the tty status, to be recalled by */
X/* reset_shell_mode. A noop in PC Curses */
X/****************************************************************/
Xvoid def_shell_mode()
X{
X return;
X}
X
X/****************************************************************/
X/* Reset_shell_mode resets the tty status to the status it had */
X/* before curses began. */
X/****************************************************************/
Xvoid reset_shell_mode()
X{
X _cursvar.autocr = TRUE;
X _cursvar.cbreak = FALSE;
X _cursvar.echo = TRUE;
X _cursvar.raw = FALSE;
X}
END_OF_FILE
if test 2111 -ne `wc -c <'setmode.c'`; then
echo shar: \"'setmode.c'\" unpacked with wrong size!
fi
# end of 'setmode.c'
fi
echo shar: End of archive 1 \(of 1\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have the archive.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
More information about the Comp.sources.misc
mailing list