PDCurses 2.0
(Public Domain Curses for DOS and OS/2)
PDCurses is a public domain C library that is compatible with Unix
System V 3.2 curses written for most of the popular DOS and OS/2
C compilers.
PDCurses v2.0 is an almost total rewrite of PCCurses 1.4 done by John
'Frotz' Fa'atuai, the previous maintainer.
This version has been tested with Microsoft C v6.0, QuickC v2.0 and
Borland C++ 2.0 under DOS and Microsoft C v6.0 and TopSpeed c v3.02
under OS/2 2.0. Also the library has been compiled successfully with
emx 0.8e, C Set/2 and Watcom 9.
If you wish to be kept up-to-date with changes to PDCurses, contact
Robert Wolf at rw...@dretor.dciem.dnd.ca and ask to be placed on the
PDCurses mailing list.
----------------------------------------------------------------------
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: README curses.h demos doc flexos nonport portable
# portable/newterm.c private tools
# Wrapped by kent@sparky on Wed Nov 18 21:44:05 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 1 (of 11)."'
if test -f 'README' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(5305 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
X
X PDCurses 2.0
X (Public Domain Curses for DOS and OS/2)
X
X
XINTRODUCTION:
X
X Well, here it finally is; PDCurses v2.0.
X
X PDCurses v2.0 is an almost total rewrite of PCCurses 1.4 done by John
X 'Frotz' Fa'atuai, the previous maintainer.
X
X This version has been tested with Microsoft C v6.0, QuickC v2.0 and
X Borland C++ 2.0 under DOS and Microsoft C v6.0 and TopSpeed c v3.02
X under OS/2 2.0. Also the library has been compiled successfully with
X emx 0.8e, C Set/2 and Watcom 9.
X Most testing was done with the large memory model where applicable.
X The large memory model is probably the best model to use.
X
X The amount of testing has not been as extensive as I would have
X liked, but demands on releasing a product have outweighed the
X product's quality. Nothing new with that !!
X Hopefully with wider circulation, more bugs will be fixed more quickly.
X
X I have included just 1 makefile which is suitable for dmake 3.8 for
X both DOS and OS/2. The makefile does not rely on customisation of the
X dmake.ini file.
X
X If you discover bugs, and especially if you have fixes, please let me
X know ASAP.
X
X The source to the library is distributed as a zip file made with zip
X 1.9. You will need Info-ZIP unzip 5.0 to unzip.
X Follow the directions below to compile the library.
X
XDIRECTIONS:
X
X 1.Create a new directory in which to unzip pdcurs20.zip. This will
X create a curses directory and a number of subdirectories containing
X source code for the library and utilities and the documentation.
X
X 2.Make changes to the makefile where necessary:
X Change the MODEL or model macro to the appropriate value (if it
X applies to your compiler). Use model for Borland compilers.
X
X Change any paths in the defined macros to be suitable for your
X compiler.
X
X 3.Invoke DMAKE [-e environment_options] [target]
X
X where environment_options are:
X
X OS (host operating system)
X COMP (compiler)
X OPT (optimised version or debug version) - optional. default Y
X TOS (target operating system) - optional. default OS
X
X see the makefile for valid combinations
X
X targets: all, demos, lcursesd.lib, manual...
X
X NB. dmake is case sensitive with targets, so those environments
X that use an upper case model value (eg MSC) MUST specify the
X library target as for eg. Lcursesd.lib
X
X The makefile is by default set up for Borland C++. The use of
X -e environment_options override these defaults. Of you prefer
X you can just change the defaults in the makefile and invoke it
X without the -e switch.
X
XOTHER NOTES:
X
X The documentation for the library is built into each source file,
X a couple of specific doc files and the header files. A program is
X supplied (manext) to build the manual. This program gets compiled
X when you build the documentation.
X
X To generate the library response file correctly, I had to write a
X quick and dirty program (buildlrf) to achive this. Originally the
X makefiles just had statements like: "echo -+$(OBJ)\$* & >> $(LRF)"
X which appended a suitable line to the response file. Unfortunately
X under some combinations of makefiles and command processors (eg.
X nmake and 4DOS) the & would get treated as stderr and the echo
X command would fail.
X
X The original source for PDCurses that I received from the previous
X maintainer contained support for the FLEXOS operating system. Not
X having access to it, I could not test the changes I made so its
X support has fallen by the wayside. If you really need to have PDCurses
X running under FLEXOS, contact me and I will see what can be arranged.
X
XCOMPILER-SPECIFIC NOTES:
X
X Microsoft C
X -----------
X It is possible with MSC 6.0 to build the OS/2 libraries and demo
X programs from within DOS. This is the only case where it is possible
X to specifiy the value of TOS on the command line to be OS2 and the
X value of OS be DOS.
X
X C Set/2
X -------
X I have only tested the library using the migration libraries. I doubt
X that the demo programs will work without them.
X
X emx
X ---
X Testing has been done with 0.8e of emx together with the 16_to_32
X libraries.
X The emx\lib directory should include the vio32.lib and kbd32.lib
X libraries from the 16_to_32 package.
X
XBUGS and UNFINISHED BUSINESS:
X
X PDC_set_ctrl_break() function does not work under OS/2.
X wprint() and PDC_Print() do not work under OS/2.
X The file todo.man in the doc directory also lists those functions of
X System V 3.2 curses not yet implemented. Any volunteers ?
X
XACKNOWLEGEMENTS:
X
X John 'Frotz' Fa'atuai, the previous maintainer for providing an
X excellent base for further development.
X John Burnell (jo...@kea.am.dsir.govt.nz), for the OS/2 port.
X John Steele, Jason (finally NOT a John) Schumate....
X for various fixes and suggestions.
X Eberhardt Mattes (author of emx) for allowing code based on his
X C library to be included with PDCurses.
X Several others for their support, moral and actual.
X
X
XGood luck, Mark
X
X------------------------------------------------------------------------
XMark Hessling email: M.Hes...@itc.gu.edu.au
XDBA, ITS phone: + 61 7 875 7691
XGriffith University fax: + 61 7 875 7787
XNathan 4111
XQld Australia *** PDCurses maintainer ***
X------------------------------------------------------------------------
END_OF_FILE
if test 5305 -ne `wc -c <'README'`; then
echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'curses.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'curses.h'\"
else
echo shar: Extracting \"'curses.h'\" \(41892 characters\)
sed "s/^X//" >'curses.h' <<'END_OF_FILE'
X/* $Header: c:/curses/RCS/curses.h%v 2.0 1992/11/16 22:40:30 MH Rel $
X*----------------------------------------------------------------------
X* PDCurses
X*----------------------------------------------------------------------
X* MH
X* 921120 2.0 Changed #if to #ifdef/#if defined to make it
X* easier to add new platforms/compilers.
X*
X* Added System V colour support.
X*
X* Added OS/2 port.
X*-------
X* Frotz
X* 911221 2.0 pre-beta Changed back from short to int. (int is the
X* correct size for the default platform. Short
X* might be too short on some platforms. This
X* is more portable. I, also, made this mistake.)
X*
X* Many functions are now macros. If you want
X* the real thing, #undef the macro. (X/Open
X* requirement.)
X*
X* Merged many sources into current release.
X*
X* Added many X/Open routines (not quite all yet).
X*
X* Added internal documentation to all routines.
X*
X* Added a HISTORY file to the environment.
X*
X* Added a CONTRIB file to the environment.
X*-------
X* bl 900114 1.4 Window origin mod in overlay() and overwrite(), on
X* public (and very reasonable) request. Swapped
X* #define'd values of OK and ERR; OK now 1, and
X* ERR is 0/NULL. Conforms better to UNIX
X* versions. borderchars[] removed from WINDOW
X* struct since the border() functions were
X* redefined. Use of short wherever possible.
X* Portability improvements, mispelled name of
X* [w]setscrreg().
X*
X* 881005 1.3 All modules lint-checked with MSC '-W3' and
X* turbo'C' '-w -w-pro' switches. Support for
X* border(), wborder() functions.
X*
X* 881002 1.2 Rcsid[] string in all modules, for maintenance.
X*
X* 880306 1.1 'Raw' output routines, revision info in curses.h.
X*
X* 870515 1.0 Initial Release.
X*
X*----------------------------------------------------------------------
X*/
X
X#ifndef __PDCURSES__
X#define __PDCURSES__ 1
X
X/*man-start*********************************************************************
X
XAll defines are "defined" here. All compiler and environment
Xspecific definitions are defined into generic class defines.
XThese defines are to be given values so that the code can
Xrely on #if, rather than a complicated set of #if defined() or
X#ifdefs...
X
XPDCurses definitions list: (Only define those needed)
X
X REGISTERWINDOWS True for auto window update registery.
X FAST_VIDEO True if display is memory mapped, or
X we can utilize the fast video update routines.
X DOS True if compiling for DOS.
X OS2 True if compiling for OS/2.
X FLEXOS True if compiling for Flexos.
X HC True if using a Metaware compiler.
X TC True if using a Borland compiler.
X MSC True if using a Microsoft compiler.
X ANSI True if the compiler supports ANSI C and
X (full or mixed) prototypes.
X CPLUSPLUS True if the compiler supports C++.
X
XPDCurses portable platform definitions list:
X
X PDCurses Enables access to PDCurses-only routines.
X XOPEN Always true.
X SYSV True if you are compiling for SYSV portability.
X BSD True if you are compiling for BSD portability.
X INTERNAL Enables access to internal PDCurses routines.
X**man-end**********************************************************************/
X
X#define PDCURSES 1 /* PDCurses-only routines */
X#define XOPEN 1 /* X/Open Curses routines */
X#define SYSV 1 /* System V Curses routines */
X#define BSD 1 /* BSD Curses routines */
X#define INTERNAL 1 /* PDCurses Internal routines */
X
X
X/*----------------------------------------
X* BORLAND COMPILERS Turbo C[++], Borland C[++]
X*
X* Borland definitions:
X* TC
X* DOS
X* FLEXOS
X* CPLUSPLUS
X*
X* __TURBOC__ & __MSDOS__ are predefined by compiler.
X*/
X#ifdef __TURBOC__ /* Borland gives defines this as a value*/
X# define TC __TURBOC__ /* Define a value for TC */
X# define ANSI 1 /* Borland supports ANSI C prototypes */
X# ifdef __MSDOS__
X# define DOS 6 /* Major release of DOS supported */
X# include <bios.h>
X# include <dos.h>
X# endif
X# ifdef __FLEXOS__ /* define this on the command line */
X# define FLEXOS 2 /* or latest major release value. */
X# endif
X# if __TURBOC__ >= 0x290
X# ifdef __BCPLUSPLUS__
X# define CPLUSPLUS 1 /* Define that we are compiling C++. */
X# endif
X# ifdef __TCPLUSPLUS__
X# define CPLUSPLUS 1 /* Define that we are compiling C++. */
X# endif
X# ifdef __CPLUSPLUS__
X# define CPLUSPLUS 1 /* Define that we are compiling C++. */
X# endif
X# endif
X#endif
X
X
X/*----------------------------------------
X* METAWARE COMPILERS High C
X*
X* Metaware definitions:
X* HC
X* DOS
X* FLEXOS
X*/
X#ifdef __HIGHC__
X# define HC 1
X# pragma off(prototype_override_warnings)
X# define ANSI 1 /* Metaware supports ANSI C prototypes */
X# ifdef __MSDOS__
X# define DOS 6 /* Major release of DOS supported */
X# include <bios.h>
X# include <dos.h>
X# endif
X# ifdef __FLEXOS__ /* define this on the command line */
X# define FLEXOS 2 /* or latest major release value. */
X# endif
X#endif
X
X/*----------------------------------------
X* MICROSOFT COMPILERS MSC
X*
X* Microsoft definitions:
X* MSC
X* DOS || OS2
X*/
X#ifdef _MSC_VER /* defined by compiler */
X# define MSC 1
X# define ANSI 1 /* Microsoft supports ANSI C prototypes */
X# ifdef __OS2__ /* You will have to define in makefile */
X# define USE_OS2_H 1 /* Use the os2.h for the compiler */
X# define OS2 2 /* Major release of OS/2 supported */
X# define INCL_VIO
X# define INCL_KBD
X# include <os2.h>
X# define NO_VSSCANF 1 /* define if no vsscanf() function in library */
X# define FARKeyword far
X# define APIRET USHORT
X# undef MSDOS /* have to undef this for OS/2 */
X# endif
X# ifdef MSDOS /* defined by compiler (for both DOS and OS/2) */
X# define DOS 6 /* Major release of DOS supported */
X# include <bios.h>
X# include <dos.h>
X# define NO_VSSCANF 1 /* define if no vsscanf() function in library */
X# endif
X#endif
X
X/*----------------------------------------
X* TOPSPEED compilers TSC
X*
X* TOPSPEED definitions:
X* TSC
X* DOS || OS2
X*/
X#ifdef __TSC__ /* You may have to define in makefile */
X# define TSC 1
X# define ANSI 1 /* TopSpeed supports ANSI C prototypes */
X# ifdef __OS2__
X# define OS2 2 /* Major release of OS/2 supported */
X# include <cursos2.h>
X# endif
X#endif
X
X/*----------------------------------------
X* IBM C Set/2 Compiler CSET2
X*
X* IBM definitions:
X* CSET2
X* OS2
X*/
X#ifdef __IBMC__
X# define CSET2 1
X# define ANSI 1 /* C Set/2 supports ANSI C prototypes */
X# ifdef __OS2__
X# define OS2 2 /* Major release of OS/2 supported */
X# define NO_VSSCANF 1 /* define if no vsscanf() function in library */
X# define INCL_VIO
X# define INCL_KBD
X# include <os2.h>
X# endif
X#endif
X
X/*----------------------------------------
X* GNU compilers emx
X*
X* emx definitions:
X* EMX
X* OS2
X*/
X#ifdef __EMX__ /* You may have to define in makefile */
X# define EMX 1
X# define ANSI 1 /* GNU supports ANSI C prototypes */
X# ifdef __OS2__
X# define OS2 2 /* Major release of OS/2 supported */
X# define CURSES__32BIT__
X# include <cursos2.h>
X# endif
X#endif
X
X/*----------------------------------------
X* Watcom C/386 9.0X compiler
X*
X* WATCOM definitions:
X* WATCOMC
X* OS2
X*/
X#ifdef __WATCOMC__
X# define WATCOMC 1
X# define ANSI 1 /* Watcom C/386 supports ANSI C prototypes */
X# ifdef __OS2__
X# define OS2 2 /* Major release of OS/2 supported */
X# define CURSES__32BIT__
X# define NO_MEMORY_H /* this compiler does not have a memory.h */
X# define INCL_VIO
X# define INCL_KBD
X# include <os2.h>
X# endif
X#endif
X
X/*---------------------------------------------------------------------*/
X
X#include <stdio.h> /* Required by X/Open usage below */
X
X
X
X/*----------------------------------------------------------------------
X *
X * PDCurses Manifest Constants
X *
X */
X#ifndef FALSE /* booleans */
X# define FALSE 0
X#endif
X#ifndef TRUE /* booleans */
X# define TRUE !FALSE
X#endif
X#ifndef NULL
X# define NULL ((void*)0) /* Null pointer */
X#endif
X#define ERR 0 /* general error flag */
X#define OK 1 /* general OK flag */
X
X
X
X
X/*----------------------------------------------------------------------
X *
X * PDCurses Type Declarations
X *
X */
Xtypedef unsigned char bool; /* PDCurses Boolean type */
Xtypedef unsigned short chtype; /* 8-bit attr + 8-bit char */
X
X
X
X
X/*----------------------------------------------------------------------
X *
X * PDCurses Structure Definitions:
X *
X */
Xtypedef struct _win /* definition of a window. */
X{
X int _cury; /* current pseudo-cursor */
X int _curx;
X int _maxy; /* max window coordinates */
X int _maxx;
X int _pmaxy; /* max physical size */
X int _pmaxx;
X int _begy; /* origin on screen */
X int _begx;
X int _flags; /* window properties */
X chtype _attrs; /* standard A_STANDOUT attributes and colors */
X int _tabsize; /* tab character size */
X bool _clear; /* causes clear at next refresh */
X bool _leave; /* leaves cursor as it happens */
X bool _scroll; /* allows window scrolling */
X bool _nodelay; /* input character wait flag */
X bool _use_keypad; /* flags keypad key mode active */
X bool _use_idl; /* True if Ins/Del line can be used*/
X chtype**_y; /* pointer to line pointer array */
X int* _firstch; /* first changed character in line */
X int* _lastch; /* last changed character in line */
X int _tmarg; /* top of scrolling region */
X int _bmarg; /* bottom of scrolling region */
X chtype _borderchars[8];/* non-std border chars */
X char* _title; /* window title */
X char _title_ofs; /* window title offset from left */
X chtype _title_attr; /* window title attributes */
X chtype _blank; /* window's blank character */
Xstruct _win* _parent; /* subwin's pointer to parent win */
X} WINDOW;
X
X
X
X/*----------------------------------------------------------------------
X*
X* Private structures that are necessary for correct
X* macro construction.
X*
X*/
X
X#ifdef REGISTERWINDOWS
Xtypedef struct _ref /* Refresh Window Structure */
X{
X WINDOW* win;
Xstruct _ref* next;
Xstruct _ref* tail;
X} ACTIVE;
X
Xtypedef struct _wins
X{
X WINDOW* w; /* pointer to a visible window */
X struct _wins* next; /* Next visible window pointer */
X struct _wins* prev; /* Next visible window pointer */
X struct _wins* tail; /* Last visible window pointer */
X /* Only head window (stdscr) has */
X /* a valid tail pointer. */
X} WINDS;
X#endif
X
X
X
X
Xtypedef struct
X{
X bool alive; /* TRUE if already opened. */
X bool autocr; /* if lf -> crlf */
X bool cbreak; /* if terminal unbuffered */
X bool echo; /* if terminal echo */
X bool raw_inp; /* raw input mode (v. cooked input) */
X bool raw_out; /* raw output mode (7 v. 8 bits) */
X bool refrbrk; /* if premature refresh brk allowed */
X bool orgcbr; /* original MSDOS ^-BREAK setting */
X bool visible_cursor; /* TRUE if cursor is visible */
X bool audible; /* FALSE if the bell is visual */
X bool full_redraw; /* TRUE for bad performance */
X bool direct_video; /* Allow Direct Screen Memory writes*/
X bool mono; /* TRUE if current screen is mono. */
X bool sizeable; /* TRUE if adapter is resizeable. */
X bool bogus_adapter; /* TRUE if adapter has insane values*/
X bool shell; /* TRUE if reset_prog_mode() needs */
X /* to be called. */
X chtype blank; /* Background character */
X chtype orig_attr; /* Original screen attributes */
X int cursrow; /* position of physical cursor */
X int curscol; /* position of physical cursor */
X int cursor; /* Current Cursor definition */
X int video_page; /* Current PC video page */
X int orig_emulation; /* Original cursor emulation value */
X int orig_cursor; /* Original cursor size */
X int font; /* default font size */
X int orig_font; /* Original font size */
X int lines; /* New value for LINES */
X int cols; /* New value for COLS */
X int emalloc; /* 0x0C0C if initscr() is to reset */
X /* this value to TRUE; */
X /* TRUE only if emalloc()/ecalloc() */
X /* are is to be used; */
X /* FALSE if malloc()/calloc() are */
X /* to be used. */
X#ifdef OS2
X VIOMODEINFO scrnmode; /* default screen mode */
X VIOCONFIGINFO adapter; /* Screen type */
X#else
X int scrnmode; /* default screen mode */
X int adapter; /* Screen type */
X unsigned video_seg; /* video base segment */
X unsigned video_ofs; /* video base offset */
X#endif
X#ifdef REGISTERWINDOWS
X WINDS* visible; /* List of visible windows */
X bool refreshall; /* Refresh all registered windows? */
X#endif
X
X} SCREEN;
X
X
X
X
X
X/* external variables */
Xextern int LINES; /* terminal height */
Xextern int COLS; /* terminal width */
Xextern WINDOW* stdscr; /* the default screen window */
Xextern SCREEN _cursvar; /* curses variables */
X
X#if defined (INTERNAL) | defined (CURSES_LIBRARY)
Xextern WINDOW* curscr; /* the current screen image */
Xextern WINDOW* tmpwin; /* the temporary screen image */
Xextern int _default_lines; /* For presetting maximum lines */
X#endif
X
X#ifdef REGISTERWINDOWS
Xextern ACTIVE* CurWins; /* Currently Visible Windows */
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
XPDCurses Text Attributes:
X
XTo include colour in PDCurses, a number of things had to be sacrificed
Xfrom the strict Unix and System V support.
XThe main problem is fitting all character attributes and colour into
Xan unsigned char (all 8 bits!). On System V, chtype is a long on
XPDCurses it is a short int.
X
XThe following is the structure of a win->_attrs chtype:
X
X-------------------------------------------------
X|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
X-------------------------------------------------
X colour number | attrs | character eg 'a'
X
Xthe high order char is an index into an array of physical colours
X(defined in INITPAIR.c). 32 (5 bits) foreground/background colour
Xcombinations combined with 8 (3 bits) attribute modifiers are
Xavailable.
X
XThe available attribute enhancers are bold, reverse and blink.
XAll other Unix attributes have no effect as attributes. This
Xlimitation may be overcome in future releases by expanding chtype
Xto a long.
X
X**man-end**********************************************************************/
X
X/* Video attribute definitions. */
X#define A_NORMAL (chtype)0x0000 /* SysV */
X#define A_ALTCHARSET (chtype)0x0000 /* X/Open */
X#define A_BLINK (chtype)0x0400 /* X/Open */
X#define A_BLANK (chtype)0x0000 /* X/Open */
X#define A_BOLD (chtype)0x0100 /* X/Open */
X#define A_DIM (chtype)0x0000 /* X/Open */
X#define A_PROTECT (chtype)0x0000 /* X/Open */
X#define A_REVERSE (chtype)0x0200 /* X/Open */
X#define A_STANDOUT ((chtype)(A_REVERSE | A_BOLD)) /* X/Open */
X#define A_UNDERLINE (chtype)0x0000 /* X/Open */
X#define A_COLOR (chtype)0xF800 /*System V */
X
X#define CHR_MSK (chtype)(0xFF) /* Obsolete */
X#define ATR_MSK (chtype)(~CHR_MSK) /* Obsolete */
X#define ATR_NRM A_NORMAL /* Obsolete */
X#define A_CHARTEXT CHR_MSK /* X/Open */
X#define A_ATTRIBUTES ATR_MSK /* X/Open */
X
X/* ALTCHARSET definitions from jshu...@logds1.wr.aflc.af.mil */
X#define ACS_ULCORNER (chtype)0xda /* SysV */
X#define ACS_LLCORNER (chtype)0xc0 /* SysV */
X#define ACS_URCORNER (chtype)0xbf /* SysV */
X#define ACS_LRCORNER (chtype)0xd9 /* SysV */
X#define ACS_RTEE (chtype)0xb4 /* SysV */
X#define ACS_LTEE (chtype)0xc3 /* SysV */
X#define ACS_BTEE (chtype)0xc1 /* SysV */
X#define ACS_TTEE (chtype)0xc2 /* SysV */
X#define ACS_HLINE (chtype)0xc4 /* SysV */
X#define ACS_VLINE (chtype)0xb3 /* SysV */
X#define ACS_PLUS (chtype)0xc5 /* SysV */
X#define ACS_S1 (chtype)0x2d /* SysV */
X#define ACS_S9 (chtype)0x5f /* SysV */
X#define ACS_DIAMOND (chtype)0xc5 /* SysV */
X#define ACS_CKBOARD (chtype)0xb2 /* SysV */
X#define ACS_DEGREE (chtype)0xf8 /* SysV */
X#define ACS_PLMINUS (chtype)0xf1 /* SysV */
X#define ACS_BULLET (chtype)0xf9 /* SysV */
X#define ACS_LARROW (chtype)0x3c /* SysV */
X#define ACS_RARROW (chtype)0x3e /* SysV */
X#define ACS_DARROW (chtype)0x76 /* SysV */
X#define ACS_UARROW (chtype)0x5e /* SysV */
X#define ACS_BOARD (chtype)0x23 /* SysV */
X#define ACS_LANTERN (chtype)0x23 /* SysV */
X#define ACS_BLOCK (chtype)0x23 /* SysV */
X
X/* the following definitions can be used if you have set raw_output()
X or are using the PDCurses *raw*() functions */
X#if 0
X#define ACS_DIAMOND (chtype)0x04 /* SysV */
X#define ACS_LARROW (chtype)0x1b /* SysV */
X#define ACS_RARROW (chtype)0x1a /* SysV */
X#define ACS_DARROW (chtype)0x19 /* SysV */
X#define ACS_UARROW (chtype)0x18 /* SysV */
X#define ACS_BOARD (chtype)0xb0 /* SysV */
X#define ACS_LANTERN (chtype)0x0f /* SysV */
X#define ACS_BLOCK (chtype)0xdb /* SysV */
X#endif
X
X/* colour attributes */
X#define COLOR_BLACK 0
X#define COLOR_BLUE 1
X#define COLOR_GREEN 2
X#define COLOR_CYAN 3
X#define COLOR_RED 4
X#define COLOR_MAGENTA 5
X#define COLOR_YELLOW 6
X#define COLOR_WHITE 7
X
X#define COLOR_PAIR(n) (((n) << 11) & A_ATTRIBUTES)
X#define PAIR_NUMBER(n) (((n) & A_COLOR) >> 11)
X
Xextern int COLORS,COLOR_PAIRS;
X/*----------------------------------------------------------------------
X *
X * Function and Keypad Key Definitions.
X * Many are just for compatibility.
X *
X */
X#define KEY_MIN 0x101 /* Minimum curses key value */
X#define KEY_BREAK 0x101 /* Not on PC KBD */
X#define KEY_DOWN 0x102 /* Down arrow key */
X#define KEY_UP 0x103 /* Up arrow key */
X#define KEY_LEFT 0x104 /* Left arrow key */
X#define KEY_RIGHT 0x105 /* Right arrow key */
X#define KEY_HOME 0x106 /* home key */
X#define KEY_BACKSPACE 0x107 /* not on pc */
X#define KEY_F0 0x108 /* function keys. space for */
X#define KEY_F(n) (KEY_F0+(n))/* 64 keys are reserved. */
X#define KEY_DL 0x148 /* not on pc */
X#define KEY_IL 0x149 /* insert line */
X#define KEY_DC 0x14a /* delete character */
X#define KEY_IC 0x14b /* insert char or enter ins mode */
X#define KEY_EIC 0x14c /* exit insert char mode */
X#define KEY_CLEAR 0x14d /* clear screen */
X#define KEY_EOS 0x14e /* clear to end of screen */
X#define KEY_EOL 0x14f /* clear to end of line */
X#define KEY_SF 0x150 /* scroll 1 line forward */
X#define KEY_SR 0x151 /* scroll 1 line back (reverse) */
X#define KEY_NPAGE 0x152 /* next page */
X#define KEY_PPAGE 0x153 /* previous page */
X#define KEY_STAB 0x154 /* set tab */
X#define KEY_CTAB 0x155 /* clear tab */
X#define KEY_CATAB 0x156 /* clear all tabs */
X#define KEY_ENTER 0x157 /* enter or send (unreliable) */
X#define KEY_SRESET 0x158 /* soft/reset (partial/unreliable)*/
X#define KEY_RESET 0x159 /* reset/hard reset (unreliable) */
X#define KEY_PRINT 0x15a /* print/copy */
X#define KEY_LL 0x15b /* home down/bottom (lower left) */
X#define KEY_ABORT 0x15c /* abort/terminate key (any) */
X#define KEY_SHELP 0x15d /* short help */
X#define KEY_LHELP 0x15e /* long help */
X#define KEY_BTAB 0x15f /* Back tab key */
X#define KEY_BEG 0x160 /* beg(inning) key */
X#define KEY_CANCEL 0x161 /* cancel key */
X#define KEY_CLOSE 0x162 /* close key */
X#define KEY_COMMAND 0x163 /* cmd (command) key */
X#define KEY_COPY 0x164 /* copy key */
X#define KEY_CREATE 0x165 /* create key */
X#define KEY_END 0x166 /* end key */
X#define KEY_EXIT 0x167 /* exit key */
X#define KEY_FIND 0x168 /* find key */
X#define KEY_HELP 0x169 /* help key */
X#define KEY_MARK 0x16a /* mark key */
X#define KEY_MESSAGE 0x16b /* message key */
X#define KEY_MOVE 0x16c /* move key */
X#define KEY_NEXT 0x16d /* next object key */
X#define KEY_OPEN 0x16e /* open key */
X#define KEY_OPTIONS 0x16f /* options key */
X#define KEY_PREVIOUS 0x170 /* previous object key */
X#define KEY_REDO 0x171 /* redo key */
X#define KEY_REFERENCE 0x172 /* ref(erence) key */
X#define KEY_REFRESH 0x173 /* refresh key */
X#define KEY_REPLACE 0x174 /* replace key */
X#define KEY_RESTART 0x175 /* restart key */
X#define KEY_RESUME 0x176 /* resume key */
X#define KEY_SAVE 0x177 /* save key */
X#define KEY_SBEG 0x178 /* shifted beginning key */
X#define KEY_SCANCEL 0x179 /* shifted cancel key */
X#define KEY_SCOMMAND 0x17a /* shifted command key */
X#define KEY_SCOPY 0x17b /* shifted copy key */
X#define KEY_SCREATE 0x17c /* shifted create key */
X#define KEY_SDC 0x17d /* shifted delete char key */
X#define KEY_SDL 0x17e /* shifted delete line key */
X#define KEY_SELECT 0x17f /* select key */
X#define KEY_SEND 0x180 /* shifted end key */
X#define KEY_SEOL 0x181 /* shifted clear line key */
X#define KEY_SEXIT 0x182 /* shifted exit key */
X#define KEY_SFIND 0x183 /* shifted find key */
X#define KEY_SHOME 0x184 /* shifted home key */
X#define KEY_SIC 0x185 /* shifted input key */
X#define KEY_SLEFT 0x187 /* shifted left arrow key */
X#define KEY_SMESSAGE 0x188 /* shifted message key */
X#define KEY_SMOVE 0x189 /* shifted move key */
X#define KEY_SNEXT 0x18a /* shifted next key */
X#define KEY_SOPTIONS 0x18b /* shifted options key */
X#define KEY_SPREVIOUS 0x18c /* shifted prev key */
X#define KEY_SPRINT 0x18d /* shifted print key */
X#define KEY_SREDO 0x18e /* shifted redo key */
X#define KEY_SREPLACE 0x18f /* shifted replace key */
X#define KEY_SRIGHT 0x190 /* shifted right arrow */
X#define KEY_SRSUME 0x191 /* shifted resume key */
X#define KEY_SSAVE 0x192 /* shifted save key */
X#define KEY_SSUSPEND 0x193 /* shifted suspend key */
X#define KEY_SUNDO 0x194 /* shifted undo key */
X#define KEY_SUSPEND 0x195 /* suspend key */
X#define KEY_UNDO 0x196 /* undo key */
X
X/* PDCurses specific key definitions */
X
X#define ALT_0 0x197 /* Alt-0 PC only */
X#define ALT_1 0x198 /* Alt-1 PC only */
X#define ALT_2 0x199 /* Alt-2 PC only */
X#define ALT_3 0x19a /* Alt-3 PC only */
X#define ALT_4 0x19b /* Alt-4 PC only */
X#define ALT_5 0x19c /* Alt-5 PC only */
X#define ALT_6 0x19d /* Alt-6 PC only */
X#define ALT_7 0x19e /* Alt-7 PC only */
X#define ALT_8 0x19f /* Alt-8 PC only */
X#define ALT_9 0x1a0 /* Alt-9 PC only */
X#define ALT_A 0x1a1 /* Alt-A PC only */
X#define ALT_B 0x1a2 /* Alt-B PC only */
X#define ALT_C 0x1a3 /* Alt-C PC only */
X#define ALT_D 0x1a4 /* Alt-D PC only */
X#define ALT_E 0x1a5 /* Alt-E PC only */
X#define ALT_F 0x1a6 /* Alt-F PC only */
X#define ALT_G 0x1a7 /* Alt-G PC only */
X#define ALT_H 0x1a8 /* Alt-H PC only */
X#define ALT_I 0x1a9 /* Alt-I PC only */
X#define ALT_J 0x1aa /* Alt-J PC only */
X#define ALT_K 0x1ab /* Alt-K PC only */
X#define ALT_L 0x1ac /* Alt-L PC only */
X#define ALT_M 0x1ad /* Alt-M PC only */
X#define ALT_N 0x1ae /* Alt-N PC only */
X#define ALT_O 0x1af /* Alt-O PC only */
X#define ALT_P 0x1b0 /* Alt-P PC only */
X#define ALT_Q 0x1b1 /* Alt-Q PC only */
X#define ALT_R 0x1b2 /* Alt-R PC only */
X#define ALT_S 0x1b3 /* Alt-S PC only */
X#define ALT_T 0x1b4 /* Alt-T PC only */
X#define ALT_U 0x1b5 /* Alt-U PC only */
X#define ALT_V 0x1b6 /* Alt-V PC only */
X#define ALT_W 0x1b7 /* Alt-W PC only */
X#define ALT_X 0x1b8 /* Alt-X PC only */
X#define ALT_Y 0x1b9 /* Alt-Y PC only */
X#define ALT_Z 0x1ba /* Alt-Z PC only */
X#define CTL_LEFT 0x1bb /* Control-Left-Arrow PC only */
X#define CTL_RIGHT 0x1bc /* Control-Right-Arrow PC only */
X#define CTL_PGUP 0x1bd /* Control-PgUp PC only */
X#define CTL_PGDN 0x1be /* Control-PgDn PC only */
X#define CTL_HOME 0x1bf /* Control-Home PC only */
X#define CTL_END 0x1c0 /* Control-End PC only */
X#define KEY_BACKTAB 0x1c1 /* Back-tab PC only */
X
X#ifdef FLEXOS
X#define KEY_A1 KEY_HOME/* upper left on Virtual keypad */
X#define KEY_A2 KEY_UP /* upper middle on Virt. keypad */
X#define KEY_A3 KEY_PPAGE/* upper right on Vir. keypad */
X#define KEY_B1 KEY_LEFT/* middle left on Virt. keypad */
X#define KEY_B2 0x00 /* center on Virt. keypad */
X#define KEY_B3 KEY_RIGHT/* middle right on Vir. keypad */
X#define KEY_C1 KEY_LL /* lower left on Virt. keypad */
X#define KEY_C2 KEY_DOWN /* lower middle on Virt. keypad */
X#define KEY_C3 KEY_NPAGE /* lower right on Vir. keypad */
X#define KEY_MAX KEY_BACKTAB /* Maximum curses key */
X#endif
X
X
X#if defined(DOS) || defined (OS2)
X#define KEY_A1 0x1c2 /* upper left on Virtual keypad */
X#define KEY_A2 0x1c3 /* upper middle on Virt. keypad */
X#define KEY_A3 0x1c4 /* upper right on Vir. keypad */
X#define KEY_B1 0x1c5 /* middle left on Virt. keypad */
X#define KEY_B2 0x1c6 /* center on Virt. keypad */
X#define KEY_B3 0x1c7 /* middle right on Vir. keypad */
X#define KEY_C1 0x1c8 /* lower left on Virt. keypad */
X#define KEY_C2 0x1c9 /* lower middle on Virt. keypad */
X#define KEY_C3 0x1ca /* lower right on Vir. keypad */
X#define PADSLASH 0x1cb /* slash on keypad */
X#define PADENTER 0x1cc /* enter on keypad */
X#define CTL_PADENTER 0x1cd /* ctl-enter on keypad */
X#define ALT_PADENTER 0x1ce /* alt-enter on keypad */
X#define SHF_PADSTOP 0x1cf /* shift-stop on keypad */
X#define PADSTAR 0x1d0 /* star on keypad */
X#define PADMINUS 0x1d1 /* minus on keypad */
X#define PADPLUS 0x1d2 /* plus on keypad */
X#define CTL_PADSTOP 0x1d3 /* ctl-stop on keypad */
X#define CTL_PADCENTER 0x1d4 /* ctl-enter on keypad */
X#define CTL_PADPLUS 0x1d5 /* ctl-plus on keypad */
X#define CTL_PADMINUS 0x1d6 /* ctl-minus on keypad */
X#define CTL_PADSLASH 0x1d7 /* ctl-slash on keypad */
X#define CTL_PADSTAR 0x1d8 /* ctl-star on keypad */
X#define ALT_PADPLUS 0x1d9 /* alt-plus on keypad */
X#define ALT_PADMINUS 0x1da /* alt-minus on keypad */
X#define ALT_PADSLASH 0x1db /* alt-slash on keypad */
X#define ALT_PADSTAR 0x1dc /* alt-star on keypad */
X#define CTL_INS 0x1dd /* ctl-insert */
X#define ALT_DEL 0x1de /* alt-delete */
X#define ALT_INS 0x1df /* alt-insert */
X#define CTL_UP 0x1e0 /* ctl-up arrow */
X#define CTL_DOWN 0x1e1 /* ctl-down arrow */
X#define CTL_TAB 0x1e2 /* ctl-tab */
X#define ALT_TAB 0x1e3 /* alt-tab */
X#define ALT_MINUS 0x1e4 /* alt-minus */
X#define ALT_EQUAL 0x1e5 /* alt-equal */
X#define ALT_HOME 0x1e6 /* alt-home */
X#define ALT_PGUP 0x1e7 /* alt-pgup */
X#define ALT_PGDN 0x1e8 /* alt-pgdn */
X#define ALT_END 0x1e9 /* alt-end */
X#define ALT_UP 0x1ea /* alt-up arrow */
X#define ALT_DOWN 0x1eb /* alt-down arrow */
X#define ALT_RIGHT 0x1ec /* alt-right arrow */
X#define ALT_LEFT 0x1ed /* alt-left arrow */
X#define ALT_ENTER 0x1ee /* alt-enter */
X#define ALT_ESC 0x1ef /* alt-escape */
X#define ALT_BQUOTE 0x1f0 /* alt-back quote */
X#define ALT_LBRACKET 0x1f1 /* alt-left bracket */
X#define ALT_RBRACKET 0x1f2 /* alt-right bracket */
X#define ALT_SEMICOLON 0x1f3 /* alt-semi-colon */
X#define ALT_FQUOTE 0x1f4 /* alt-forward quote */
X#define ALT_COMMA 0x1f5 /* alt-comma */
X#define ALT_STOP 0x1f6 /* alt-stop */
X#define ALT_FSLASH 0x1f7 /* alt-forward slash */
X#define ALT_BKSP 0x1f8 /* alt-backspace */
X#define CTL_BKSP 0x1f9 /* ctl-backspace */
X#define CTL_PAD0 0x1fa /* ctl-keypad 0 */
X#define CTL_PAD1 0x1fb /* ctl-keypad 1 */
X#define CTL_PAD2 0x1fc /* ctl-keypad 2 */
X#define CTL_PAD3 0x1fd /* ctl-keypad 3 */
X#define CTL_PAD4 0x1fe /* ctl-keypad 4 */
X#define CTL_PAD5 0x1ff /* ctl-keypad 5 */
X#define CTL_PAD6 0x200 /* ctl-keypad 6 */
X#define CTL_PAD7 0x201 /* ctl-keypad 7 */
X#define CTL_PAD8 0x202 /* ctl-keypad 8 */
X#define CTL_PAD9 0x203 /* ctl-keypad 9 */
X#define CTL_DEL 0x204 /* clt-delete */
X#define ALT_BSLASH 0x205 /* alt-back slash */
X#define CTL_ENTER 0x206 /* ctl-enter */
X#define KEY_MAX CTL_ENTER /* Maximum curses key */
X#endif
X
X
X
X/*----------------------------------------------------------------------
X* PDCurses function declarations
X*/
X#ifdef ANSI
X# ifdef CPLUSPLUS
X extern "C" {
X# endif
Xbool typeahead( FILE* );
Xchar erasechar( void );
Xchar killchar( void );
Xchar wordchar( void );
Xchar* longname( void );
Xchar* unctrl( chtype );
Xint baudrate( void );
Xint beep( void );
Xint border( chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype );
Xint can_change_color ( void );
Xint clearok( WINDOW*, bool );
Xint color_content( int, short*, short*, short* );
Xint def_prog_mode( void );
Xint def_shell_mode( void );
Xint delwin( WINDOW* );
Xint delay_output( int );
Xint doupdate( void );
Xint endwin( void );
Xint flash( void );
Xint flushinp( void );
Xint has_colors( void );
Xint init_color( int, short, short, short );
Xint init_pair( int, short, short );
Xint intrflush( WINDOW*, bool );
Xchar * keyname( int );
Xint mvaddrawch( int, int, chtype );
Xint mvaddrawstr( int, int, char* );
Xint mvcur( int, int, int, int );
Xint mvinsrawch( int, int, chtype );
Xint mvprintw( int, int, char*,... );
Xint mvwin( WINDOW*, int, int );
Xint mvwinsrawch( WINDOW*, int, int, chtype );
Xint mvwprintw( WINDOW*, int, int, char*,... );
Xint newline( WINDOW*, int );
Xint noraw( void );
Xint overlay( WINDOW*, WINDOW* );
Xint overwrite( WINDOW*, WINDOW* );
Xint pair_content( int, short*, short* );
Xint pnoutrefresh( WINDOW*, int, int, int, int, int, int );
Xint prefresh( WINDOW*, int, int, int, int, int, int );
Xint printw( char*,... );
Xint raw( void );
Xint refresh( void );
Xint resetterm( void );
Xint resetty( void );
Xint reset_prog_mode( void );
Xint reset_shell_mode( void );
Xint saveoldterm( void );
Xint saveterm( void );
Xint savetty( void );
Xint scroll( WINDOW* );
Xint start_color( void );
Xint tabsize( int );
Xint touchline( WINDOW*, int ,int );
Xint touchwin( WINDOW* );
Xint waddrawstr( WINDOW*, char* );
Xint waddstr( WINDOW*, char* );
Xint wattroff( WINDOW*, int );
Xint wattron( WINDOW*, int );
Xint wattrset( WINDOW*, int );
Xint wborder( WINDOW*, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype );
Xint wbox( WINDOW*, int, int, int, int, chtype, chtype );
Xint wclrtobot( WINDOW* );
Xint wclrtoeol( WINDOW* );
Xint wdelch( WINDOW* );
Xint wdeleteln( WINDOW* );
Xint werase( WINDOW* );
Xint wgetch( WINDOW* );
Xint wgetstr( WINDOW*, char* );
Xint winsch( WINDOW*, chtype );
Xint winsertln( WINDOW* );
Xint wmove( WINDOW*, int, int );
Xint wnoutrefresh( WINDOW* );
Xint wprintw( WINDOW*, char*,... );
Xint wrefresh( WINDOW* );
Xint wsetscrreg( WINDOW*, int, int );
Xint wtabsize( WINDOW*, int );
Xint wungetch( chtype );
XSCREEN* newterm( char*, FILE*, FILE* );
XSCREEN* set_term( SCREEN* );
XWINDOW* initscr( void );
XWINDOW* newpad( int, int );
XWINDOW* newwin( int, int, int, int );
XWINDOW* subwin( WINDOW*, int, int, int, int );
Xint meta( WINDOW*, bool );
Xint gettmode( void );
Xint fixterm( void );
Xint cursoff( void );
Xint curson( void );
Xint curs_set( int );
X
X#ifdef PDCURSES
Xint resize( int );
Xint win_print( WINDOW*, int );
XWINDOW* resize_win( WINDOW*, int, int );
Xint raw_output( bool );
X#endif
X
Xint scanw( char*,... );
Xint mvscanw( int, int, char*,... );
Xint mvwscanw( WINDOW*, int, int, char*,... );
Xint wscanw( WINDOW*, char*,... );
X
X/*
X* Keep the compiler happy with our macros below...
X*/
Xint PDC_chadd( WINDOW*, chtype, bool, bool );
Xint PDC_chins( WINDOW*, chtype, bool );
X
X# ifdef CPLUSPLUS
X }
X# endif
X#endif
X
X
X
X/*
X* Functions defined as macros
X*/
X#ifndef max
X#define max(a,b) (((a) > (b)) ? (a) : (b))
X#endif
X#ifndef min
X#define min(a,b) (((a) < (b)) ? (a) : (b))
X#endif
X
X
X#define addch( c ) waddch( stdscr, c )
X#define addstr(str) waddstr( stdscr, str )
X#define attroff(attr) wattroff( stdscr, (chtype)attr )
X#define attron(attr) wattron( stdscr, (chtype)attr )
X#define attrset(attr) wattrset( stdscr, (chtype)attr )
X#define box( w, v, h ) wbox( w, 0, 0, 0, 0, v, h )
X#define can_change_color() FALSE
X#define cbreak() (_cursvar.cbreak = TRUE)
X#define clear() (clearok( stdscr, TRUE )==ERR?ERR:wclear( stdscr ))
X#define clrtobot() wclrtobot( stdscr )
X#define clrtoeol() wclrtoeol( stdscr )
X#define crmode() (_cursvar.cbreak = TRUE)
X#define delch() wdelch( stdscr )
X#define deleteln() wdeleteln( stdscr )
X#define erase() werase( stdscr )
X#define getch() wgetch(stdscr)
X#define getstr(str) wgetstr( stdscr, str )
X#define getyx(w,y,x) ( y = (w)->_cury, x = (w)->_curx )
X#define getbegyx(w,y,x) ( y = (w)->_begy, x = (w)->_begx )
X#define getmaxyx(w,y,x) ( y = (w)->_maxy, x = (w)->_maxx )
X#define has_colors() ((_cursvar.mono) ? FALSE : TRUE)
X#define has_ic() TRUE
X#define has_il() TRUE
X#define idlok() OK
X#define inch() (stdscr->_y[stdscr->_cury][stdscr->_curx])
X#define insch( c ) winsch( stdscr, c )
X#define insertln() winsertln( stdscr )
X#define isendwin() ((_cursvar.alive) ? FALSE : TRUE)
X#define keypad(w,flag) (w->_use_keypad = flag)
X#define leaveok(w,flag) (w->_leave = flag)
X#define move(y,x) wmove( stdscr, y, x )
X#define mvaddch(y,x,c) (move( y, x )==ERR?ERR:addch( c ))
X#define mvaddstr(y,x,str) (move( y, x )==ERR?ERR:addstr( str ))
X#define mvdelch(y,x) (move( y, x )==ERR?ERR:wdelch( stdscr ))
X#define mvgetch(y,x) (move( y, x )==ERR?ERR:wgetch(stdscr))
X#define mvgetstr(y,x,str) {move( y, x )==ERR?ERR:wgetstr( stdscr, str ))
X#define mvinch(y,x) (wmove(stdscr,y,x)==ERR?ERR:(w->_y[y][x]))
X#define mvinsch(y,x,c) (move( y, x )==ERR?ERR:winsch( stdscr, c ))
X#define mvwaddch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddch( w, c ))
X#define mvwaddstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:waddstr( w, str ))
X#define mvwaddrawch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddrawch( w, c ))
X#define mvwaddrawstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:waddrawstr( w, str ))
X#define mvwdelch(w,y,x) (wmove( w, y, x )==ERR?ERR:wdelch( w ))
X#define mvwgetch(w,y,x) (wmove( w, y, x )==ERR?ERR:wgetch( w ))
X#define mvwgetstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:wgetstr( w, str ))
X#define mvwinch(w,y,x) (wmove(w,y,x)==ERR?ERR:(w->_y[y][x]))
X#define mvwinsch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:winsch( w, c ))
X#define napms(ms) delay_output(ms)
X#define nl() (_cursvar.autocr = TRUE)
X#define nocbreak() (_cursvar.cbreak = FALSE)
X#define nocrmode() (_cursvar.cbreak = FALSE)
X#define nodelay(w,flag) (w->_nodelay = flag)
X#define noecho() (_cursvar.echo = FALSE)
X#define echo() (_cursvar.echo = TRUE)
X#define nonl() (_cursvar.autocr = FALSE)
X#define refrbrk(flag) (_cursvar.refrbrk = flag)
X#define refresh() wrefresh( stdscr )
X#define scrollok(w,flag) (w->_scroll = flag)
X#define setscrreg(top, bot) wsetscrreg( stdscr, top, bot )
X#define standend() wstandend( stdscr )
X#define standout() wstandout( stdscr )
X#define ungetch(c) wungetch(c)
X#define waddch(w, c) PDC_chadd( w, (chtype)c, (bool)!(_cursvar.raw_out), TRUE )
X#define wclear(w) ( werase( w )==ERR?ERR:(w->_clear = TRUE))
X#define winch(w) (w->_y[w->_cury][w->_curx])
X#define wstandend(w) (wattroff(w, A_STANDOUT)==ERR?ERR:(w->_attrs = 0))
X#define wstandout(w) wattrset(w, A_STANDOUT);
X#define echochar(c) (addch((chtype)c)==ERR?ERR:refresh())
X#define wechochar(w,c) (waddch(w,(chtype)c)==ERR?ERR:wrefresh(w))
X#define pechochar(w,c) (waddch(w,(chtype)c)==ERR?ERR:prefresh(w))
X
X#ifdef PDCURSES
X#define addrawch( c ) waddrawch( stdscr, c )
X#define addrawstr(str) waddrawstr( stdscr, str )
X#define insrawch( c ) winsrawch( stdscr, c )
X#define waddrawch(w, c) PDC_chadd( w, (chtype)c, FALSE, TRUE )
X#define winsrawch(w, c) PDC_chins( w, (chtype)c, FALSE )
X
X/*
X * FYI: Need to document these functions...
X */
X#define title(s,a) wtitle( stdscr, s, (chtype)a )
X#define titleofs(ofs) wtitleofs( stdscr, ofs )
X#define wtitle(w,s,a) (w->_title = s, w->_title_attr = (chtype)a)
X#define wtitleofs(w,ofs) (w->_title_ofs = ofs)
X#endif
X
X/*
X * Load up curspriv.h. This should be in the same place as
X * curses.h. We allow anyone who defines CURSES_LIBRARY to have
X * access to our internal routines. This provides quick
X * PC applications at the expense of portability.
X */
X#if defined (CURSES_LIBRARY) | defined( INTERNAL)
X# include <curspriv.h>
X# include <stdlib.h>
X#endif
X
X#endif /* __PDCURSES__ */
END_OF_FILE
if test 41892 -ne `wc -c <'curses.h'`; then
echo shar: \"'curses.h'\" unpacked with wrong size!
fi
# end of 'curses.h'
fi
if test ! -d 'demos' ; then
echo shar: Creating directory \"'demos'\"
mkdir 'demos'
fi
if test ! -d 'doc' ; then
echo shar: Creating directory \"'doc'\"
mkdir 'doc'
fi
if test ! -d 'flexos' ; then
echo shar: Creating directory \"'flexos'\"
mkdir 'flexos'
fi
if test ! -d 'nonport' ; then
echo shar: Creating directory \"'nonport'\"
mkdir 'nonport'
fi
if test ! -d 'portable' ; then
echo shar: Creating directory \"'portable'\"
mkdir 'portable'
fi
if test -f 'portable/newterm.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/newterm.c'\"
else
echo shar: Extracting \"'portable/newterm.c'\" \(3226 characters\)
sed "s/^X//" >'portable/newterm.c' <<'END_OF_FILE'
X#include <stdlib.h>
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef newterm
X
X#ifndef NDEBUG
Xchar *rcsid_newterm = "$Header: c:/curses/portable/RCS/newterm.c%v 2.0 1992/11/15 03:29:03 MH Rel $";
X#endif
X
X#if EMALLOC
Xvoid* emalloc( size_t );
Xvoid* ecalloc( size_t, size_t );
Xvoid efree( void* );
X#endif
X
X
X
X
X#if 0
X/*man-start*********************************************************************
X
X newterm() - open new terminal
X
X X/Open Description:
X A program which outputs to more than one terminal should use
X for each terminal instead of initscr(). The newterm() function
X should be called once for each terminal. It returns a value of
X type SCREEN* which should be saved as a reference to that terminal.
X The arguments are the type of of terminal to be used in place of
X TERM (environment variable), a file pointer for output to the
X terminal and another file pointer for input from the terminal. The
X program must also call endwin() for each terminal no longer being
X used.
X
X PDCurses Description:
X This routine is a quick hack. It is basically a copy of initscr()
X with the appropriate arguments being passed. There is no formal
X support yet for dual monitor systems. This is almost, but not
X quiet, a NOP.
X
X outfd and infd are ignored, but required for portability.
X
X X/Open Return Value:
X The newterm() function returns stdscr on success otherwise ERR is
X returned.
X
X X/Open Errors:
X No errors are defined for this function.
X
X PDCurses Errors:
X It is an error to open the same SCREEN more than once.
X
X Portability:
X PDCurses SCREEN* newtern( char* type, FILE outfd, FILE infd );
X X/Open Dec '88 SCREEN* newtern( char* type, FILE outfd, FILE infd );
X BSD Curses
X SYS V Curses SCREEN* newtern( char* type, FILE outfd, FILE infd );
X
X**man-end**********************************************************************/
X
XSCREEN* newterm( char *type, FILE *outfd, FILE *infd )
X{
X#ifdef TC
X# pragma argsused
X#endif
Xextern void* mallc(); /* malloc(size) */
Xextern void* callc(); /* calloc(num,size) */
Xextern void fre(); /* free(ptr) */
X
Xextern void* malloc();
Xextern void* calloc();
Xextern void free();
X
X if (_cursvar.alive)
X return( ERR );
X
X if (_cursvar.emalloc == EMALLOC_MAGIC)
X {
X#if EMALLOC
X memset(&_cursvar, 0, sizeof(SCREEN));
X _cursvar.emalloc = TRUE;
X mallc = emalloc;
X callc = ecalloc;
X fre = efree;
X#endif
X }
X else
X {
X memset(&_cursvar, 0, sizeof(SCREEN));
X mallc = malloc;
X callc = calloc;
X fre = free;
X }
X PDC_scr_open(&_cursvar, 0);
X _cursvar.orig_cursor = _cursvar.cursor;
X _cursvar.orig_font = PDC_get_font();
X _cursvar.orgcbr = PDC_get_ctrl_break();
X _cursvar.blank = ' ';
X#ifdef FLEXOS
X _flexos_16bitmode();
X#endif
X savetty();
X LINES = PDC_get_rows();
X COLS = PDC_get_columns();
X
X if ((tmpwin = newwin(LINES, COLS, 0, 0)) == (WINDOW *) ERR)
X {
X return( ERR );
X }
X if ((curscr = newwin(LINES, COLS, 0, 0)) == (WINDOW *) ERR)
X {
X return( ERR );
X }
X if ((stdscr = newwin(LINES, COLS, 0, 0)) == (WINDOW *) ERR)
X {
X return( ERR );
X }
X curscr->_clear = FALSE;
X#ifdef REGISTERWINDOWS
X _cursvar.refreshall = FALSE;
X _inswin(stdscr, (WINDOW *)NULL);
X#endif
X _cursvar.alive = TRUE;
X return( &_cursvar );
X}
X#endif
END_OF_FILE
if test 3226 -ne `wc -c <'portable/newterm.c'`; then
echo shar: \"'portable/newterm.c'\" unpacked with wrong size!
fi
# end of 'portable/newterm.c'
fi
if test ! -d 'private' ; then
echo shar: Creating directory \"'private'\"
mkdir 'private'
fi
if test ! -d 'tools' ; then
echo shar: Creating directory \"'tools'\"
mkdir 'tools'
fi
echo shar: End of archive 1 \(of 11\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 11 archives.
rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
echo You still must unpack the following archives:
echo " " ${MISSING}
fi
exit 0
exit 0 # Just in case...
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: demos/xmas.c nonport/wbox.c private/_vsscanf.c
# tools/buildlrf.def
# Wrapped by kent@sparky on Wed Nov 18 21:44:06 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 2 (of 11)."'
if test -f 'demos/xmas.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'demos/xmas.c'\"
else
echo shar: Extracting \"'demos/xmas.c'\" \(33528 characters\)
sed "s/^X//" >'demos/xmas.c' <<'END_OF_FILE'
X/******************************************************************************/
X/* asciixmas */
X/* December 1989 Larry Bartz Indianapolis, IN */
X/* */
X/* */
X/* I'm dreaming of an ascii character-based monochrome Christmas, */
X/* Just like the one's I used to know! */
X/* Via a full duplex communications channel, */
X/* At 9600 bits per second, */
X/* Even though it's kinda slow. */
X/* */
X/* I'm dreaming of an ascii character-based monochrome Christmas, */
X/* With ev'ry C program I write! */
X/* May your screen be merry and bright! */
X/* And may all your Christmases be amber or green, */
X/* (for reduced eyestrain and improved visibility)! */
X/* */
X/* */
X/* */
X/* */
X/* */
X/* IMPLEMENTATION */
X/* */
X/* Feel free to modify the defined string FROMWHO to reflect you, your */
X/* organization, your site, whatever. */
X/* */
X/* This really looks a lot better if you can turn off your cursor before */
X/* execution. I wanted to do that here but very few termcap entries or */
X/* terminfo definitions have the appropriate string defined. If you know */
X/* the string(s) for the terminal(s) you use or which your site supports, */
X/* you could call asciixmas from within a shell in which you issue the */
X/* string to the terminal. The cursor is distracting but it doesn't really */
X/* ruin the show. */
X/* */
X/* At our site, we invoke this for our users just after login and the */
X/* determination of terminal type. */
X/* */
X/* */
X/* PORTABILITY */
X/* */
X/* I wrote this using only the very simplest curses functions so that it */
X/* might be the most portable. I was personally able to test on five */
X/* different cpu/UNIX combinations. */
X/* */
X/* */
X/* COMPILE */
X/* */
X/* usually this: */
X/* */
X/* cc -O asciixmas.c -lcurses -o asciixmas -s */
X/* */
X/* */
X/* Zilog S8000 models 11, 21, 31, etc with ZEUS variant of SYSTEM III */
X/* maybe other SYSTEM III also: */
X/* */
X/* cc asciixmas.c -lcurses -ltermlib -o asciixmas -s */
X/* */
X/* as above with optional "peephole optimizer" installed: */
X/* */
X/* cc -O asciixmas.c -lcurses -ltermlib -o asciixmas -s */
X/* */
X/* */
X/* Zilog S8000 models 32, 130 with WE32100 chip and SYS V, REL2 */
X/* maybe 3B2 also? */
X/* */
X/* cc -f -O -K sd asciixmas.c -lcurses -o asciixmas -s */
X/* */
X/* */
X/* Pyramid, Sequent, any other "dual universe" types compile and execute */
X/* under either universe. The compile line for the ucb universe (as you */
X/* might expect) is the same as for SYS III UNIX: */
X/* */
X/* cc -O asciixmas.c -lcurses -ltermlib -o asciixmas -s */
X/* */
X/* The above compile will also hold true for other BSD systems. (I hope) */
X/* */
X/* */
X/* */
X/* */
X/* For the Scrooges out there among you who don't want this thing to loop */
X/* forever (or until the user hits DEL), insert this into your compile */
X/* line just after "cc" : */
X/* */
X/* -DNOLOOP */
X/* */
X/* like so: */
X/* */
X/* cc -DNOLOOP -O asciixmas.c -lcurses -o asciixmas -s */
X/* */
X/* */
X/* */
X/******************************************************************************/
X
X#include <curses.h>
X#include <signal.h>
X
X#define FROMWHO "Mark Hessling - (M.Hes...@itc.gu.edu.au)"
X
Xint y_pos, x_pos;
X
XWINDOW
X *treescrn, *treescrn2,*treescrn3, *treescrn4,*treescrn5, *treescrn6,
X *treescrn7, *treescrn8,
X *dotdeer0,
X *stardeer0,
X *lildeer0, *lildeer1, *lildeer2, *lildeer3,
X *middeer0, *middeer1, *middeer2, *middeer3,
X *bigdeer0, *bigdeer1, *bigdeer2, *bigdeer3, *bigdeer4,
X *lookdeer0, *lookdeer1, *lookdeer2, *lookdeer3, *lookdeer4,
X *w_holiday,
X *w_del_msg;
X
Xvoid main()
X{
X void done();
X int loopy;
X
X initscr();
X noecho();
X nonl();
X refresh();
X signal(SIGINT,done);
X signal(SIGTERM,done);
X#if !defined DOS && !defined OS2
X signal(SIGHUP,done);
X signal(SIGQUIT,done);
X#endif
X
X
X
X treescrn = newwin(16,27,3,53);
X treescrn2 = newwin(16,27,3,53);
X treescrn3 = newwin(16,27,3,53);
X treescrn4 = newwin(16,27,3,53);
X treescrn5 = newwin(16,27,3,53);
X treescrn6 = newwin(16,27,3,53);
X treescrn7 = newwin(16,27,3,53);
X treescrn8 = newwin(16,27,3,53);
X
X dotdeer0 = newwin(3,71,0,8);
X
X stardeer0 = newwin(4,56,0,8);
X
X lildeer0 = newwin(7,53,0,8);
X lildeer1 = newwin(2,4,0,0);
X lildeer2 = newwin(2,4,0,0);
X lildeer3 = newwin(2,4,0,0);
X
X middeer0 = newwin(15,42,0,8);
X middeer1 = newwin(3,7,0,0);
X middeer2 = newwin(3,7,0,0);
X middeer3 = newwin(3,7,0,0);
X
X bigdeer0 = newwin(10,23,0,0);
X bigdeer1 = newwin(10,23,0,0);
X bigdeer2 = newwin(10,23,0,0);
X bigdeer3 = newwin(10,23,0,0);
X bigdeer4 = newwin(10,23,0,0);
X
X lookdeer0 = newwin(10,25,0,0);
X lookdeer1 = newwin(10,25,0,0);
X lookdeer2 = newwin(10,25,0,0);
X lookdeer3 = newwin(10,25,0,0);
X lookdeer4 = newwin(10,25,0,0);
X
X w_holiday = newwin(1,26,3,27);
X
X w_del_msg = newwin(1,12,23,68);
X
X mvwaddstr(w_del_msg,0,0,"DEL to quit");
X
X mvwaddstr(w_holiday,0,0,"H A P P Y H O L I D A Y S");
X
X /* set up the windows for our various reindeer */
X
X /* lildeer1 */
X mvwaddch(lildeer1,0,0,(chtype)'V');
X mvwaddch(lildeer1,1,0,(chtype)'@');
X mvwaddch(lildeer1,1,1,(chtype)'<');
X mvwaddch(lildeer1,1,2,(chtype)'>');
X mvwaddch(lildeer1,1,3,(chtype)'~');
X
X /* lildeer2 */
X mvwaddch(lildeer2,0,0,(chtype)'V');
X mvwaddch(lildeer2,1,0,(chtype)'@');
X mvwaddch(lildeer2,1,1,(chtype)'|');
X mvwaddch(lildeer2,1,2,(chtype)'|');
X mvwaddch(lildeer2,1,3,(chtype)'~');
X
X /* lildeer3 */
X mvwaddch(lildeer3,0,0,(chtype)'V');
X mvwaddch(lildeer3,1,0,(chtype)'@');
X mvwaddch(lildeer3,1,1,(chtype)'>');
X mvwaddch(lildeer3,1,2,(chtype)'<');
X mvwaddch(lildeer2,1,3,(chtype)'~');
X
X
X /* middeer1 */
X mvwaddch(middeer1,0,2,(chtype)'y');
X mvwaddch(middeer1,0,3,(chtype)'y');
X mvwaddch(middeer1,1,2,(chtype)'0');
X mvwaddch(middeer1,1,3,(chtype)'(');
X mvwaddch(middeer1,1,4,(chtype)'=');
X mvwaddch(middeer1,1,5,(chtype)')');
X mvwaddch(middeer1,1,6,(chtype)'~');
X mvwaddch(middeer1,2,3,(chtype)'\\');
X mvwaddch(middeer1,2,4,(chtype)'/');
X
X /* middeer2 */
X mvwaddch(middeer2,0,2,(chtype)'y');
X mvwaddch(middeer2,0,3,(chtype)'y');
X mvwaddch(middeer2,1,2,(chtype)'0');
X mvwaddch(middeer2,1,3,(chtype)'(');
X mvwaddch(middeer2,1,4,(chtype)'=');
X mvwaddch(middeer2,1,5,(chtype)')');
X mvwaddch(middeer2,1,6,(chtype)'~');
X mvwaddch(middeer2,2,3,(chtype)'|');
X mvwaddch(middeer2,2,5,(chtype)'|');
X
X /* middeer3 */
X mvwaddch(middeer3,0,2,(chtype)'y');
X mvwaddch(middeer3,0,3,(chtype)'y');
X mvwaddch(middeer3,1,2,(chtype)'0');
X mvwaddch(middeer3,1,3,(chtype)'(');
X mvwaddch(middeer3,1,4,(chtype)'=');
X mvwaddch(middeer3,1,5,(chtype)')');
X mvwaddch(middeer3,1,6,(chtype)'~');
X mvwaddch(middeer3,2,2,(chtype)'/');
X mvwaddch(middeer3,2,6,(chtype)'\\');
X
X
X /* bigdeer1 */
X mvwaddch(bigdeer1,0,17,(chtype)'\\');
X mvwaddch(bigdeer1,0,18,(chtype)'/');
X mvwaddch(bigdeer1,0,20,(chtype)'\\');
X mvwaddch(bigdeer1,0,21,(chtype)'/');
X mvwaddch(bigdeer1,1,18,(chtype)'\\');
X mvwaddch(bigdeer1,1,20,(chtype)'/');
X mvwaddch(bigdeer1,2,19,(chtype)'|');
X mvwaddch(bigdeer1,2,20,(chtype)'_');
X mvwaddch(bigdeer1,3,18,(chtype)'/');
X mvwaddch(bigdeer1,3,19,(chtype)'^');
X mvwaddch(bigdeer1,3,20,(chtype)'0');
X mvwaddch(bigdeer1,3,21,(chtype)'\\');
X mvwaddch(bigdeer1,4,17,(chtype)'/');
X mvwaddch(bigdeer1,4,18,(chtype)'/');
X mvwaddch(bigdeer1,4,19,(chtype)'\\');
X mvwaddch(bigdeer1,4,22,(chtype)'\\');
X mvwaddstr(bigdeer1,5,7,"^~~~~~~~~// ~~U");
X mvwaddstr(bigdeer1,6,7,"( \\_____( /");
X mvwaddstr(bigdeer1,7,8,"( ) /");
X mvwaddstr(bigdeer1,8,9,"\\\\ /");
X mvwaddstr(bigdeer1,9,11,"\\>/>");
X
X /* bigdeer2 */
X mvwaddch(bigdeer2,0,17,(chtype)'\\');
X mvwaddch(bigdeer2,0,18,(chtype)'/');
X mvwaddch(bigdeer2,0,20,(chtype)'\\');
X mvwaddch(bigdeer2,0,21,(chtype)'/');
X mvwaddch(bigdeer2,1,18,(chtype)'\\');
X mvwaddch(bigdeer2,1,20,(chtype)'/');
X mvwaddch(bigdeer2,2,19,(chtype)'|');
X mvwaddch(bigdeer2,2,20,(chtype)'_');
X mvwaddch(bigdeer2,3,18,(chtype)'/');
X mvwaddch(bigdeer2,3,19,(chtype)'^');
X mvwaddch(bigdeer2,3,20,(chtype)'0');
X mvwaddch(bigdeer2,3,21,(chtype)'\\');
X mvwaddch(bigdeer2,4,17,(chtype)'/');
X mvwaddch(bigdeer2,4,18,(chtype)'/');
X mvwaddch(bigdeer2,4,19,(chtype)'\\');
X mvwaddch(bigdeer2,4,22,(chtype)'\\');
X mvwaddstr(bigdeer2,5,7,"^~~~~~~~~// ~~U");
X mvwaddstr(bigdeer2,6,7,"(( )____( /");
X mvwaddstr(bigdeer2,7,7,"( / |");
X mvwaddstr(bigdeer2,8,8,"\\/ |");
X mvwaddstr(bigdeer2,9,9,"|> |>");
X
X /* bigdeer3 */
X mvwaddch(bigdeer3,0,17,(chtype)'\\');
X mvwaddch(bigdeer3,0,18,(chtype)'/');
X mvwaddch(bigdeer3,0,20,(chtype)'\\');
X mvwaddch(bigdeer3,0,21,(chtype)'/');
X mvwaddch(bigdeer3,1,18,(chtype)'\\');
X mvwaddch(bigdeer3,1,20,(chtype)'/');
X mvwaddch(bigdeer3,2,19,(chtype)'|');
X mvwaddch(bigdeer3,2,20,(chtype)'_');
X mvwaddch(bigdeer3,3,18,(chtype)'/');
X mvwaddch(bigdeer3,3,19,(chtype)'^');
X mvwaddch(bigdeer3,3,20,(chtype)'0');
X mvwaddch(bigdeer3,3,21,(chtype)'\\');
X mvwaddch(bigdeer3,4,17,(chtype)'/');
X mvwaddch(bigdeer3,4,18,(chtype)'/');
X mvwaddch(bigdeer3,4,19,(chtype)'\\');
X mvwaddch(bigdeer3,4,22,(chtype)'\\');
X mvwaddstr(bigdeer3,5,7,"^~~~~~~~~// ~~U");
X mvwaddstr(bigdeer3,6,6,"( ()_____( /");
X mvwaddstr(bigdeer3,7,6,"/ / /");
X mvwaddstr(bigdeer3,8,5,"|/ \\");
X mvwaddstr(bigdeer3,9,5,"/> \\>");
X
X /* bigdeer4 */
X mvwaddch(bigdeer4,0,17,(chtype)'\\');
X mvwaddch(bigdeer4,0,18,(chtype)'/');
X mvwaddch(bigdeer4,0,20,(chtype)'\\');
X mvwaddch(bigdeer4,0,21,(chtype)'/');
X mvwaddch(bigdeer4,1,18,(chtype)'\\');
X mvwaddch(bigdeer4,1,20,(chtype)'/');
X mvwaddch(bigdeer4,2,19,(chtype)'|');
X mvwaddch(bigdeer4,2,20,(chtype)'_');
X mvwaddch(bigdeer4,3,18,(chtype)'/');
X mvwaddch(bigdeer4,3,19,(chtype)'^');
X mvwaddch(bigdeer4,3,20,(chtype)'0');
X mvwaddch(bigdeer4,3,21,(chtype)'\\');
X mvwaddch(bigdeer4,4,17,(chtype)'/');
X mvwaddch(bigdeer4,4,18,(chtype)'/');
X mvwaddch(bigdeer4,4,19,(chtype)'\\');
X mvwaddch(bigdeer4,4,22,(chtype)'\\');
X mvwaddstr(bigdeer4,5,7,"^~~~~~~~~// ~~U");
X mvwaddstr(bigdeer4,6,6,"( )______( /");
X mvwaddstr(bigdeer4,7,5,"(/ \\");
X mvwaddstr(bigdeer4,8,0,"v___= ----^");
X
X
X /* lookdeer1 */
X mvwaddstr(lookdeer1,0,16,"\\/ \\/");
X mvwaddstr(lookdeer1,1,17,"\\Y/ \\Y/");
X mvwaddstr(lookdeer1,2,19,"\\=/");
X mvwaddstr(lookdeer1,3,17,"^\\o o/^");
X mvwaddstr(lookdeer1,4,17,"//( )");
X mvwaddstr(lookdeer1,5,7,"^~~~~~~~~// \\O/");
X mvwaddstr(lookdeer1,6,7,"( \\_____( /");
X mvwaddstr(lookdeer1,7,8,"( ) /");
X mvwaddstr(lookdeer1,8,9,"\\\\ /");
X mvwaddstr(lookdeer1,9,11,"\\>/>");
X
X /* lookdeer2 */
X mvwaddstr(lookdeer2,0,16,"\\/ \\/");
X mvwaddstr(lookdeer2,1,17,"\\Y/ \\Y/");
X mvwaddstr(lookdeer2,2,19,"\\=/");
X mvwaddstr(lookdeer2,3,17,"^\\o o/^");
X mvwaddstr(lookdeer2,4,17,"//( )");
X mvwaddstr(lookdeer2,5,7,"^~~~~~~~~// \\O/");
X mvwaddstr(lookdeer2,6,7,"(( )____( /");
X mvwaddstr(lookdeer2,7,7,"( / |");
X mvwaddstr(lookdeer2,8,8,"\\/ |");
X mvwaddstr(lookdeer2,9,9,"|> |>");
X
X /* lookdeer3 */
X mvwaddstr(lookdeer3,0,16,"\\/ \\/");
X mvwaddstr(lookdeer3,1,17,"\\Y/ \\Y/");
X mvwaddstr(lookdeer3,2,19,"\\=/");
X mvwaddstr(lookdeer3,3,17,"^\\o o/^");
X mvwaddstr(lookdeer3,4,17,"//( )");
X mvwaddstr(lookdeer3,5,7,"^~~~~~~~~// \\O/");
X mvwaddstr(lookdeer3,6,6,"( ()_____( /");
X mvwaddstr(lookdeer3,7,6,"/ / /");
X mvwaddstr(lookdeer3,8,5,"|/ \\");
X mvwaddstr(lookdeer3,9,5,"/> \\>");
X
X /* lookdeer4 */
X mvwaddstr(lookdeer4,0,16,"\\/ \\/");
X mvwaddstr(lookdeer4,1,17,"\\Y/ \\Y/");
X mvwaddstr(lookdeer4,2,19,"\\=/");
X mvwaddstr(lookdeer4,3,17,"^\\o o/^");
X mvwaddstr(lookdeer4,4,17,"//( )");
X mvwaddstr(lookdeer4,5,7,"^~~~~~~~~// \\O/");
X mvwaddstr(lookdeer4,6,6,"( )______( /");
X mvwaddstr(lookdeer4,7,5,"(/ \\");
X mvwaddstr(lookdeer4,8,0,"v___= ----^");
X
X
X
X /***********************************************/
X
X do
X {
X clear();
X werase(treescrn);
X touchwin(treescrn);
X werase(treescrn2);
X touchwin(treescrn2);
X werase(treescrn8);
X touchwin(treescrn8);
X refresh();
X delay_output(1000);
X boxit();
X del_msg();
X delay_output(1000);
X seas();
X del_msg();
X delay_output(1000);
X greet();
X del_msg();
X delay_output(1000);
X fromwho();
X del_msg();
X delay_output(1000);
X tree();
X delay_output(1000);
X balls();
X delay_output(1000);
X star();
X delay_output(1000);
X strng1();
X strng2();
X strng3();
X strng4();
X strng5();
X
X
X /* set up the windows for our blinking trees */
X /* **************************************** */
X /* treescrn3 */
X
X overlay(treescrn, treescrn3);
X
X /*balls*/
X mvwaddch(treescrn3, 4, 18, ' ');
X mvwaddch(treescrn3, 7, 6, ' ');
X mvwaddch(treescrn3, 8, 19, ' ');
X mvwaddch(treescrn3, 11, 22, ' ');
X
X /*star*/
X mvwaddch(treescrn3, 0, 12, '*');
X
X /*strng1*/
X mvwaddch(treescrn3, 3, 11, ' ');
X
X /*strng2*/
X mvwaddch(treescrn3, 5, 13, ' ');
X mvwaddch(treescrn3, 6, 10, ' ');
X
X /*strng3*/
X mvwaddch(treescrn3, 7, 16, ' ');
X mvwaddch(treescrn3, 7, 14, ' ');
X
X /*strng4*/
X mvwaddch(treescrn3, 10, 13, ' ');
X mvwaddch(treescrn3, 10, 10, ' ');
X mvwaddch(treescrn3, 11, 8, ' ');
X
X /*strng5*/
X mvwaddch(treescrn3, 11, 18, ' ');
X mvwaddch(treescrn3, 12, 13, ' ');
X
X
X /* treescrn4 */
X
X overlay(treescrn, treescrn4);
X
X /*balls*/
X mvwaddch(treescrn4, 3, 9, ' ');
X mvwaddch(treescrn4, 4, 16, ' ');
X mvwaddch(treescrn4, 7, 6, ' ');
X mvwaddch(treescrn4, 8, 19, ' ');
X mvwaddch(treescrn4, 11, 2, ' ');
X mvwaddch(treescrn4, 12, 23, ' ');
X
X /*star*/
X wstandout(treescrn4);
X mvwaddch(treescrn4, 0, 12, '*');
X wstandend(treescrn4);
X
X /*strng1*/
X mvwaddch(treescrn4, 3, 13, ' ');
X
X /*strng2*/
X
X /*strng3*/
X mvwaddch(treescrn4, 7, 15, ' ');
X mvwaddch(treescrn4, 8, 11, ' ');
X
X /*strng4*/
X mvwaddch(treescrn4, 9, 16, ' ');
X mvwaddch(treescrn4, 10, 12, ' ');
X mvwaddch(treescrn4, 11, 8, ' ');
X
X /*strng5*/
X mvwaddch(treescrn4, 11, 18, ' ');
X mvwaddch(treescrn4, 12, 14, ' ');
X
X
X /* treescrn5 */
X
X overlay(treescrn, treescrn5);
X
X /*balls*/
X mvwaddch(treescrn5, 3, 15, ' ');
X mvwaddch(treescrn5, 10, 20, ' ');
X mvwaddch(treescrn5, 12, 1, ' ');
X
X /*star*/
X mvwaddch(treescrn5, 0, 12, '*');
X
X /*strng1*/
X mvwaddch(treescrn5, 3, 11, ' ');
X
X /*strng2*/
X mvwaddch(treescrn5, 5, 12, ' ');
X
X /*strng3*/
X mvwaddch(treescrn5, 7, 14, ' ');
X mvwaddch(treescrn5, 8, 10, ' ');
X
X /*strng4*/
X mvwaddch(treescrn5, 9, 15, ' ');
X mvwaddch(treescrn5, 10, 11, ' ');
X mvwaddch(treescrn5, 11, 7, ' ');
X
X /*strng5*/
X mvwaddch(treescrn5, 11, 17, ' ');
X mvwaddch(treescrn5, 12, 13, ' ');
X
X /* treescrn6 */
X
X overlay(treescrn, treescrn6);
X
X /*balls*/
X mvwaddch(treescrn6, 6, 7, ' ');
X mvwaddch(treescrn6, 7, 18, ' ');
X mvwaddch(treescrn6, 10, 4, ' ');
X mvwaddch(treescrn6, 11, 23, ' ');
X
X /*star*/
X wstandout(treescrn6);
X mvwaddch(treescrn6, 0, 12, '*');
X wstandend(treescrn6);
X
X /*strng1*/
X
X /*strng2*/
X mvwaddch(treescrn6, 5, 11, ' ');
X
X /*strng3*/
X mvwaddch(treescrn6, 7, 13, ' ');
X mvwaddch(treescrn6, 8, 9, ' ');
X
X /*strng4*/
X mvwaddch(treescrn6, 9, 14, ' ');
X mvwaddch(treescrn6, 10, 10, ' ');
X mvwaddch(treescrn6, 11, 6, ' ');
X
X /*strng5*/
X mvwaddch(treescrn6, 11, 16, ' ');
X mvwaddch(treescrn6, 12, 12, ' ');
X
X /* treescrn7 */
X
X overlay(treescrn, treescrn7);
X
X /*balls*/
X mvwaddch(treescrn7, 3, 15, ' ');
X mvwaddch(treescrn7, 6, 7, ' ');
X mvwaddch(treescrn7, 7, 18, ' ');
X mvwaddch(treescrn7, 10, 4, ' ');
X mvwaddch(treescrn7, 11, 22, ' ');
X
X /*star*/
X mvwaddch(treescrn7, 0, 12, '*');
X
X /*strng1*/
X mvwaddch(treescrn7, 3, 12, ' ');
X
X /*strng2*/
X mvwaddch(treescrn7, 5, 13, ' ');
X mvwaddch(treescrn7, 6, 9, ' ');
X
X /*strng3*/
X mvwaddch(treescrn7, 7, 15, ' ');
X mvwaddch(treescrn7, 8, 11, ' ');
X
X /*strng4*/
X mvwaddch(treescrn7, 9, 16, ' ');
X mvwaddch(treescrn7, 10, 12, ' ');
X mvwaddch(treescrn7, 11, 8, ' ');
X
X /*strng5*/
X mvwaddch(treescrn7, 11, 18, ' ');
X mvwaddch(treescrn7, 12, 14, ' ');
X
X
X delay_output(1000);
X reindeer();
X
X touchwin(w_holiday);
X wrefresh(w_holiday);
X wrefresh(w_del_msg);
X
X delay_output(1000);
X for(loopy = 0;loopy < 100;loopy++)
X {
X blinkit();
X }
X
X#ifdef NOLOOP
X done();
X#endif
X
X }
X while(!typeahead(stdin));
X}
X
Xboxit()
X{
X int x = 0;
X
X while(x < 20)
X {
X mvaddch(x, 7, '|');
X ++x;
X }
X
X x = 8;
X
X while(x < 80)
X {
X mvaddch(19, x, '_');
X ++x;
X }
X
X x = 0;
X
X while(x < 80)
X {
X mvaddch(22, x, '_');
X ++x;
X }
X
X return( 0 );
X}
X
Xseas()
X{
X mvaddch(4, 1, 'S');
X mvaddch(6, 1, 'E');
X mvaddch(8, 1, 'A');
X mvaddch(10, 1, 'S');
X mvaddch(12, 1, 'O');
X mvaddch(14, 1, 'N');
X mvaddch(16, 1, '`');
X mvaddch(18, 1, 'S');
X
X return( 0 );
X}
X
X
Xgreet()
X{
X mvaddch(3, 5, 'G');
X mvaddch(5, 5, 'R');
X mvaddch(7, 5, 'E');
X mvaddch(9, 5, 'E');
X mvaddch(11, 5, 'T');
X mvaddch(13, 5, 'I');
X mvaddch(15, 5, 'N');
X mvaddch(17, 5, 'G');
X mvaddch(19, 5, 'S');
X
X return( 0 );
X}
X
X
Xfromwho()
X{
X mvaddstr(21, 13, FROMWHO);
X return( 0 );
X}
X
X
Xdel_msg()
X{
X mvaddstr(23, 68, "DEL to quit");
X
X refresh();
X
X return( 0 );
X}
X
X
Xtree()
X{
X mvwaddch(treescrn, 1, 11, (chtype)'/');
X mvwaddch(treescrn, 2, 11, (chtype)'/');
X mvwaddch(treescrn, 3, 10, (chtype)'/');
X mvwaddch(treescrn, 4, 9, (chtype)'/');
X mvwaddch(treescrn, 5, 9, (chtype)'/');
X mvwaddch(treescrn, 6, 8, (chtype)'/');
X mvwaddch(treescrn, 7, 7, (chtype)'/');
X mvwaddch(treescrn, 8, 6, (chtype)'/');
X mvwaddch(treescrn, 9, 6, (chtype)'/');
X mvwaddch(treescrn, 10, 5, (chtype)'/');
X mvwaddch(treescrn, 11, 3, (chtype)'/');
X mvwaddch(treescrn, 12, 2, (chtype)'/');
X
X mvwaddch(treescrn, 1, 13, (chtype)'\\');
X mvwaddch(treescrn, 2, 13, (chtype)'\\');
X mvwaddch(treescrn, 3, 14, (chtype)'\\');
X mvwaddch(treescrn, 4, 15, (chtype)'\\');
X mvwaddch(treescrn, 5, 15, (chtype)'\\');
X mvwaddch(treescrn, 6, 16, (chtype)'\\');
X mvwaddch(treescrn, 7, 17, (chtype)'\\');
X mvwaddch(treescrn, 8, 18, (chtype)'\\');
X mvwaddch(treescrn, 9, 18, (chtype)'\\');
X mvwaddch(treescrn, 10, 19, (chtype)'\\');
X mvwaddch(treescrn, 11, 21, (chtype)'\\');
X mvwaddch(treescrn, 12, 22, (chtype)'\\');
X
X mvwaddch(treescrn, 4, 10, (chtype)'_');
X mvwaddch(treescrn, 4, 14, (chtype)'_');
X mvwaddch(treescrn, 8, 7, (chtype)'_');
X mvwaddch(treescrn, 8, 17, (chtype)'_');
X
X mvwaddstr(treescrn, 13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\");
X
X mvwaddstr(treescrn, 14, 11, "| |");
X mvwaddstr(treescrn, 15, 11, "|_|");
X
X wrefresh(treescrn);
X wrefresh(w_del_msg);
X
X return( 0 );
X}
X
X
Xballs()
X{
X
X overlay(treescrn, treescrn2);
X
X mvwaddch(treescrn2, 3, 9, (chtype)'@');
X mvwaddch(treescrn2, 3, 15, (chtype)'@');
X mvwaddch(treescrn2, 4, 8, (chtype)'@');
X mvwaddch(treescrn2, 4, 16, (chtype)'@');
X mvwaddch(treescrn2, 5, 7, (chtype)'@');
X mvwaddch(treescrn2, 5, 17, (chtype)'@');
X mvwaddch(treescrn2, 7, 6, (chtype)'@');
X mvwaddch(treescrn2, 7, 18, (chtype)'@');
X mvwaddch(treescrn2, 8, 5, (chtype)'@');
X mvwaddch(treescrn2, 8, 19, (chtype)'@');
X mvwaddch(treescrn2, 10, 4, (chtype)'@');
X mvwaddch(treescrn2, 10, 20, (chtype)'@');
X mvwaddch(treescrn2, 11, 2, (chtype)'@');
X mvwaddch(treescrn2, 11, 22, (chtype)'@');
X mvwaddch(treescrn2, 12, 1, (chtype)'@');
X mvwaddch(treescrn2, 12, 23, (chtype)'@');
X
X wrefresh(treescrn2);
X wrefresh(w_del_msg);
X return( 0 );
X}
X
X
Xstar()
X{
X wstandout(treescrn2);
X mvwaddch(treescrn2, 0, 12, (chtype)'*');
X wstandend(treescrn2);
X
X wrefresh(treescrn2);
X wrefresh(w_del_msg);
X return( 0 );
X}
X
X
Xstrng1()
X{
X mvwaddch(treescrn2, 3, 13, (chtype)'\'');
X mvwaddch(treescrn2, 3, 12, (chtype)':');
X mvwaddch(treescrn2, 3, 11, (chtype)'.');
X
X wrefresh(treescrn2);
X wrefresh(w_del_msg);
X return( 0 );
X}
X
X
Xstrng2()
X{
X mvwaddch(treescrn2, 5, 14, (chtype)'\'');
X mvwaddch(treescrn2, 5, 13, (chtype)':');
X mvwaddch(treescrn2, 5, 12, (chtype)'.');
X mvwaddch(treescrn2, 5, 11, (chtype)',');
X mvwaddch(treescrn2, 6, 10, (chtype)'\'');
X mvwaddch(treescrn2, 6, 9, (chtype)':');
X
X wrefresh(treescrn2);
X wrefresh(w_del_msg);
X return( 0 );
X}
X
X
Xstrng3()
X{
X mvwaddch(treescrn2, 7, 16, (chtype)'\'');
X mvwaddch(treescrn2, 7, 15, (chtype)':');
X mvwaddch(treescrn2, 7, 14, (chtype)'.');
X mvwaddch(treescrn2, 7, 13, (chtype)',');
X mvwaddch(treescrn2, 8, 12, (chtype)'\'');
X mvwaddch(treescrn2, 8, 11, (chtype)':');
X mvwaddch(treescrn2, 8, 10, (chtype)'.');
X mvwaddch(treescrn2, 8, 9, (chtype)',');
X
X wrefresh(treescrn2);
X wrefresh(w_del_msg);
X return( 0 );
X}
X
X
Xstrng4()
X{
X mvwaddch(treescrn2, 9, 17, (chtype)'\'');
X mvwaddch(treescrn2, 9, 16, (chtype)':');
X mvwaddch(treescrn2, 9, 15, (chtype)'.');
X mvwaddch(treescrn2, 9, 14, (chtype)',');
X mvwaddch(treescrn2, 10, 13, (chtype)'\'');
X mvwaddch(treescrn2, 10, 12, (chtype)':');
X mvwaddch(treescrn2, 10, 11, (chtype)'.');
X mvwaddch(treescrn2, 10, 10, (chtype)',');
X mvwaddch(treescrn2, 11, 9, (chtype)'\'');
X mvwaddch(treescrn2, 11, 8, (chtype)':');
X mvwaddch(treescrn2, 11, 7, (chtype)'.');
X mvwaddch(treescrn2, 11, 6, (chtype)',');
X mvwaddch(treescrn2, 12, 5, (chtype)'\'');
X
X wrefresh(treescrn2);
X wrefresh(w_del_msg);
X return( 0 );
X}
X
X
Xstrng5()
X{
X mvwaddch(treescrn2, 11, 19, (chtype)'\'');
X mvwaddch(treescrn2, 11, 18, (chtype)':');
X mvwaddch(treescrn2, 11, 17, (chtype)'.');
X mvwaddch(treescrn2, 11, 16, (chtype)',');
X mvwaddch(treescrn2, 12, 15, (chtype)'\'');
X mvwaddch(treescrn2, 12, 14, (chtype)':');
X mvwaddch(treescrn2, 12, 13, (chtype)'.');
X mvwaddch(treescrn2, 12, 12, (chtype)',');
X
X /* save a fully lit tree */
X overlay(treescrn2, treescrn);
X
X wrefresh(treescrn2);
X wrefresh(w_del_msg);
X return( 0 );
X}
X
X
X
Xblinkit()
X{
X static int cycle;
X
X if(cycle > 4)
X {
X cycle = 0;
X }
X
X
X touchwin(treescrn8);
X
X switch(cycle)
X {
X
X case 0:
X overlay(treescrn3, treescrn8);
X wrefresh(treescrn8);
X wrefresh(w_del_msg);
X
X break;
X case 1:
X overlay(treescrn4, treescrn8);
X wrefresh(treescrn8);
X wrefresh(w_del_msg);
X
X break;
X case 2:
X overlay(treescrn5, treescrn8);
X wrefresh(treescrn8);
X wrefresh(w_del_msg);
X
X break;
X case 3:
X overlay(treescrn6, treescrn8);
X wrefresh(treescrn8);
X wrefresh(w_del_msg);
X
X break;
X case 4:
X overlay(treescrn7, treescrn8);
X wrefresh(treescrn8);
X wrefresh(w_del_msg);
X
X break;
X }
X
X touchwin(treescrn8);
X
X
X
X /*ALL ON***************************************************/
X
X
X overlay(treescrn, treescrn8);
X wrefresh(treescrn8);
X wrefresh(w_del_msg);
X
X
X ++cycle;
X return( 0 );
X}
X
X
Xreindeer()
X{
X int looper;
X
X y_pos = 0;
X
X
X for(x_pos = 70; x_pos > 62; x_pos--)
X {
X if(x_pos < 62)
X {
X y_pos = 1;
X }
X for(looper = 0; looper < 4; looper++)
X {
X mvwaddch(dotdeer0, y_pos, x_pos, (chtype)'.');
X wrefresh(dotdeer0);
X wrefresh(w_del_msg);
X werase(dotdeer0);
X wrefresh(dotdeer0);
X wrefresh(w_del_msg);
X }
X }
X
X y_pos = 2;
X
X for(; x_pos > 50; x_pos--)
X {
X
X for(looper = 0; looper < 4; looper++)
X {
X
X if(x_pos < 56)
X {
X y_pos = 3;
X
X mvwaddch(stardeer0, y_pos, x_pos, (chtype)'*');
X wrefresh(stardeer0);
X wrefresh(w_del_msg);
X werase(stardeer0);
X wrefresh(stardeer0);
X wrefresh(w_del_msg);
X }
X else
X {
X mvwaddch(dotdeer0, y_pos, x_pos, (chtype)'*');
X wrefresh(dotdeer0);
X wrefresh(w_del_msg);
X werase(dotdeer0);
X wrefresh(dotdeer0);
X wrefresh(w_del_msg);
X }
X }
X }
X
X x_pos = 58;
X
X for(y_pos = 2; y_pos < 5; y_pos++)
X {
X
X touchwin(lildeer0);
X wrefresh(lildeer0);
X wrefresh(w_del_msg);
X
X for(looper = 0; looper < 4; looper++)
X {
X mvwin(lildeer3, y_pos, x_pos);
X wrefresh(lildeer3);
X wrefresh(w_del_msg);
X
X mvwin(lildeer2, y_pos, x_pos);
X wrefresh(lildeer2);
X wrefresh(w_del_msg);
X
X mvwin(lildeer1, y_pos, x_pos);
X wrefresh(lildeer1);
X wrefresh(w_del_msg);
X
X mvwin(lildeer2, y_pos, x_pos);
X wrefresh(lildeer2);
X wrefresh(w_del_msg);
X
X mvwin(lildeer3, y_pos, x_pos);
X wrefresh(lildeer3);
X wrefresh(w_del_msg);
X
X touchwin(lildeer0);
X wrefresh(lildeer0);
X wrefresh(w_del_msg);
X
X x_pos -= 2;
X }
X }
X
X
X x_pos = 35;
X
X for(y_pos = 5; y_pos < 10; y_pos++)
X {
X
X touchwin(middeer0);
X wrefresh(middeer0);
X wrefresh(w_del_msg);
X
X for(looper = 0; looper < 2; looper++)
X {
X mvwin(middeer3, y_pos, x_pos);
X wrefresh(middeer3);
X wrefresh(w_del_msg);
X
X mvwin(middeer2, y_pos, x_pos);
X wrefresh(middeer2);
X wrefresh(w_del_msg);
X
X mvwin(middeer1, y_pos, x_pos);
X wrefresh(middeer1);
X wrefresh(w_del_msg);
X
X mvwin(middeer2, y_pos, x_pos);
X wrefresh(middeer2);
X wrefresh(w_del_msg);
X
X mvwin(middeer3, y_pos, x_pos);
X wrefresh(middeer3);
X wrefresh(w_del_msg);
X
X touchwin(middeer0);
X wrefresh(middeer0);
X wrefresh(w_del_msg);
X
X x_pos -= 3;
X }
X }
X
X delay_output(2000);
X
X y_pos = 1;
X
X for(x_pos = 8; x_pos < 16; x_pos++)
X {
X
X mvwin(bigdeer4, y_pos, x_pos);
X wrefresh(bigdeer4);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer3, y_pos, x_pos);
X wrefresh(bigdeer3);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer2, y_pos, x_pos);
X wrefresh(bigdeer2);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer1, y_pos, x_pos);
X wrefresh(bigdeer1);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer2, y_pos, x_pos);
X wrefresh(bigdeer2);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer3, y_pos, x_pos);
X wrefresh(bigdeer3);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer4, y_pos, x_pos);
X wrefresh(bigdeer4);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer0, y_pos, x_pos);
X wrefresh(bigdeer0);
X wrefresh(w_del_msg);
X }
X
X --x_pos;
X
X for(looper = 0; looper < 6; looper++)
X {
X mvwin(lookdeer4, y_pos, x_pos);
X wrefresh(lookdeer4);
X wrefresh(w_del_msg);
X
X mvwin(lookdeer3, y_pos, x_pos);
X wrefresh(lookdeer3);
X wrefresh(w_del_msg);
X
X mvwin(lookdeer2, y_pos, x_pos);
X wrefresh(lookdeer2);
X wrefresh(w_del_msg);
X
X mvwin(lookdeer1, y_pos, x_pos);
X wrefresh(lookdeer1);
X wrefresh(w_del_msg);
X
X mvwin(lookdeer2, y_pos, x_pos);
X wrefresh(lookdeer2);
X wrefresh(w_del_msg);
X
X mvwin(lookdeer3, y_pos, x_pos);
X wrefresh(lookdeer3);
X wrefresh(w_del_msg);
X
X mvwin(lookdeer4, y_pos, x_pos);
X wrefresh(lookdeer4);
X wrefresh(w_del_msg);
X
X }
X
X mvwin(lookdeer0, y_pos, x_pos);
X wrefresh(lookdeer0);
X wrefresh(w_del_msg);
X
X for(; y_pos < 10; y_pos++)
X {
X
X for(looper = 0; looper < 2; looper++)
X {
X mvwin(bigdeer4, y_pos, x_pos);
X wrefresh(bigdeer4);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer3, y_pos, x_pos);
X wrefresh(bigdeer3);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer2, y_pos, x_pos);
X wrefresh(bigdeer2);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer1, y_pos, x_pos);
X wrefresh(bigdeer1);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer2, y_pos, x_pos);
X wrefresh(bigdeer2);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer3, y_pos, x_pos);
X wrefresh(bigdeer3);
X wrefresh(w_del_msg);
X
X mvwin(bigdeer4, y_pos, x_pos);
X wrefresh(bigdeer4);
X wrefresh(w_del_msg);
X }
X mvwin(bigdeer0, y_pos, x_pos);
X wrefresh(bigdeer0);
X wrefresh(w_del_msg);
X }
X
X --y_pos;
X
X mvwin(lookdeer3, y_pos, x_pos);
X wrefresh(lookdeer3);
X wrefresh(w_del_msg);
X return( 0 );
X}
X
X
X
Xvoid done()
X{
X signal(SIGINT,done);
X signal(SIGTERM,done);
X#if !defined DOS && !defined OS2
X signal(SIGHUP,done);
X signal(SIGQUIT,done);
X#endif
X clear();
X refresh();
X endwin();
X exit(0);
X}
END_OF_FILE
if test 33528 -ne `wc -c <'demos/xmas.c'`; then
echo shar: \"'demos/xmas.c'\" unpacked with wrong size!
fi
# end of 'demos/xmas.c'
fi
if test -f 'nonport/wbox.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/wbox.c'\"
else
echo shar: Extracting \"'nonport/wbox.c'\" \(5122 characters\)
sed "s/^X//" >'nonport/wbox.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wbox
X
X#ifndef NDEBUG
Xchar *rcsid_wbox = "$Header: c:/curses/nonport/RCS/wbox.c%v 2.0 1992/11/15 03:18:30 MH Rel $";
X#endif
X
X/*man-start*********************************************************************
X
X wbox() - draw box
X
X PDCurses Description:
X Draws a box in window 'win', enclosing the area xmin-xmax and
X ymin-xmax. If xmax and/or ymax is 0, the window max value is
X used. 'v' and 'h' are the vertical and horizontal characters
X to use. If 'v' and 'h' are PC grapics lines, wbox will make
X the corners in a pretty way.
X
X Single Bar Box Double Bar Box
X ---------------------- ======================
X (0xDA) (0xC4) (0xBF) (0xC9) (0xCD) (0xBB)
X + - + + = +
X | (0xB3) | || (0xBA) ||
X + - + + = +
X (0xC0) (0xD9) (0xC8) (0xBC)
X
X PC Graphic Graphic Character Solids:
X # (quarter-tone) (0xB0)
X # (half-tone) (0xB1)
X # (three-quarter-tone) (0xB2)
X # (solid) (0xDB)
X
X PDCurses Return Value:
X The wbox() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int wbox( WINDOW* win, int ymin, int xmin,
X int ymax, int xmax,
X chtype v, chtype h );
X BSD Curses
X SYS V Curses
X
X**man-end**********************************************************************/
X
Xint wbox(WINDOW *win,int ymin,int xmin,int ymax,int xmax,chtype v,chtype h)
X{
X chtype l; /* border chars */
X chtype r;
X chtype t;
X chtype b;
X chtype tl;
X chtype tr;
X chtype bl;
X chtype br;
X chtype vattr;
X chtype hattr;
X int i;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X if (ymax == 0)
X ymax = win->_maxy - 1;
X if (xmax == 0)
X xmax = win->_maxx - 1;
X
X if ((ymin >= win->_maxy) ||
X (ymax > win->_maxy) ||
X (xmin >= win->_maxx) ||
X (xmax > win->_maxx) ||
X (ymin >= ymax) ||
X (xmin >= xmax))
X {
X return (ERR);
X }
X
X l = r = v & A_CHARTEXT;
X t = b = h & A_CHARTEXT;
X
X/* if the incoming character doesn't have its own attribute
X then use the current attributes for the window.
X if the incoming character has attributes but not a colour
X component, or the attributes to the current attributes
X for the window.
X if the incoming character has a colour component use the
X attributes solely from the incoming character */
X
X if ((h & A_ATTRIBUTES) == 0)
X hattr = win->_attrs;
X else
X if ((h & A_COLOR) == 0)
X hattr = (h & A_ATTRIBUTES) | win->_attrs;
X else
X hattr = (h & A_ATTRIBUTES);
X
X if ((v & A_ATTRIBUTES) == 0)
X vattr = win->_attrs;
X else
X if ((v & A_COLOR) == 0)
X vattr = (v | win->_attrs);
X else
X vattr = v;
X
X tl = tr = bl = br = l; /* default same as vertical */
X
X if (l == 0xba) /* vertical double bars */
X {
X if (t == 0xcd) /* horizontal too? */
X {
X tl = 0xc9; /* use double bar corners */
X tr = 0xbb;
X bl = 0xc8;
X br = 0xbc;
X }
X else
X {
X tl = 0xd6; /* use horz-s vert-d corners */
X tr = 0xb7;
X bl = 0xd3;
X br = 0xbd;
X }
X }
X
X if (l == 0xb3) /* vertical single bars */
X {
X if (t == 0xcd)
X {
X tl = 0xd5; /* horizontal double bars */
X tr = 0xb8;
X bl = 0xd4;
X br = 0xbe;
X }
X else
X {
X tl = 0xda; /* use horz-s vert-s bars */
X tr = 0xbf;
X bl = 0xc0;
X br = 0xd9;
X }
X }
X
X /*
X * wborder() settings override parms
X */
X if (win->_borderchars[0]) l = win->_borderchars[0];
X if (win->_borderchars[1]) r = win->_borderchars[1];
X if (win->_borderchars[2]) t = win->_borderchars[2];
X if (win->_borderchars[3]) b = win->_borderchars[3];
X if (win->_borderchars[4]) tl = win->_borderchars[4];
X if (win->_borderchars[5]) tr = win->_borderchars[5];
X if (win->_borderchars[6]) bl = win->_borderchars[6];
X if (win->_borderchars[7]) br = win->_borderchars[7];
X
X if (!(v|h) && !(l|r|t|b|tl|tr|bl|br))
X {
X /*
X * Appropriate default:
X *
X * Single box with parent window's title attribute
X */
X l = r = 0xb3 | win->_title_attr;
X t = b = 0xc4 | win->_title_attr;
X tl = 0xda | win->_attrs;
X tr = 0xbf | win->_attrs;
X bl = 0xc0 | win->_attrs;
X br = 0xd9 | win->_attrs;
X }
X
X for (i = xmin + 1; i <= xmax - 1; i++)
X {
X win->_y[ymin][i] = (t | hattr);
X win->_y[ymax][i] = (b | hattr);
X }
X
X for (i = ymin + 1; i <= ymax - 1; i++)
X {
X win->_y[i][xmin] = (l | vattr);
X win->_y[i][xmax] = (r | vattr);
X }
X
X win->_y[ymin][xmin] = (tl | vattr);
X win->_y[ymin][xmax] = (tr | vattr);
X win->_y[ymax][xmin] = (bl | vattr);
X win->_y[ymax][xmax] = (br | vattr);
X
X for (i = ymin; i <= ymax; i++)
X {
X if (win->_firstch[i] == _NO_CHANGE)
X {
X win->_firstch[i] = xmin;
X win->_lastch[i] = xmax;
X }
X else
X {
X win->_firstch[i] = min(win->_firstch[i], xmin);
X win->_lastch[i] = max(win->_lastch[i], xmax);
X }
X }
X /*
X * set wborder() settings to current values
X */
X win->_borderchars[0] = l | vattr;
X win->_borderchars[1] = r | vattr;
X win->_borderchars[2] = t | hattr;
X win->_borderchars[3] = b | hattr;
X win->_borderchars[4] = tl | vattr;
X win->_borderchars[5] = tr | vattr;
X win->_borderchars[6] = bl | vattr;
X win->_borderchars[7] = br | vattr;
X return (OK);
X}
END_OF_FILE
if test 5122 -ne `wc -c <'nonport/wbox.c'`; then
echo shar: \"'nonport/wbox.c'\" unpacked with wrong size!
fi
# end of 'nonport/wbox.c'
fi
if test -f 'private/_vsscanf.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_vsscanf.c'\"
else
echo shar: Extracting \"'private/_vsscanf.c'\" \(12556 characters\)
sed "s/^X//" >'private/_vsscanf.c' <<'END_OF_FILE'
X/*
X * This module is based on vsscanf.c and input.c from emx 0.8f library
X * source which is Copyright (c) 1990-1992 by Eberhard Mattes.
X * Eberhard Mattes has kindly agreed to allow this module to be incorporated
X * into PDCurses.
X */
X#ifndef NDEBUG
Xchar *rcsid__vsscanf = "$Header: c:/curses/private/RCS/_vsscanf.c%v 2.0 1992/11/15 03:24:18 MH Rel $";
X#endif
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <stdarg.h>
X#include <string.h>
X#include <limits.h>
X#include <ctype.h>
X
X#define TRUE 1
X#define FALSE 0
X
X#define WHITE(x) ((x) == ' ' || (x) == '\t' || (x) == '\n')
X
X#define NEXT(x) \
X do { \
X x = *buf++; \
X if (x == '\0') \
X return (count == 0 ? EOF : count); \
X ++chars; \
X } while (0)
X#define UNGETC(x) \
X do { \
X --buf; *buf = x; --chars; \
X } while (0)
X
X/*man-start*********************************************************************
X
X PDC_vsscanf() - Internal routine to parse and format an input buffer.
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Scan a series of input fields. Each field is formatted according to
X a supplied format string and the formatted input is stored in the
X variable number of addresses passed.
X
X PDCurses Return Value:
X This function returns the number of input fields or EOF on error.
X
X PDCurses Errors:
X If the supplied data is invalid or an incorrect number of arguments
X are passed, EOF is returned as an error.
X
X Portability:
X PDCurses int PDC_vsscanf(char *buf,const char *fmt,va_list arg_ptr);
X
X**man-end**********************************************************************/
X
Xint PDC_vsscanf ( char *buf, const char *fmt, char *arg_ptr)
X{
X int count, chars, c, width, radix, d, i;
X int *int_ptr;
X long *long_ptr;
X short *short_ptr;
X char *char_ptr;
X unsigned char f;
X char neg, assign, ok, size;
X unsigned long n;
X char map[256], end;
X double dx, dd, *dbl_ptr;
X float *flt_ptr;
X int exp;
X char eneg;
X
X count = 0; chars = 0; c = 0;
X while ((f = *fmt) != 0)
X {
X if (WHITE (f))
X {
X do
X {
X ++fmt; f = *fmt;
X } while (WHITE (f));
X do
X {
X c = *buf++;
X if (c == '\0')
X {
X if (f == 0 || count != 0)
X return (count);
X else
X return (EOF);
X }
X else
X ++chars;
X } while (WHITE (c));
X UNGETC (c);
X }
X else if (f != '%')
X {
X NEXT (c);
X if (c != f)
X return (count);
X ++fmt;
X }
X else
X {
X assign = TRUE; width = INT_MAX;
X char_ptr = NULL;
X ++fmt;
X if (*fmt == '*')
X {
X assign = FALSE;
X ++fmt;
X }
X if (isdigit (*fmt))
X {
X width = 0;
X while (isdigit (*fmt))
X width = width * 10 + (*fmt++ - '0');
X if (width == 0) width = INT_MAX;
X }
X size = 0;
X if (*fmt == 'h' || *fmt == 'l')
X size = *fmt++;
X f = *fmt;
X switch (f)
X {
X case 'c':
X if (width == INT_MAX)
X width = 1;
X if (assign)
X char_ptr = va_arg (arg_ptr, char *);
X while (width > 0)
X {
X --width;
X NEXT (c);
X if (assign)
X {
X *char_ptr++ = (char)c;
X ++count;
X }
X }
X break;
X case '[':
X (void)memset (map, 0, 256);
X end = 0;
X ++fmt;
X if (*fmt == '^')
X {
X ++fmt; end = 1;
X }
X i = 0;
X for (;;)
X {
X f = (unsigned char)*fmt;
X switch (f)
X {
X case 0:
X --fmt; /* avoid skipping past 0 */
X NEXT (c);
X goto string;
X case ']':
X if (i > 0)
X {
X NEXT (c);
X goto string;
X }
X /* no break */
X default:
X if (fmt[1] == '-' && fmt[2] != 0 &&
X f < (unsigned char)fmt[2])
X {
X (void)memset (map+f, 1, (unsigned char)fmt[2]-f);
X fmt += 2;
X }
X else
X map[f] = 1;
X break;
X }
X ++fmt; ++i;
X }
X case 's':
X (void)memset (map, 0, 256);
X map[' '] = 1;
X map['\n'] = 1;
X map['\t'] = 1;
X end = 1;
X do
X {
X NEXT (c);
X } while (WHITE (c));
Xstring:
X if (assign)
X char_ptr = va_arg (arg_ptr, char *);
X while (width > 0 && map[(unsigned char)c] != end)
X {
X --width;
X if (assign)
X *char_ptr++ = (char)c;
X c = *buf++;
X if (c == '\0')
X break;
X else
X ++chars;
X }
X if (assign)
X {
X *char_ptr = 0;
X ++count;
X }
X if (c == '\0')
X return (count);
X else
X UNGETC (c);
X break;
X case 'f':
X case 'e':
X case 'E':
X case 'g':
X case 'G':
X neg = ok = FALSE; dx = 0.0;
X do
X {
X NEXT (c);
X } while (WHITE (c));
X if (c == '+')
X {
X NEXT (c); --width;
X }
X else if (c == '-')
X {
X neg = TRUE; NEXT (c); --width;
X }
X while (width > 0 && isdigit (c))
X {
X --width;
X dx = dx * 10.0 + (double)(c - '0');
X ok = TRUE;
X c = *buf++;
X if (c == '\0')
X break;
X else
X ++chars;
X }
X if (width > 0 && c == '.')
X {
X --width;
X dd = 10.0; NEXT (c);
X while (width > 0 && isdigit (c))
X {
X --width;
X dx += (double)(c - '0') / dd;
X dd *= 10.0;
X ok = TRUE;
X c = *buf++;
X if (c == '\0')
X break;
X else
X ++chars;
X }
X }
X if (!ok)
X return (count);
X if (width > 0 && (c == 'e' || c == 'E'))
X {
X eneg = FALSE; exp = 0; NEXT (c); --width;
X if (width > 0 && c == '+')
X {
X NEXT (c); --width;
X }
X else if (width > 0 && c == '-')
X {
X eneg = TRUE; NEXT (c); --width;
X }
X if (!(width > 0 && isdigit (c)))
X {
X UNGETC (c);
X return (count);
X }
X while (width > 0 && isdigit (c))
X {
X --width;
X exp = exp * 10 + (c - '0');
X c = *buf++;
X if (c == '\0')
X break;
X else
X ++chars;
X }
X if (eneg) exp = -exp;
X while (exp > 0)
X {
X dx *= 10.0;
X --exp;
X }
X while (exp < 0)
X {
X dx /= 10.0;
X ++exp;
X }
X }
X if (assign)
X {
X if (neg) dx = -dx;
X if (size == 'l')
X {
X dbl_ptr = va_arg (arg_ptr, double *);
X *dbl_ptr = dx;
X }
X else
X {
X flt_ptr = va_arg (arg_ptr, float *);
X *flt_ptr = (float)dx;
X }
X ++count;
X }
X if (c == '\0')
X return (count);
X else
X UNGETC (c);
X break;
X case 'i':
X neg = FALSE; radix = 10;
X do
X {
X NEXT (c);
X } while (WHITE (c));
X if (!(width > 0 && c == '0'))
X goto scan_complete_number;
X NEXT (c); --width;
X if (width > 0 && (c == 'x' || c == 'X'))
X {
X NEXT (c); radix = 16; --width;
X }
X else if (width > 0 && (c >= '0' && c <= '7'))
X radix = 8;
X goto scan_unsigned_number;
X case 'd':
X case 'u':
X case 'o':
X case 'x':
X case 'X':
X do
X {
X NEXT (c);
X } while (WHITE (c));
X switch (f)
X {
X case 'o': radix = 8; break;
X case 'x': case 'X': radix = 16; break;
X default: radix = 10; break;
X }
Xscan_complete_number:
X neg = FALSE;
X if (width > 0 && c == '+')
X {
X NEXT (c); --width;
X }
X else if (width > 0 && c == '-' && radix == 10)
X {
X neg = TRUE; NEXT (c); --width;
X }
Xscan_unsigned_number:
X n = 0; ok = FALSE;
X while (width > 0)
X {
X --width;
X if (isdigit (c))
X d = c - '0';
X else if (isupper (c))
X d = c - 'A' + 10;
X else if (islower (c))
X d = c - 'a' + 10;
X else
X break;
X if (d < 0 || d >= radix)
X break;
X ok = TRUE;
X n = n * radix + d;
X c = *buf++;
X if (c == '\0')
X break;
X else
X ++chars;
X }
X if (!ok)
X return (count);
X if (assign)
X {
X if (neg) n = -n;
X switch(size)
X {
X case 'h':
X short_ptr = va_arg (arg_ptr, short *);
X *short_ptr = (short)n;
X break;
X case 'l':
X long_ptr = va_arg (arg_ptr, long *);
X *long_ptr = (long)n;
X break;
X default:
X int_ptr = va_arg (arg_ptr, int *);
X *int_ptr = (int)n;
X }
X ++count;
X }
X if (c == '\0')
X return (count);
X else
X UNGETC (c);
X break;
X case 'n':
X if (assign)
X {
X int_ptr = va_arg (arg_ptr, int *);
X *int_ptr = chars;
X ++count;
X }
X break;
X default:
X if (f == 0) /* % at end of string */
X return (count);
X NEXT (c);
X if (c != f)
X return (count);
X break;
X }
X ++fmt;
X }
X }
X return (count);
X}
END_OF_FILE
if test 12556 -ne `wc -c <'private/_vsscanf.c'`; then
echo shar: \"'private/_vsscanf.c'\" unpacked with wrong size!
fi
# end of 'private/_vsscanf.c'
fi
if test -f 'tools/buildlrf.def' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tools/buildlrf.def'\"
else
echo shar: Extracting \"'tools/buildlrf.def'\" \(74 characters\)
sed "s/^X//" >'tools/buildlrf.def' <<'END_OF_FILE'
XNAME buildlrf windowcompat
X
XDESCRIPTION 'test'
X
XPROTMODE
X
XSTACKSIZE 32767
END_OF_FILE
if test 74 -ne `wc -c <'tools/buildlrf.def'`; then
echo shar: \"'tools/buildlrf.def'\" unpacked with wrong size!
fi
# end of 'tools/buildlrf.def'
fi
echo shar: End of archive 2 \(of 11\).
cp /dev/null ark2isdone
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: curspriv.h demos/testcurs.c makefile private/_setrows.c
# private/_validch.c
# Wrapped by kent@sparky on Wed Nov 18 21:44:06 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 3 (of 11)."'
if test -f 'curspriv.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'curspriv.h'\"
else
echo shar: Extracting \"'curspriv.h'\" \(9131 characters\)
sed "s/^X//" >'curspriv.h' <<'END_OF_FILE'
X/*
X* $Header: c:/curses/RCS/curspriv.h%v 2.0 1992/11/16 22:40:39 MH Rel $
X*
X* CURSPRIV.H
X*
X* Header file for definitions and declarations for the
X* PDCurses package. These definitions should not be generally
X* accessible to programmers, but are provided if the applications
X* programmer decides to make the decision in favor of speed on a
X* PC over portability.
X*
X* Revision History:
X* Frotz 1.5Beta 900714 Added many levels of compiler support.
X* Added mixed prototypes for all "internal" routines.
X* Removed all assembly language. Added EGA/VGA
X* support. Converted all #ifdef to #if in all
X* modules except CURSES.H and CURSPRIV.H.
X* Always include ASSERT.H. Added support for an
X* external malloc(), calloc() and free().
X* Added support for FAST_VIDEO (direct-memory writes).
X* Added various memory model support (for FAST_VIDEO).
X* Added much of the December 1988 X/Open Curses
X* specification.
X* bl 1.3 881005 All modules lint-checked with MSC '-W3' and turbo'C'
X* '-w -w-pro' switches.
X* bl 1.2 881002 Support (by #ifdef UCMASM) for uppercase-only
X* assembly routine names. If UCMASM if defined,
X* all assembler names are #defined as upper case.
X* Not needed if you do "MASM /MX. Also missing
X* declaration of cursesscroll(). Fixes thanks to
X* N.D. Pentcheff
X* bl 1.1 880306 Add _chadd() for raw output routines.
X* bl 1.0 870515 Release.
X*
X*/
X
X#ifndef __CURSES_INTERNALS__
X#define __CURSES_INTERNALS__
X
X/* Always include... */
X#include <assert.h>
X
X/*----------------------------------------------------------------------
X* OPERATING SYSTEM SUPPORT:
X*
X* DOS The one we all know and love:-}
X* OS/2 The new kid on the block.
X* FLEXOS A Real-time, protected-mode OS from
X* Digital Research, Inc.
X* (AKA, the 4680 from IBM...)
X*/
X
X/*----------------------------------------*/
X#ifdef DOS
X# define FAST_VIDEO 1 /* We can write directly to the screen. */
X typedef union REGS Regs;
X extern Regs regs;
X#endif
X
X/*----------------------------------------*/
X#ifdef FLEXOS
X# define FAST_VIDEO 1 /* We can use scopy() */
X# define GMODE 0 /* KLUDGE ALERT!
X * GMODE == 0 defines character mode structures in FLEXTAB.H.
X * GMODE == 1 defines graphics mode structures in FLEXTAB.H.
X */
X#include <flextab.h>
Xextern VIRCON vir;
X#endif
X
X
X
X
X/*----------------------------------------------------------------------
X* MEMORY MODEL SUPPORT:
X*
X* MODELS
X* TINY cs,ds,ss all in 1 segment (not enough memory!)
X* SMALL cs:1 segment, ds:1 segment
X* MEDIUM cs:many segments ds:1 segment
X* COMPACT cs:1 segment, ds:many segments
X* LARGE cs:many segments ds:many segments
X* HUGE cs:many segments ds:segments > 64K
X*/
X#ifdef __TINY__
X# define SMALL 1
X#endif
X#ifdef __SMALL__
X# define SMALL 1
X#endif
X#ifdef __MEDIUM__
X# define MEDIUM 1
X#endif
X#ifdef __COMPACT__
X# define COMPACT 1
X#endif
X#ifdef __LARGE__
X# define LARGE 1
X#endif
X#ifdef __HUGE__
X# define HUGE 1
X#endif
X
X
X
X
X/*----------------------------------------------------------------------
X* MALLOC DEBUGGING SUPPORT:
X*
X* Set EMALLOC and EMALLOC_MAGIC in order to use your private
X* versions of malloc(), calloc(), and free(). This can help,
X* but not solve, your malloc problems when debugging...
X*
X*/
X#ifndef INTERNAL
X# define EMALLOC 0 /* Disable External Malloc */
X#else
X# define EMALLOC 0 /* Enable/Disable External Malloc */
X# define EMALLOC_MAGIC 0x0C0C /* Our magic indicator that we should */
X /* use our external malloc rather than */
X /* the runtime's malloc. */
X#endif
X
X
X/*----------------------------------------------------------------------*/
X/* window properties */
X#define _SUBWIN 0x01 /* window is a subwindow */
X#define _ENDLINE 0x02 /* last winline is last screen line */
X#define _FULLWIN 0x04 /* window fills screen */
X#define _SCROLLWIN 0x08 /* window lwr rgt is screen lwr rgt */
X#define _PAD 0x10 /* X/Open Pad. */
X
X
X
X
X/*----------------------------------------------------------------------*/
X/* Miscellaneous */
X#define _INBUFSIZ 512 /* size of terminal input buffer */
X#define _NO_CHANGE -1 /* flags line edge unchanged */
X
X
X
X
X/* @@@ THESE SHOULD BE INDIVIDUAL FUNCTIONS, NOT MACROS! */
X#define _ECHAR 0x08 /* Erase char (^H) */
X#define _DWCHAR 0x17 /* Delete Word char (^W) */
X#define _DLCHAR 0x15 /* Delete Line char (^U) */
X#define _GOCHAR 0x11 /* ^Q character */
X#define _PRINTCHAR 0x10 /* ^P character */
X#define _STOPCHAR 0x13 /* ^S character */
X#define NUNGETCH 20 /* max # chars to ungetch() */
X
X
X
X
X/* Setmode stuff */
Xstruct cttyset
X{
X bool been_set;
X SCREEN saved;
X};
X
Xextern struct cttyset c_sh_tty; /* tty modes for shell_mode */
Xextern struct cttyset c_pr_tty; /* tty modes for prog_mode */
Xextern struct cttyset c_save_tty;
Xextern struct cttyset c_save_trm;
X
X/* Printscan stuff */
Xextern char c_printscanbuf[]; /* buffer used during I/O */
X
X/* Strget stuff */
Xextern char* c_strbeg;
X
X/* doupdate stuff */
Xextern WINDOW* twin; /* used by many routines */
X
X/* Monitor (terminal) type information */
X#define _NONE 0x00
X#define _MDA 0x01
X#define _CGA 0x02
X#define _EGACOLOR 0x04
X#define _EGAMONO 0x05
X#define _VGACOLOR 0x07
X#define _VGAMONO 0x08
X#define _MCGACOLOR 0x0a
X#define _MCGAMONO 0x0b
X#define _FLEXOS 0x20 /* A Flexos console */
X#define _MDS_GENIUS 0x30
X
X/* Text-mode font size information */
X#define _FONT8 8
X#define _FONT14 14
X#define _FONT15 15 /* GENIUS */
X#define _FONT16 16
X
X
X/*----------------------------------------------------------------------
X* ANSI C prototypes. Be sure that your compiler conditional
X* compilation definitions above define ANSI to be non-zero
X* if you compiler supports prototypes.
X*/
X#ifdef ANSI
X# ifdef CPLUSPLUS
X extern "C" {
X# endif
Xbool PDC_check_bios_key( void );
Xbool PDC_get_ctrl_break( void );
Xbool PDC_transformline( int );
Xchtype PDC_validchar( chtype );
Xint PDC_backchar( WINDOW*, char*, int* );
Xint PDC_scr_open( SCREEN*, bool );
Xint PDC_scr_close( void );
Xint PDC_get_cursor_pos( int*, int* );
Xint PDC_get_columns( void );
Xint PDC_scroll( int, int, int, int, int, chtype );
Xint PDC_set_ctrl_break( bool );
Xint PDC_clr_update( WINDOW* );
Xint PDC_chadd( WINDOW*, chtype, bool, bool );
Xint PDC_chins( WINDOW*, chtype, bool );
X#ifdef OS2
XVIOCONFIGINFO PDC_query_adapter_type( void );
XVIOMODEINFO PDC_get_scrn_mode( void );
Xint PDC_set_scrn_mode( VIOMODEINFO );
Xbool PDC_scrn_modes_equal (VIOMODEINFO, VIOMODEINFO);
X#else
Xint PDC_query_adapter_type( void );
Xint PDC_get_scrn_mode( void );
Xint PDC_set_scrn_mode( int );
Xbool PDC_scrn_modes_equal (int, int);
X#endif
Xint PDC_get_font( void );
Xint PDC_set_font( int );
Xint PDC_set_80x25( void );
Xint PDC_fix_cursor( int );
Xint PDC_get_rows( void );
Xint PDC_set_rows( int );
Xint PDC_putchar( chtype );
Xint PDC_clr_scrn( WINDOW* );
Xint PDC_gattr( void );
Xint PDC_gotoxy( int, int );
Xint PDC_print( int, int, int );
Xint PDC_chg_attr( WINDOW*, chtype, int, int, int, int );
Xint PDC_split_plane( WINDOW*, char*, char*, int, int, int, int );
Xint PDC_sanity_check( int );
Xint PDC_get_cursor_mode( void );
Xint PDC_set_cursor_mode( int, int );
Xint PDC_get_bios_key( void );
Xint PDC_putc( chtype, chtype );
Xint PDC_putctty( chtype, chtype );
Xsigned PDC_rawgetch( void );
Xsigned PDC_sysgetch( void );
Xvoid PDC_usleep( long );
XWINDOW* PDC_makenew( int, int, int, int );
X
X#ifdef FLEXOS
Xint PDC_flexos_8bitmode( void );
Xint PDC_flexos_16bitmode( void );
Xchar* PDC_flexos_gname( void );
X#endif
X
X#ifdef REGISTERWINDOWS
Xbool PDC_inswin( WINDOW*, WINDOW* );
Xint PDC_addtail( WINDOW* );
Xint PDC_addwin( WINDOW*, WINDOW* );
Xint PDC_rmwin( WINDOW* );
XWINDS* PDC_findwin( WINDOW* );
X#endif
X# ifdef CPLUSPLUS
X }
X# endif
X#endif
X
X#define MAX_ATRTAB 272
X
X/* internal macros for attributes */
X#define chtype_attr(ch) ((atrtab[((ch >> 8) & 0xFF)] << 8) & A_ATTRIBUTES)
X#define phys_attr(ch) (atrtab[((ch >> 8) & 0xFF)])
X
X#endif /* __CURSES_INTERNALS__*/
END_OF_FILE
if test 9131 -ne `wc -c <'curspriv.h'`; then
echo shar: \"'curspriv.h'\" unpacked with wrong size!
fi
# end of 'curspriv.h'
fi
if test -f 'demos/testcurs.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'demos/testcurs.c'\"
else
echo shar: Extracting \"'demos/testcurs.c'\" \(9169 characters\)
sed "s/^X//" >'demos/testcurs.c' <<'END_OF_FILE'
X/*
X *
X * This is a test program for the PDCurses screen package for IBM PC type
X * machines.
X * This program was written by John Burnell (jo...@kea.am.dsir.govt.nz)
X * To compile this program with your compiler define or leave undefined
X * the following preprocessor macros:
X * PROTO - define if your compiler accepts standard ANSI-C function prototypes
X * COLOR_CURSES - define if your curses library has color support
X *
X */
X#define PROTO
X#define COLOR_CURSES
X
X#include <stdio.h>
X#include <curses.h>
X
X#ifdef PROTO
Xvoid inputTest (WINDOW *win);
Xvoid scrollTest (WINDOW *win, int height, int width);
Xint introTest (WINDOW *win);
Xint initTest (WINDOW **win, int *height, int *width);
Xvoid outputTest (WINDOW *win);
Xvoid padTest (void);
Xvoid resizeTest (void);
X#else
Xvoid inputTest ();
Xvoid scrollTest ();
Xint introTest ();
Xint initTest ();
Xvoid outputTest ();
Xvoid padTest ();
Xvoid resizeTest ();
X#endif
X
Xmain()
X{
XWINDOW *win;
Xint width, height;
X
X if (!initTest (&win, &height, &width)) {return 1;}
X
X padTest ();
X
X introTest (win);
X
X resizeTest ();
X
X scrollTest (win, height, width);
X
X inputTest (win);
X
X outputTest (win);
X
X delwin (win);
X
X endwin();
X return 0;
X}
X#ifdef PROTO
Xvoid Continue (WINDOW *win)
X#else
Xvoid Continue (win)
XWINDOW *win;
X#endif
X{
X wmove(win, 10, 1);
X wclrtoeol(win);
X mvwaddstr(win, 10, 1, " Press any key to continue");
X wrefresh(win);
X raw();
X wgetch(win);
X}
X#ifdef PROTO
Xint initTest (WINDOW **win, int *height, int *width)
X#else
Xint initTest (win, height, width)
XWINDOW **win;
Xint *height;
Xint *width;
X#endif
X{
X initscr();
X#ifdef COLOR_CURSES
X if (has_colors())
X start_color();
X#endif
X *width = 60;
X *height = 13; /* Create a drawing window */
X *win = newwin(*height, *width, (LINES-*height)/2, (COLS-*width)/2);
X if(*win == NULL)
X { endwin();
X return 1;
X }
X}
X#ifdef PROTO
Xint introTest (WINDOW *win)
X#else
Xint introTest (win)
XWINDOW *win;
X#endif
X{
X beep ();
X#ifdef COLOR_CURSES
X if (has_colors())
X init_pair(1,COLOR_WHITE,COLOR_BLUE);
X wattrset(win, COLOR_PAIR(1));
X#else
X wattrset(win, A_REVERSE);
X#endif
X werase(win);
X
X box(win, 0xba, 0xcd);
X wrefresh(win);
X cbreak ();
X mvwaddstr(win, 1, 1, "You should have rectangle in the middle of the screen");
X mvwaddstr(win, 2, 1, "You should have heard a beep");
X Continue(win);
X return 1;
X}
X#ifdef PROTO
Xvoid scrollTest (WINDOW *win, int height, int width)
X#else
Xvoid scrollTest (win, height, width)
XWINDOW *win;
Xint height,width;
X#endif
X{
X int i;
X int OldX, OldY;
X char *Message = "The window will now scroll slowly";
X
X mvwprintw (win, height - 2, 1, Message);
X wrefresh (win);
X scrollok(win, TRUE);
X for (i = 1; i <= height; i++) {
X delay_output (250);
X scroll(win);
X wrefresh (win);
X };
X
X getmaxyx (win, OldY, OldX);
X mvwprintw (win, 6, 1, "The top of the window will scroll");
X wmove (win, 1, 1);
X wsetscrreg (win, 0, 4);
X box(win, 0xba, 0xcd);
X wrefresh (win);
X for (i = 1; i <= 5; i++) {
X delay_output (500);
X scroll(win);
X wrefresh (win);
X };
X wsetscrreg (win, 0, --OldY);
X
X}
X#ifdef PROTO
Xvoid inputTest (WINDOW *win)
X#else
Xvoid inputTest (win)
XWINDOW *win;
X#endif
X{
X int w, h, bx, by, sw, sh, i, c;
X char buffer [80];
X WINDOW *subWin;
X wclear (win);
X
X w = win->_maxx;
X h = win->_maxy;
X bx = win->_begx;
X by = win->_begy;
X sw = w / 3;
X sh = h / 3;
X if((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == NULL)
X return;
X
X#ifdef COLOR_CURSES
X if (has_colors())
X init_pair(2,COLOR_CYAN,COLOR_BLUE);
X wattrset(subWin, COLOR_PAIR(2) | A_BOLD);
X#else
X wattrset(subWin, A_BOLD);
X#endif
X box(subWin, 0xba, 0xcd);
X wrefresh(win);
X
X nocbreak();
X mvwaddstr(win, 2, 1, "Press some keys for 5 seconds");
X mvwaddstr(win, 1, 1, "Pressing ^C should do nothing");
X wrefresh(win);
X
X for (i = 0; i < 5; i++) {
X werase (subWin);
X box(subWin, 0xba, 0xcd);
X mvwprintw (subWin, 1, 1, "Time = %d", i);
X wrefresh(subWin);
X delay_output(1000);
X flushinp();
X }
X
X delwin (subWin);
X werase(win);
X flash();
X wrefresh(win);
X delay_output(500);
X
X if (typeahead(NULL)) beep();
X mvwaddstr(win, 2, 1, "Press a key, followed by ENTER");
X wmove(win, 9, 10);
X wrefresh(win);
X echo();
X noraw();
X wgetch(win);
X flushinp();
X
X wmove(win, 9, 10);
X wdelch(win);
X mvwaddstr(win, 4, 1, "The character should now have been deleted");
X Continue(win);
X
X wclear (win);
X mvwaddstr(win, 2, 1, "Press an arrow key");
X wrefresh(win);
X keypad(win, TRUE);
X raw();
X c = wgetch(win);
X
X nodelay(win, TRUE);
X wgetch(win);
X nodelay(win, FALSE);
X
X refresh();
X wclear (win);
X mvwaddstr(win, 3, 2, "The window should have moved");
X mvwaddstr(win, 4, 2, "This text should have appeared without you pressing a key");
X mvwprintw(win, 2, 2, "Keycode = %d", c);
X mvwaddstr(win, 6, 2, "Enter a string");
X mvwin(win, 2, 1);
X wrefresh(win);
X mvwscanw(win, 7, 6, "%s", buffer);
X}
X#ifdef PROTO
Xvoid outputTest (WINDOW *win)
X#else
Xvoid outputTest (win)
XWINDOW *win;
X#endif
X{
X WINDOW *win1;
X char Buffer [80];
X chtype ch;
X
X nl ();
X wclear (win);
X mvwaddstr(win, 1, 1, "You should now have a screen in the upper left corner, and this text should have wrapped");
X Continue(win);
X
X wclear(win);
X mvwaddstr(win, 1, 1, "A new window will appear with this text in it");
X mvwaddstr(win, 8, 1, "Press any key to continue");
X wrefresh(win);
X wgetch(win);
X
X win1 = newwin(10, 50, 15, 25);
X if(win1 == NULL)
X { endwin();
X return;
X }
X#ifdef COLOR_CURSES
X if (has_colors())
X init_pair(3,COLOR_BLUE,COLOR_WHITE);
X wattrset(win1, COLOR_PAIR(3));
X#else
X wattrset(win1, A_NORMAL);
X#endif
X wclear (win1);
X mvwaddstr(win1, 5, 1, "This text should not appear");
X overwrite(win, win1);
X
X box(win1,0xb3,0xc4);
X wmove(win1, 8, 26);
X wrefresh(win1);
X wgetch(win1);
X
X wclear(win1);
X wattron(win1, A_BLINK);
X mvwaddstr(win1, 4, 1, "This blinking text should appear in only the second window");
X wattroff(win1, A_BLINK);
X overlay(win, win1);
X wmove(win1, 8, 26);
X wrefresh(win1);
X wgetch(win1);
X delwin(win1);
X
X clear();
X wclear(win);
X wrefresh(win);
X mvwaddstr(win, 6, 2, "This line shouldn't appear");
X mvwaddstr(win, 4, 2, "Only half of the next line is visible");
X mvwaddstr(win, 5, 2, "Only half of the next line is visible");
X wmove(win, 6, 1);
X wclrtobot (win);
X wmove(win, 5, 20);
X wclrtoeol (win);
X mvwaddstr(win, 8, 2, "This line also shouldn't appear");
X wmove(win, 8, 1);
X wdeleteln(win);
X Continue(win);
X
X wmove (win, 5, 9);
X ch = winch (win);
X
X wclear(win);
X wmove (win, 6, 2);
X waddstr (win, "The next char should be l: ");
X winsch (win, ch);
X Continue(win);
X
X wmove(win, 5, 1);
X winsertln (win);
X mvwaddstr(win, 5, 2, "The lines below should have moved down");
X Continue(win);
X
X wclear(win);
X wmove(win, 2, 2);
X wprintw(win, "This is a formatted string in a window: %d %s\n", 42, "is it");
X mvwaddstr(win, 10, 1, "Enter a string: ");
X wrefresh(win);
X wscanw (win, "%s", Buffer);
X
X wclear(win);
X mvwaddstr(win, 10, 1, "Enter a string");
X wrefresh(win);
X printw("This is a formatted string in stdscr: %d %s\n", 42, "is it");
X scanw ("%s", Buffer);
X
X wclear(win);
X curs_set(2);
X mvwaddstr(win, 1, 1, "The cursor should appear as a block");
X Continue(win);
X
X wclear(win);
X curs_set(0);
X mvwaddstr(win, 1, 1, "The cursor should have disappeared");
X Continue(win);
X
X wclear(win);
X curs_set(1);
X mvwaddstr(win, 1, 1, "The cursor should be an underline");
X Continue(win);
X}
X
X#ifdef PROTO
Xvoid resizeTest(void)
X#else
Xvoid resizeTest()
X#endif
X{
X WINDOW *win1;
X char Buffer [80];
X chtype ch;
X
X savetty ();
X
X clear();
X refresh();
X resize(50);
X
X
X win1 = newwin(11, 50, 14, 25);
X if(win1 == NULL)
X { endwin();
X return;
X }
X init_pair(3,COLOR_BLUE,COLOR_WHITE);
X wattrset(win1, COLOR_PAIR(3));
X wclear (win1);
X
X mvwaddstr(win1, 1, 1, "The screen may now have 50 lines");
X Continue(win1);
X
X resetty ();
X
X wclear (win1);
X mvwaddstr(win1, 1, 1, "The screen should now be reset");
X Continue(win1);
X
X delwin(win1);
X
X clear();
X refresh();
X
X}
X#ifdef PROTO
Xvoid padTest(void)
X#else
Xvoid padTest()
X#endif
X{
XWINDOW *pad;
X
X pad = newpad(50,100);
X mvwaddstr(pad, 5, 2, "This is a new pad");
X mvwaddstr(pad, 8, 0, "The end of this line should be truncated here:abcd");
X mvwaddstr(pad,11, 1, "This line should not appear.");
X wmove(pad, 10, 1);
X wclrtoeol(pad);
X mvwaddstr(pad, 10, 1, " Press any key to continue");
X prefresh(pad,0,0,0,0,10,45);
X keypad(pad, TRUE);
X raw();
X wgetch(pad);
X
X mvwaddstr(pad, 35, 2, "This is displayed at line 35 in the pad");
X mvwaddstr(pad, 40, 1, " Press any key to continue");
X prefresh(pad,30,0,0,0,10,45);
X keypad(pad, TRUE);
X raw();
X wgetch(pad);
X
X delwin(pad);
X}
X
END_OF_FILE
if test 9169 -ne `wc -c <'demos/testcurs.c'`; then
echo shar: \"'demos/testcurs.c'\" unpacked with wrong size!
fi
# end of 'demos/testcurs.c'
fi
if test -f 'makefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'makefile'\"
else
echo shar: Extracting \"'makefile'\" \(22856 characters\)
sed "s/^X//" >'makefile' <<'END_OF_FILE'
X# $Header: c:/curses/RCS/makefile.%v 2.0 1992/11/16 22:40:49 MH Rel $
X#================ PDCurses makefile for DMAKE 3.8 ======================
X# This makefile is for DMAKE, either under DOS or OS/2
X# The fowwoing OS/Compiler combinations are supported:
X#
X# Target Compiler Command Compiler
X# Operating Mnemoic Line
X# System
X#-----------------------------------------------------------------------
X# DOS BCC OS=DOS COMP=BCC Borland C++
X# DOS TCC OS=DOS COMP=TCC Borland Turbo C++
X# DOS TC OS=DOS COMP=TC Borland Turbo C
X# DOS MSC OS=DOS COMP=MSC Microsoft C
X# DOS QC OS=DOS COMP=QC Microsoft Quick C
X# OS2 MSC OS=OS2 COMP=MSC Microsoft C
X# OS2 CSET2 OS=OS2 COMP=CSET2 IBM C Set/2
X# OS2 EMX OS=OS2 COMP=EMX emx/gcc
X# OS2 TSC OS=OS2 COMP=TSC TopSpeed C
X# OS2 WATCOMC OS=OS2 COMP=WATCOMC Watcom C
X#-----------------------------------------------------------------------
X# Special case for Microsoft Compiler when the host OS is DOS and the
X# target OS is OS2:
X# Command line will be OS=DOS COMP=MSC TOS=OS2
X#-----------------------------------------------------------------------
XMODEL = L
Xmodel = l
X#-----------------------------------------------------------------------
X# default setup for BCC under DOS, optimised version
X# change values below or override with -e switch on command line
X#-----------------------------------------------------------------------
XOS=DOS
XCOMP=BCC
XOPT=Y
X#-----------------------------------------------------------------------
X.IF $(TOS) == $(NULL)
X TOS = $(OS)
X.END
X.IF $(OS) == OS2
X#========================================================================
X#========================= OS2 - CSET2 ==================================
X#========================================================================
X .IF $(COMP) == CSET2
X LINK = link386
X CC = icc
X LIB_EXE = lib
X LIB_DIR = g:\ibmc\lib
X SETARGV = $(LIB_DIR)\setargv
X .IF $(OPT) == N
X CDEBUG = -Q+ -O- -Ti -I$(CC_INC)
X LDEBUG = /NOE /SE:160 /PMTYPE:VIO
X DBG =d
X .ELSE
X CDEBUG = -Q+ -O+ -DNDEBUG -I$(CC_INC)
X LDEBUG = /NOE /SE:160 /PMTYPE:VIO
X DBG =o
X .END
X OBJ = obj
X OBJ_DIR = o$(DBG)
X PDCLIB = curses$(DBG).lib
X LIBRSP =,lib.map;
X CFLAGS = $(CDEBUG) -Fo$@ -c -I$(CC_INC)
X MAKE_LIB = $(LIB_EXE) $(PDCLIB) $(LIBFLAGS) @$(LRF)
X DLFLAGS = $(LDEBUG) $*.obj,,,$(PDCLIB);
X UTLFLAGS = $(LDEBUG) $*.obj;
X MANFLAGS = $(LDEBUG) $*.obj+$(SETARGV);
X#========================================================================
X#========================= OS2 - MSC ====================================
X#========================================================================
X .ELIF $(COMP) == MSC
X LINK = link
X CC = cl
X LIB_EXE = lib
X LIB_DIR = $(LIB)
X SETARGV = $(LIB_DIR)\setargv
X DEFINES = -D__OS2__
X .IF $(OPT) == N
X CDEBUG =-nologo -Od -Zi -A$(MODEL)
X LDEBUG =/CO /NOE /SE:160 /PMTYPE:VIO
X DBG =d
X .ELSE
X CDEBUG =-nologo -Ox -A$(MODEL) -DNDEBUG
X LDEBUG = /NOE /SE:160 /PMTYPE:VIO
X DBG =o
X .END
X OBJ = obj
X OBJ_DIR = o$(DBG)$(MODEL)
X PDCLIB = $(MODEL)curses$(DBG).lib
X LIBRSP =,lib.map;
X CFLAGS = $(CDEBUG) $(DEFINES) -Fo$@ -c -I$(CC_INC)
X MAKE_LIB = $(LIB_EXE) $(PDCLIB) $(LIBFLAGS) @$(LRF)
X DLFLAGS = $(LDEBUG) $*.obj,,,$(PDCLIB);
X UTLFLAGS = $(LDEBUG) $*.obj;
X MANFLAGS = $(LDEBUG) $*.obj+$(SETARGV);
X#========================================================================
X#========================= OS2 - EMX ====================================
X#========================================================================
X .ELIF $(COMP) == EMX
X LINK = $(CC)
X CC = gcc
X LIB_EXE = ar
X LIB_DIR = g:\emx\lib
X LIBFLAGS = rcv
X DEFINES = -D__OS2__ -D__EMX__
X .IF $(OPT) == N
X CDEBUG =-g
X LDEBUG = -Zomf
X DBG =d
X .ELSE
X CDEBUG =-O -DNDEBUG
X LDEBUG = -Zomf
X DBG =o
X .END
X OBJ = o
X OBJ_DIR = o$(DBG)
X PDCLIB = curses$(DBG).lib
X LIBRSP =,lib.map;
X CFLAGS = $(CDEBUG) $(DEFINES) -o$(@:db).o -c -I$(CC_INC)
X MAKE_LIB = $(LIB_EXE) $(LIBFLAGS) curses.a $(OBJ_DIR)/*.o
X EMX_OMF_LIB=emxomf -l -o $(PDCLIB) curses.a
X EMX_OMF_OBJ=emxomf -d -o $*.obj $*.o
X DLFLAGS = $(LDEBUG) -L$(LIB_DIR) -lc -los2 $*.obj $(PDCLIB) $(LIB_DIR)\vio32.lib -o $* $(DEMO_DIR)\$*.def
X UTLFLAGS = $(LDEBUG) -L$(LIB_DIR) -lc -los2 $*.obj -o $* $(TOOLS_DIR)\$*.def
X MANFLAGS = $(LDEBUG) -Lg:\emx\lib -lc -los2 $*.obj -o $* $(TOOLS_DIR)\$*.def
X#========================================================================
X#========================= OS2 - TSC ====================================
X#========================================================================
X# If you can fill in the following, please let me know !
X#========================================================================
X .ELIF $(COMP) == TSC
X OBJ = obj
X#========================================================================
X#========================= OS2 - WATCOMC ================================
X#========================================================================
X# If you can fill in the following, please let me know !
X#========================================================================
X .ELIF $(COMP) == WATCOMC
X CC = cc
X OBJ = obj
X .END
X.ELSE
X#========================================================================
X#========================= DOS - BCC ====================================
X#========================================================================
X .IF $(COMP) == BCC
X LINK = tlink
X CC = bcc
X LIB_EXE = tlib
X LIB_DIR = f:\c\lib
X WILDARGS = $(LIB_DIR)\wildargs.obj
X LIB_FLAGS = /C /E
X CFG = +$(ROOTDIR)\PDCURSES.CFG
X DEFINES =
X .IF $(OPT) == N
X CDEBUG =-N -v -y
X LDEBUG =-c -v -s -l -e
X DBG =d
X .ELSE
X CDEBUG = -O -DNDEBUG
X LDEBUG =
X DBG =o
X .END
X OBJ = obj
X OBJ_DIR = o$(DBG)$(model)
X PDCLIB = $(model)curses$(DBG).lib
X LIBRSP =,lib.map
X CFLAGS = $(CFG) $(CDEBUG) $(DEFINES) -m$(model) -I$(CC_INC) -If:\c\include -o$@
X MAKE_LIB = $(LIB_EXE) $(PDCLIB) $(LIBFLAGS) @$(LRF)
X DLFLAGS = $(LDEBUG) $(LIB_DIR)\c0$(model).obj+$*.obj,$*,,$(PDCLIB)+$(LIB_DIR)\c$(model).lib;
X UTLFLAGS = $(LDEBUG) $(LIB_DIR)\c0$(model).obj+$*.obj,$*,,$(LIB_DIR)\c$(model).lib;
X MANFLAGS = $(LDEBUG) $(LIB_DIR)\c0$(model).obj+$*.obj+$(WILDARGS),$*,,$(LIB_DIR)\c$(model).lib;
X#========================================================================
X#========================= DOS - TCC ====================================
X#========================================================================
X .ELIF $(COMP) == TCC
X LINK = tlink
X CC = tcc
X LIB_EXE = tlib
X LIB_DIR = f:\c\lib
X WILDARGS = $(LIB_DIR)\wildargs.obj
X LIB_FLAGS = /C /E
X CFG = +$(ROOTDIR)\PDCURSES.CFG
X DEFINES =
X .IF $(OPT) == N
X CDEBUG =-N -v -y
X LDEBUG =-c -v -s -l -e
X DBG =d
X .ELSE
X CDEBUG = -O -DNDEBUG
X LDEBUG =
X DBG =o
X .END
X OBJ = obj
X OBJ_DIR = o$(DBG)$(model)
X PDCLIB = $(model)curses$(DBG).lib
X LIBRSP =,lib.map
X CFLAGS = $(CFG) $(CDEBUG) $(DEFINES) -m$(model) -I$(CC_INC) -If:\c\include -o$@
X MAKE_LIB = $(LIB_EXE) $(PDCLIB) $(LIBFLAGS) @$(LRF)
X DLFLAGS = $(LDEBUG) $(LIB_DIR)\c0$(model).obj+$*.obj,$*,,$(PDCLIB)+$(LIB_DIR)\c$(model).lib;
X UTLFLAGS = $(LDEBUG) $(LIB_DIR)\c0$(model).obj+$*.obj,$*,,$(LIB_DIR)\c$(model).lib;
X MANFLAGS = $(LDEBUG) $(LIB_DIR)\c0$(model).obj+$*.obj+$(WILDARGS),$*,,$(LIB_DIR)\c$(model).lib;
X#========================================================================
X#========================= DOS - MSC ====================================
X#========================================================================
X .ELIF $(COMP) == MSC
X LINK = link
X CC = cl
X LIB_EXE = lib
X SETARGV = $(LIB)\setargv
X .IF $(TOS) == OS2
X OS2LD = /PMTYPE:VIO
X DEFINES = -D__OS2__
X OS2LIB = $(LIB)\os2.lib
X PLUS =+
X RUNBIND = bind $*
X .END
X .IF $(OPT) == N
X CDEBUG =-nologo -Od -Zi -A$(MODEL)
X LDEBUG =/CO /NOE /SE:160 $(OS2LD)
X DBG =d
X .ELSE
X CDEBUG =-nologo -Ox -A$(MODEL) -DNDEBUG
X LDEBUG = /NOE /SE:160 $(OS2LD)
X DBG =o
X .END
X OBJ = obj
X OBJ_DIR = o$(DBG)$(MODEL)
X PDCLIB = $(MODEL)curses$(DBG).lib
X LIBRSP =,lib.map;
X CFLAGS = $(CDEBUG) $(DEFINES) -Fo$@ -c -I$(CC_INC)
X MAKE_LIB = $(LIB_EXE) $(PDCLIB) $(LIBFLAGS) @$(LRF)
X DLFLAGS = $(LDEBUG) $*.obj,,,$(PDCLIB)$(PLUS)$(OS2LIB);
X UTLFLAGS = $(LDEBUG) $*.obj,,,$(OS2LIB);
X MANFLAGS = $(LDEBUG) $*.obj+$(SETARGV),,,$(OS2LIB);
X#========================================================================
X#========================= DOS - QC =====================================
X#========================================================================
X .ELIF $(COMP) == QC
X LINK = link
X CC = qcc
X LIB_EXE = lib
X SETARGV = $(LIB)\setargv
X .IF $(OPT) == N
X CDEBUG =-Od -Zi -A$(MODEL)
X LDEBUG =/CO /NOE /SE:160
X DBG =d
X .ELSE
X CDEBUG =-Ox -A$(MODEL) -DNDEBUG
X LDEBUG = /NOE /SE:160
X DBG =o
X .END
X OBJ = obj
X OBJ_DIR = $(DBG)$(MODEL)
X PDCLIB = $(MODEL)curses$(DBG).lib
X LIBRSP =,lib.map;
X CFLAGS = $(CDEBUG) $(DEFINES) -Fo$@ -c -I$(CC_INC)
X MAKE_LIB = $(LIB_EXE) $(PDCLIB) $(LIBFLAGS) @$(LRF)
X DLFLAGS = $(LDEBUG) $*.obj,,,$(PDCLIB);
X UTLFLAGS = $(LDEBUG) $*.obj;
X MANFLAGS = $(LDEBUG) $*.obj+$(SETARGV);
X .END
X.END
X#-----------------------------------------------------------------------
XROOTDIR = c:\curses
XCC_INC = c:/curses
XPORT_DIR = $(ROOTDIR)\portable
XNONP_DIR = $(ROOTDIR)\nonport
XPRIV_DIR = $(ROOTDIR)\private
XFLEX_DIR = $(ROOTDIR)\flexos
XTOOLS_DIR = $(ROOTDIR)\tools
XDEMO_DIR = $(ROOTDIR)\demos
XDOC_DIR = $(ROOTDIR)\doc
XLRF = PDCurses.lrf
X#######################################################################
X#<<<<<< Nothing below here should need to be changed >>>>>>>>>>>>>>>>>>
X#######################################################################
X#
X# Header Files
X#
XHEADERS = $(CC_INC)\curses.h $(CC_INC)\curspriv.h $(CC_INC)\cursos2.h
X
X#######################################################################
X########################## First (default) target #####################
X#######################################################################
Xall: $(PDCLIB) demos manual
X#######################################################################
X############################ Demo Programs Targets ####################
X#######################################################################
Xdemos: $(PDCLIB) xmas.exe newdemo.exe testcurs.exe firework.exe
X
Xnewdemo.exe: $(PDCLIB) newdemo.obj
X $(LINK) $(DLFLAGS)
X
Xxmas.exe: $(PDCLIC) xmas.obj
X $(LINK) $(DLFLAGS)
X
Xtestcurs.exe: $(PDCLIB) testcurs.obj
X $(LINK) $(DLFLAGS)
X
Xfirework.exe: $(PDCLIB) firework.obj
X $(LINK) $(DLFLAGS)
X
X
Xnewdemo.obj: $(HEADERS) $(DEMO_DIR)\newdemo.c
X $(CC) $(CFLAGS) $(DEMO_DIR)\newdemo.c
X $(EMX_OMF_OBJ)
X
Xxmas.obj: $(HEADERS) $(DEMO_DIR)\xmas.c
X $(CC) $(CFLAGS) $(DEMO_DIR)\xmas.c
X $(EMX_OMF_OBJ)
X
Xtestcurs.obj: $(HEADERS) $(DEMO_DIR)\testcurs.c
X $(CC) $(CFLAGS) $(DEMO_DIR)\testcurs.c
X $(EMX_OMF_OBJ)
X
Xfirework.obj: $(HEADERS) $(DEMO_DIR)\firework.c
X $(CC) $(CFLAGS) $(DEMO_DIR)\firework.c
X $(EMX_OMF_OBJ)
X
X#######################################################################
X######################### Utility Program Targets ####################
X#######################################################################
X
Xbuildlrf.exe: buildlrf.obj
X $(LINK) $(UTLFLAGS)
X $(RUNBIND)
X
Xbuildlrf.obj: $(TOOLS_DIR)\buildlrf.c
X $(CC) $(CFLAGS) $(TOOLS_DIR)\buildlrf.c
X $(EMX_OMF_OBJ)
X
Xmanext.exe: manext.obj
X $(LINK) $(MANFLAGS)
X $(RUNBIND)
X
Xmanext.obj: $(TOOLS_DIR)\manext.c
X $(CC) $(CFLAGS) $(TOOLS_DIR)\manext.c
X $(EMX_OMF_OBJ)
X
X#######################################################################
X######################### Library Program Targets ####################
X#######################################################################
X#
X# Portable Curses Functions
X#
XPORT1 = $(OBJ_DIR)\baudrate.$(OBJ) $(OBJ_DIR)\beep.$(OBJ) $(OBJ_DIR)\box.$(OBJ) \
X $(OBJ_DIR)\canchang.$(OBJ) $(OBJ_DIR)\cbreak.$(OBJ) $(OBJ_DIR)\clearok.$(OBJ) \
X $(OBJ_DIR)\colorcon.$(OBJ) $(OBJ_DIR)\def_prog.$(OBJ) $(OBJ_DIR)\def_shel.$(OBJ) \
X $(OBJ_DIR)\delay_ou.$(OBJ) $(OBJ_DIR)\delwin.$(OBJ) $(OBJ_DIR)\doupdate.$(OBJ) \
X $(OBJ_DIR)\echo.$(OBJ) $(OBJ_DIR)\endwin.$(OBJ) $(OBJ_DIR)\erasecha.$(OBJ) \
X $(OBJ_DIR)\fixterm.$(OBJ) $(OBJ_DIR)\flash.$(OBJ) $(OBJ_DIR)\flushinp.$(OBJ)
X
XPORT2 = $(OBJ_DIR)\gettmode.$(OBJ) $(OBJ_DIR)\getyx.$(OBJ) $(OBJ_DIR)\has_ic.$(OBJ) \
X $(OBJ_DIR)\has_il.$(OBJ) $(OBJ_DIR)\hascolor.$(OBJ) $(OBJ_DIR)\idlok.$(OBJ) \
X $(OBJ_DIR)\initcolo.$(OBJ) $(OBJ_DIR)\initpair.$(OBJ) $(OBJ_DIR)\initscr.$(OBJ) \
X $(OBJ_DIR)\intrflus.$(OBJ) $(OBJ_DIR)\keyname.$(OBJ) $(OBJ_DIR)\keypad.$(OBJ) \
X $(OBJ_DIR)\killchar.$(OBJ) $(OBJ_DIR)\leaveok.$(OBJ) $(OBJ_DIR)\longname.$(OBJ) \
X $(OBJ_DIR)\meta.$(OBJ) $(OBJ_DIR)\mvcur.$(OBJ) $(OBJ_DIR)\mvprintw.$(OBJ)
X
XPORT3 = $(OBJ_DIR)\mvscanw.$(OBJ) $(OBJ_DIR)\mvwin.$(OBJ) $(OBJ_DIR)\mvwprint.$(OBJ) \
X $(OBJ_DIR)\mvwscanw.$(OBJ) $(OBJ_DIR)\newpad.$(OBJ) $(OBJ_DIR)\newterm.$(OBJ) \
X $(OBJ_DIR)\newwin.$(OBJ) $(OBJ_DIR)\nl.$(OBJ) $(OBJ_DIR)\nocbreak.$(OBJ) \
X $(OBJ_DIR)\nodelay.$(OBJ) $(OBJ_DIR)\noecho.$(OBJ) $(OBJ_DIR)\noraw.$(OBJ) \
X $(OBJ_DIR)\overlay.$(OBJ) $(OBJ_DIR)\overwrit.$(OBJ) $(OBJ_DIR)\paircont.$(OBJ) \
X $(OBJ_DIR)\pnoutref.$(OBJ) $(OBJ_DIR)\prefresh.$(OBJ) $(OBJ_DIR)\printw.$(OBJ)
X
XPORT4 = $(OBJ_DIR)\raw.$(OBJ) $(OBJ_DIR)\refresh.$(OBJ) $(OBJ_DIR)\reset_pr.$(OBJ) \
X $(OBJ_DIR)\reset_sh.$(OBJ) $(OBJ_DIR)\resetter.$(OBJ) $(OBJ_DIR)\resetty.$(OBJ) \
X $(OBJ_DIR)\saveoldt.$(OBJ) $(OBJ_DIR)\saveterm.$(OBJ) $(OBJ_DIR)\savetty.$(OBJ) \
X $(OBJ_DIR)\scanw.$(OBJ) $(OBJ_DIR)\scroll.$(OBJ) $(OBJ_DIR)\scrollok.$(OBJ) \
X $(OBJ_DIR)\set_term.$(OBJ) $(OBJ_DIR)\setscrrg.$(OBJ) $(OBJ_DIR)\standend.$(OBJ) \
X $(OBJ_DIR)\standout.$(OBJ) $(OBJ_DIR)\startcol.$(OBJ) $(OBJ_DIR)\subwin.$(OBJ)
X
XPORT5 = $(OBJ_DIR)\touchlin.$(OBJ) $(OBJ_DIR)\touchwin.$(OBJ) $(OBJ_DIR)\typeahea.$(OBJ) \
X $(OBJ_DIR)\unctrl.$(OBJ) $(OBJ_DIR)\ungetch.$(OBJ) $(OBJ_DIR)\waddch.$(OBJ) \
X $(OBJ_DIR)\waddstr.$(OBJ) $(OBJ_DIR)\wattroff.$(OBJ) $(OBJ_DIR)\wattron.$(OBJ) \
X $(OBJ_DIR)\wattrset.$(OBJ) $(OBJ_DIR)\wclear.$(OBJ) $(OBJ_DIR)\wclrtobo.$(OBJ) \
X $(OBJ_DIR)\wclrtoeo.$(OBJ) $(OBJ_DIR)\wdelch.$(OBJ) $(OBJ_DIR)\wdeletel.$(OBJ) \
X $(OBJ_DIR)\werase.$(OBJ) $(OBJ_DIR)\wgetch.$(OBJ) $(OBJ_DIR)\wgetstr.$(OBJ)
X
XPORT6 = $(OBJ_DIR)\winch.$(OBJ) $(OBJ_DIR)\winsch.$(OBJ) $(OBJ_DIR)\winsertl.$(OBJ) \
X $(OBJ_DIR)\wmove.$(OBJ) $(OBJ_DIR)\wnoutref.$(OBJ) $(OBJ_DIR)\wprintw.$(OBJ) \
X $(OBJ_DIR)\wrefresh.$(OBJ) $(OBJ_DIR)\wscanw.$(OBJ) $(OBJ_DIR)\wsetscrr.$(OBJ) \
X $(OBJ_DIR)\wstanden.$(OBJ) $(OBJ_DIR)\wstandou.$(OBJ) $(OBJ_DIR)\curs_set.$(OBJ)
X
XPORTABLE = $(PORT1) $(PORT2) $(PORT3) $(PORT4) $(PORT5) $(PORT6)
X
X#
X# Non-portable PDCurses Functions
X#
XNONPORT = $(OBJ_DIR)\border.$(OBJ) $(OBJ_DIR)\breakcha.$(OBJ) $(OBJ_DIR)\cursoff.$(OBJ) \
X $(OBJ_DIR)\curson.$(OBJ) $(OBJ_DIR)\mvwinser.$(OBJ) $(OBJ_DIR)\rawout.$(OBJ) \
X $(OBJ_DIR)\resize.$(OBJ) $(OBJ_DIR)\resizew.$(OBJ) $(OBJ_DIR)\tabsize.$(OBJ) \
X $(OBJ_DIR)\waddraws.$(OBJ) $(OBJ_DIR)\wborder.$(OBJ) $(OBJ_DIR)\wbox.$(OBJ) \
X $(OBJ_DIR)\winprint.$(OBJ) $(OBJ_DIR)\wordchar.$(OBJ) $(OBJ_DIR)\wtabsize.$(OBJ)
X
X#
X# Private (Internal) PDCurses Functions
X#
XPRIV1 = $(OBJ_DIR)\_addtail.$(OBJ) $(OBJ_DIR)\_addwin.$(OBJ) $(OBJ_DIR)\_backchr.$(OBJ) \
X $(OBJ_DIR)\_cattr.$(OBJ) $(OBJ_DIR)\_chadd.$(OBJ) $(OBJ_DIR)\_chgattr.$(OBJ) \
X $(OBJ_DIR)\_chins.$(OBJ) $(OBJ_DIR)\_ckbiosk.$(OBJ) $(OBJ_DIR)\_clrscr.$(OBJ) \
X $(OBJ_DIR)\_clrupda.$(OBJ) $(OBJ_DIR)\_findwin.$(OBJ) $(OBJ_DIR)\_fixcurs.$(OBJ)
X
XPRIV2 = $(OBJ_DIR)\_gbiosky.$(OBJ) $(OBJ_DIR)\_gcrspos.$(OBJ) $(OBJ_DIR)\_gcurcol.$(OBJ) \
X $(OBJ_DIR)\_gcurrow.$(OBJ) $(OBJ_DIR)\_getattr.$(OBJ) $(OBJ_DIR)\_getcbrk.$(OBJ) \
X $(OBJ_DIR)\_getcols.$(OBJ) $(OBJ_DIR)\_getcrsr.$(OBJ) $(OBJ_DIR)\_getfont.$(OBJ) \
X $(OBJ_DIR)\_getrows.$(OBJ) $(OBJ_DIR)\_getscrn.$(OBJ) $(OBJ_DIR)\_gotoxy.$(OBJ)
X
XPRIV3 = $(OBJ_DIR)\_inswin.$(OBJ) $(OBJ_DIR)\_makenew.$(OBJ) $(OBJ_DIR)\_newline.$(OBJ) \
X $(OBJ_DIR)\_print.$(OBJ) $(OBJ_DIR)\_putc.$(OBJ) $(OBJ_DIR)\_putctty.$(OBJ) \
X $(OBJ_DIR)\_queryad.$(OBJ) $(OBJ_DIR)\_rawgetc.$(OBJ) $(OBJ_DIR)\_rmwin.$(OBJ) \
X $(OBJ_DIR)\_sanity.$(OBJ) $(OBJ_DIR)\_scb.$(OBJ) $(OBJ_DIR)\_scrclos.$(OBJ)
X
XPRIV4 = $(OBJ_DIR)\_scrnmod.$(OBJ) $(OBJ_DIR)\_scroll.$(OBJ) $(OBJ_DIR)\_scropen.$(OBJ) \
X $(OBJ_DIR)\_set8025.$(OBJ) $(OBJ_DIR)\_setcrsr.$(OBJ) $(OBJ_DIR)\_setfont.$(OBJ) \
X $(OBJ_DIR)\_setrows.$(OBJ) $(OBJ_DIR)\_setscrn.$(OBJ) $(OBJ_DIR)\_sgetnl.$(OBJ) \
X $(OBJ_DIR)\_splitpl.$(OBJ) $(OBJ_DIR)\_sysgetc.$(OBJ) $(OBJ_DIR)\_validch.$(OBJ) \
X $(OBJ_DIR)\_xfrmlin.$(OBJ) $(OBJ_DIR)\_vsscanf.$(OBJ)
X
XPRIVATE = $(PRIV1) $(PRIV2) $(PRIV3) $(PRIV4)
X
X#
X# PDCurses function specific to the FlexOS Operating System
X#
X#FLEXOS = $(OBJ_DIR)\_16bitmo.$(OBJ) $(OBJ_DIR)\_8bitmod.$(OBJ) $(OBJ_DIR)\_gname.$(OBJ)
X
X
X$(PDCLIB): buildlrf.exe $(HEADERS) $(PORTABLE) $(NONPORT) $(PRIVATE)
X +echo $(LIBRSP) >> $(LRF)
X $(MAKE_LIB)
X $(EMX_OMF_LIB)
X +if exist $(LRF) del $(LRF)
X
X#
X# Refresh library response file and build library
X#
Xlib: $(PDCLIB)
X +if exist $(PDCLIB) del $(PDCLIB)
X +if exist $(LRF) del $(LRF)
X +for %%f in ($(OBJ_DIR)\*.obj) do buildlrf +%%f $(LRF)
X +echo $(LIBRSP) >> $(LRF)
X $(MAKE_LIB)
X $(EMX_OMF_LIB)
X +if exist $(LRF) del $(LRF)
X
X#
X# Object Module Targets
X#
XADDLRF =buildlrf -+$@ $(LRF)
X
X# PORTABLE
X$(OBJ_DIR)\%.$(OBJ): $(PORT_DIR)/%.c
X +-mkdir $(OBJ_DIR)
X $(CC) $(CFLAGS) $<
X -$(ADDLRF)
X
X# NONPORT
X
X$(OBJ_DIR)\%.$(OBJ): $(NONP_DIR)/%.c
X +-mkdir $(OBJ_DIR)
X $(CC) $(CFLAGS) $<
X -$(ADDLRF)
X
X# PRIVATE
X
X$(OBJ_DIR)\%.$(OBJ): $(PRIV_DIR)/%.c
X +-mkdir $(OBJ_DIR)
X $(CC) $(CFLAGS) $<
X -$(ADDLRF)
X
X
X# FLEXOS
X
X#$(OBJ_DIR)\%.$(OBJ): $(FLEX_DIR)/%.c
X# +-mkdir $(OBJ_DIR)
X# $(CC) $(CFLAGS) $<
X# -$(ADDLRF)
X
X#######################################################################
X######################### Documentation Targets #######################
X#######################################################################
X
Xmanual: $(DOC_DIR)\intro.man $(DOC_DIR)\overview.man $(DOC_DIR)\todo.man manext.exe
X manext $(DOC_DIR)\intro.man > PDCurses.man
X manext $(DOC_DIR)\overview.man >> PDCurses.man
X +echo .......=================================== >> PDCurses.man
X +echo .......PDCurses Definitions and Variables: >> PDCurses.man
X +echo .......=================================== >> PDCurses.man
X manext $(CC_INC)\curses.h $(FFLAGS) >> PDCurses.man
X +echo .......============================ >> PDCurses.man
X +echo .......Portable PDCurses Functions: >> PDCurses.man
X +echo .......============================ >> PDCurses.man
X manext $(ROOTDIR)\portable\*.c >> PDCurses.man
X +echo .......================================ >> PDCurses.man
X +echo .......Non-portable PDCurses Functions: >> PDCurses.man
X +echo .......================================ >> PDCurses.man
X manext $(ROOTDIR)\nonport\*.c >> PDCurses.man
X +echo .......============================ >> PDCurses.man
X +echo .......Internal PDCurses Functions: >> PDCurses.man
X +echo .......============================ >> PDCurses.man
X manext $(ROOTDIR)\private\*.c >> PDCurses.man
X +echo .......========================== >> PDCurses.man
X +echo .......PDCurses Flexos Functions: >> PDCurses.man
X +echo .......========================== >> PDCurses.man
X manext $(ROOTDIR)\flexos\*.c >> PDCurses.man
X +echo .......======================== >> PDCurses.man
X +echo .......Functions not supported: >> PDCurses.man
X +echo .......======================== >> PDCurses.man
X manext $(DOC_DIR)\todo.man >> PDCurses.man
X
X#######################################################################
X######################### Maintenance Targets #########################
X#######################################################################
Xclean:
X +del PDCurses.ar? > NUL:
X +del $(OBJ_DIR)\*.obj
X
Xzoo:
X zoo a pdcurs20 $(ROOTDIR)\readme $(ROOTDIR)\makefile $(HEADERS)
X zoo a pdcurs20 $(DOC_DIR)\*.man
X zoo a pdcurs20 $(PORT_DIR)\*.c $(NONP_DIR)\*.c $(PRIV_DIR)\*.c
X zoo a pdcurs20 $(FLEX_DIR)\*.c $(DEMO_DIR)\*.c $(DEMO_DIR)\*.def
X zoo a pdcurs20 $(TOOLS_DIR)\*.c $(TOOLS_DIR)\*.def $(ROOTDIR)\pdcurses.cfg
X
Xzip:
X zip pdcurs20 $(ROOTDIR)\readme $(ROOTDIR)\makefile $(HEADERS)
X zip pdcurs20 $(DOC_DIR)\*.man
X zip pdcurs20 $(PORT_DIR)\*.c $(NONP_DIR)\*.c $(PRIV_DIR)\*.c
X zip pdcurs20 $(FLEX_DIR)\*.c $(DEMO_DIR)\*.c $(DEMO_DIR)\*.def
X zip pdcurs20 $(TOOLS_DIR)\*.c $(TOOLS_DIR)\*.def $(ROOTDIR)\pdcurses.cfg
END_OF_FILE
if test 22856 -ne `wc -c <'makefile'`; then
echo shar: \"'makefile'\" unpacked with wrong size!
fi
# end of 'makefile'
fi
if test -f 'private/_setrows.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_setrows.c'\"
else
echo shar: Extracting \"'private/_setrows.c'\" \(2085 characters\)
sed "s/^X//" >'private/_setrows.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__setrows = "$Header: c:/curses/private/RCS/_setrows.c%v 2.0 1992/11/15 03:24:37 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_set_rows() - sets the physical number of rows on screen
X
X PDCurses Description:
X This is a private PDCurses function.
X
X This routine attempts to set the number of rows on the physical
X screen to the passed value.
X
X PDCurses Return Value:
X This function returns OK upon success otherwise ERR is returned.
X
X PDCurses Errors:
X It is an error to attempt to change the screen size on a "bogus"
X adapter. The reason for this is that we have a known video
X adapter identity problem. e.g. Two adapters report the same
X identifying characteristics.
X
X It is also an error to attempt to change the size of the Flexos
X console (as there is currently no support for that).
X
X Portability:
X PDCurses int PDC_set_rows( int rows );
X
X**man-end**********************************************************************/
X
Xint PDC_set_rows(int rows)
X{
X#ifdef FLEXOS
X return( ERR );
X#endif
X#ifdef DOS
X if (_cursvar.bogus_adapter)
X return( ERR );
X
X switch (_cursvar.adapter)
X {
X case _EGACOLOR:
X case _EGAMONO:
X if (rows < 43)
X PDC_set_font(_FONT14);
X else
X PDC_set_font(_FONT8);
X break;
X
X case _VGACOLOR:
X case _VGAMONO:
X if (rows < 28)
X PDC_set_font(_FONT16);
X else
X if (rows < 50)
X PDC_set_font(_FONT14);
X else
X PDC_set_font(_FONT8);
X break;
X
X case _MCGACOLOR:
X case _MCGAMONO:
X case _MDA:
X case _CGA:
X case _MDS_GENIUS:
X default:
X break;
X }
X _cursvar.font = PDC_get_font();
X LINES = PDC_get_rows();
X COLS = PDC_get_columns();
X return( OK );
X#endif
X#ifdef OS2
X VIOMODEINFO modeInfo;
X USHORT result;
X
X modeInfo.cb = sizeof(modeInfo);
X /* set most parameters of modeInfo */
X VioGetMode(&modeInfo, 0);
X modeInfo.fbType = 1;
X modeInfo.row = rows;
X result = VioSetMode(&modeInfo, 0);
X _cursvar.font = PDC_get_font();
X LINES = PDC_get_rows();
X COLS = PDC_get_columns();
X return ((result == 0) ? OK : ERR);
X#endif
X}
END_OF_FILE
if test 2085 -ne `wc -c <'private/_setrows.c'`; then
echo shar: \"'private/_setrows.c'\" unpacked with wrong size!
fi
# end of 'private/_setrows.c'
fi
if test -f 'private/_validch.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_validch.c'\"
else
echo shar: Extracting \"'private/_validch.c'\" \(8570 characters\)
sed "s/^X//" >'private/_validch.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__validch = "$Header: c:/curses/private/RCS/_validch.c%v 2.0 1992/11/15 03:24:39 MH Rel $";
X#endif
X
X
X
X/*man-start*********************************************************************
X
X* Table for key code translation of function keys in keypad mode
X* These values are for strict IBM keyboard compatibles only
X**man-end**********************************************************************/
X
X
X#if defined (DOS) || defined (OS2)
Xstatic chtype kptab[] =
X{
X /* Normal Function Keys */
X 0x3b, KEY_F(1), 0x3c, KEY_F(2), 0x3d, KEY_F(3), 0x3e, KEY_F(4),
X 0x3f, KEY_F(5), 0x40, KEY_F(6), 0x41, KEY_F(7), 0x42, KEY_F(8),
X 0x43, KEY_F(9), 0x44, KEY_F(10),
X
X /* Normal Keypad */
X 0x47, KEY_HOME, 0x48, KEY_UP, 0x49, KEY_PPAGE,
X 0x4b, KEY_LEFT, 0x4c, KEY_B2, 0x4d, KEY_RIGHT,
X 0x4f, KEY_END, 0x50, KEY_DOWN, 0x51, KEY_NPAGE,
X 0x52, KEY_IC, 0x53, KEY_DC,
X
X /* Shft-Function Keys */
X 0x54, KEY_F(11), 0x55, KEY_F(12), 0x56, KEY_F(13), 0x57, KEY_F(14),
X 0x58, KEY_F(15), 0x59, KEY_F(16), 0x5a, KEY_F(17), 0x5b, KEY_F(18),
X 0x5c, KEY_F(19), 0x5d, KEY_F(20),
X
X /* Ctl-Function Keys */
X 0x5e, KEY_F(21), 0x5f, KEY_F(22), 0x60, KEY_F(23), 0x61, KEY_F(24),
X 0x62, KEY_F(25), 0x63, KEY_F(26), 0x64, KEY_F(27), 0x65, KEY_F(28),
X 0x66, KEY_F(29), 0x67, KEY_F(30),
X
X /* Alt-Function Keys */
X 0x68, KEY_F(31), 0x69, KEY_F(32), 0x6a, KEY_F(33), 0x6b, KEY_F(34),
X 0x6c, KEY_F(35), 0x6d, KEY_F(36), 0x6e, KEY_F(37), 0x6f, KEY_F(38),
X 0x70, KEY_F(39), 0x71, KEY_F(40),
X
X /* Control-Keypad */
X 0x77, CTL_HOME, 0x84, CTL_PGUP,
X 0x73, CTL_LEFT, 0x74, CTL_RIGHT,
X 0x75, CTL_END, 0x76, CTL_PGDN,
X
X /* Alt-Numbers */
X 0x78, ALT_1, 0x79, ALT_2, 0x7a, ALT_3, 0x7b, ALT_4,
X 0x7c, ALT_5, 0x7d, ALT_6, 0x7e, ALT_7, 0x7f, ALT_8,
X 0x80, ALT_9, 0x81, ALT_0,
X
X /* Extended codes */
X 0x85, KEY_F(41), 0x86, KEY_F(42), 0x87, KEY_F(43), 0x88, KEY_F(44),
X 0x89, KEY_F(45), 0x8a, KEY_F(46), 0x8b, KEY_F(47), 0x8c, KEY_F(48),
X 0x03, 0, /* NULL */
X 0xff, PADSLASH, 0x0d, PADENTER, 0x0a, CTL_PADENTER,
X 0xa6, ALT_PADENTER, 0x53, SHF_PADSTOP, 0xfc, CTL_ENTER,
X 0xfa, PADSTAR, 0xfd, PADMINUS, 0xfb, PADPLUS,
X 0x93, CTL_PADSTOP, 0x8f, CTL_PADCENTER, 0x90, CTL_PADPLUS,
X 0x8e, CTL_PADMINUS, 0x95, CTL_PADSLASH, 0x96, CTL_PADSTAR,
X 0x4e, ALT_PADPLUS, 0x4a, ALT_PADMINUS, 0xa4, ALT_PADSLASH,
X 0x37, ALT_PADSTAR, 0x92, CTL_INS, 0xa2, ALT_INS,
X 0xa3, ALT_DEL, 0x8d, CTL_UP, 0x91, CTL_DOWN,
X 0x94, CTL_TAB, 0xa5, ALT_TAB, 0x82, ALT_MINUS,
X 0x83, ALT_EQUAL, 0x99, ALT_PGUP, 0xa1, ALT_PGDN,
X 0x9f, ALT_END, 0x98, ALT_UP, 0xa0, ALT_DOWN,
X 0x9d, ALT_RIGHT, 0x9b, ALT_LEFT, 0x1c, ALT_ENTER,
X 0x97, ALT_HOME, 0x01, ALT_ESC, 0x0e, ALT_BKSP,
X 0x29, ALT_BQUOTE, 0x1a, ALT_LBRACKET, 0x1b, ALT_RBRACKET,
X 0x27, ALT_SEMICOLON,0x28, ALT_FQUOTE, 0x33, ALT_COMMA,
X 0x34, ALT_STOP, 0x35, ALT_FSLASH, 0x2b, ALT_BSLASH,
X
X /* Alt-Alphabet */
X 0x1e, ALT_A, 0x30, ALT_B, 0x2e, ALT_C, 0x20, ALT_D,
X 0x12, ALT_E, 0x21, ALT_F, 0x22, ALT_G, 0x23, ALT_H,
X 0x17, ALT_I, 0x24, ALT_J, 0x25, ALT_K, 0x26, ALT_L,
X 0x32, ALT_M, 0x31, ALT_N, 0x18, ALT_O, 0x19, ALT_P,
X 0x10, ALT_Q, 0x13, ALT_R, 0x1f, ALT_S, 0x14, ALT_T,
X 0x16, ALT_U, 0x2f, ALT_V, 0x11, ALT_W, 0x2d, ALT_X,
X 0x15, ALT_Y, 0x2c, ALT_Z,
X
X 0x0f, KEY_BACKTAB,
X
X /* End of kptab[] */
X 0x100, -1
X};
X#endif
X
X
X
X
X#ifdef FLEXOS
Xchtype kptab[] =
X{
X /* Normal Function Keys */
X 0x1001, KEY_F(1), 0x1002, KEY_F(2), 0x1003, KEY_F(3), 0x1004, KEY_F(4),
X 0x1005, KEY_F(5), 0x1006, KEY_F(6), 0x1007, KEY_F(7), 0x1008, KEY_F(8),
X 0x1009, KEY_F(9), 0x100A, KEY_F(10),
X
X /* Normal Keypad */
X 0x2018, KEY_HOME, 0x2010, KEY_UP, 0x2014, KEY_PPAGE,
X 0x2012, KEY_LEFT, 0x2035, KEY_B2, 0x2013, KEY_RIGHT,
X 0x2008, KEY_LL, 0x2011, KEY_DOWN, 0x2015, KEY_NPAGE,
X 0x2009, KEY_IC, 0x200A, KEY_DC,
X
X /* Shft-Function Keys */
X 0x1401, KEY_F(11), 0x1402, KEY_F(12), 0x1403, KEY_F(13), 0x1404, KEY_F(14),
X 0x1405, KEY_F(15), 0x1406, KEY_F(16), 0x1407, KEY_F(17), 0x1408, KEY_F(18),
X 0x1409, KEY_F(19), 0x140A, KEY_F(20),
X
X /* Ctl-Function Keys */
X 0x1101, KEY_F(21), 0x1102, KEY_F(22), 0x1103, KEY_F(23), 0x1104, KEY_F(24),
X 0x1105, KEY_F(25), 0x1106, KEY_F(26), 0x1107, KEY_F(27), 0x1108, KEY_F(28),
X 0x1109, KEY_F(29), 0x110A, KEY_F(30),
X
X /* Alt-Function Keys */
X 0x1201, KEY_F(31), 0x1202, KEY_F(32), 0x1203, KEY_F(33), 0x1204, KEY_F(34),
X 0x1205, KEY_F(35), 0x1206, KEY_F(36), 0x1207, KEY_F(37), 0x1208, KEY_F(38),
X 0x1209, KEY_F(39), 0x120A, KEY_F(40),
X
X /* Control-Keypad */
X 0x2118, CTL_HOME, 0x2114, CTL_PGUP,
X 0x2112, CTL_LEFT, 0x2113, CTL_RIGHT,
X 0x2108, CTL_END, 0x2115, CTL_PGDN,
X
X /* Alt-Numbers */
X 0x2231, ALT_1, 0x2232, ALT_2, 0x2233, ALT_3, 0x2234, ALT_4,
X 0x2235, ALT_5, 0x2236, ALT_6, 0x2237, ALT_7, 0x2238, ALT_8,
X 0x2239, ALT_9, 0x2230, ALT_0,
X
X /* Alt-Alphabet */
X 0x0200 | (unsigned) 'A', ALT_A, 0x0200 | (unsigned) 'B', ALT_B,
X 0x0200 | (unsigned) 'C', ALT_C, 0x0200 | (unsigned) 'D', ALT_D,
X 0x0200 | (unsigned) 'E', ALT_E, 0x0200 | (unsigned) 'F', ALT_F,
X 0x0200 | (unsigned) 'G', ALT_G, 0x0200 | (unsigned) 'H', ALT_H,
X 0x0200 | (unsigned) 'I', ALT_I, 0x0200 | (unsigned) 'J', ALT_J,
X 0x0200 | (unsigned) 'K', ALT_K, 0x0200 | (unsigned) 'L', ALT_L,
X 0x0200 | (unsigned) 'M', ALT_M, 0x0200 | (unsigned) 'N', ALT_N,
X 0x0200 | (unsigned) 'O', ALT_O, 0x0200 | (unsigned) 'P', ALT_P,
X 0x0200 | (unsigned) 'Q', ALT_Q, 0x0200 | (unsigned) 'R', ALT_R,
X 0x0200 | (unsigned) 'S', ALT_S, 0x0200 | (unsigned) 'T', ALT_T,
X 0x0200 | (unsigned) 'U', ALT_U, 0x0200 | (unsigned) 'V', ALT_V,
X 0x0200 | (unsigned) 'W', ALT_W, 0x0200 | (unsigned) 'X', ALT_X,
X 0x0200 | (unsigned) 'Y', ALT_Y, 0x0200 | (unsigned) 'Z', ALT_Z,
X
X 0x0200 | (unsigned) 'a', ALT_A, 0x0200 | (unsigned) 'b', ALT_B,
X 0x0200 | (unsigned) 'c', ALT_C, 0x0200 | (unsigned) 'd', ALT_D,
X 0x0200 | (unsigned) 'e', ALT_E, 0x0200 | (unsigned) 'f', ALT_F,
X 0x0200 | (unsigned) 'g', ALT_G, 0x0200 | (unsigned) 'h', ALT_H,
X 0x0200 | (unsigned) 'i', ALT_I, 0x0200 | (unsigned) 'j', ALT_J,
X 0x0200 | (unsigned) 'k', ALT_K, 0x0200 | (unsigned) 'l', ALT_L,
X 0x0200 | (unsigned) 'm', ALT_M, 0x0200 | (unsigned) 'n', ALT_N,
X 0x0200 | (unsigned) 'o', ALT_O, 0x0200 | (unsigned) 'p', ALT_P,
X 0x0200 | (unsigned) 'q', ALT_Q, 0x0200 | (unsigned) 'r', ALT_R,
X 0x0200 | (unsigned) 's', ALT_S, 0x0200 | (unsigned) 't', ALT_T,
X 0x0200 | (unsigned) 'u', ALT_U, 0x0200 | (unsigned) 'v', ALT_V,
X 0x0200 | (unsigned) 'w', ALT_W, 0x0200 | (unsigned) 'x', ALT_X,
X 0x0200 | (unsigned) 'y', ALT_Y, 0x0200 | (unsigned) 'z', ALT_Z,
X
X 0x0f, KEY_BACKTAB,
X
X /* End of kptab[] */
X 0x100, -1
X};
X#endif
X
X
X
X
X/*----------------------------------------------------------------------
X$ PDC_validchar() - validate/translate passed character
X$
X$ PDCurses Description:
X$ This is a private PDCurses function.
X$
X$ Checks that 'c' is a valid character, and if so returns it,
X$ with function key translation applied if 'w' has keypad mode
X$ set. If char is invalid, returns -1.
X$
X$ PDCurses Return Value:
X$ This function returns -1 if the passed character is invalid, or
X$ the WINDOW* 'w' is NULL, or 'w's keypad is not active.
X$
X$ This function returns 0 under Flexos if the passed character
X$ is 0x0300. (-:Forget why. --Frotz 911130:-)
X$
X$ Otherwise, this function returns the PDCurses equivalent of the
X$ passed character. See the function key and key macros in
X$ <curses.h>
X$
X$ PDCurses Errors:
X$ There are no errors defined for this routine.
X$
X$ Portability:
X$ PDCurses chtype PDC_validchar( chtype c );
X$
X$----------------------------------------------------------------------
X*/
Xchtype PDC_validchar(chtype c)
X{
Xextern WINDOW* _getch_win_;
X/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */
X /* is the same window - all references to w changed*/
X /* to _getch_win_ - marked with @@ */
X
X chtype *scanp;
X
X if (_getch_win_ == (WINDOW *)NULL)
X return (-1); /* bad window pointer */
X
X#ifdef FLEXOS
X if (c == 0x0300)
X return (0); /* special case, ^@ = NULL */
X#endif
X if (!(c & ~A_CHARTEXT)) return (c); /* normal character */
X if (!(_getch_win_->_use_keypad)) return (-1); /* skip if keys if !keypad mode */
X
X#if defined (DOS) || defined (OS2)
X /*
X * Under DOS, extended keys are in the upper byte. Shift down for a
X * comparison.
X */
X c = (c >> 8) & A_CHARTEXT;
X#endif
X scanp = kptab;
X while (*scanp > 0) /* search for value */
X { /* (stops on table entry 0x100) */
X if (*scanp++ == c)
X {
X return (*scanp); /* found, return it */
X }
X scanp++;
X }
X return( -1 ); /* not found, invalid */
X}
END_OF_FILE
if test 8570 -ne `wc -c <'private/_validch.c'`; then
echo shar: \"'private/_validch.c'\" unpacked with wrong size!
fi
# end of 'private/_validch.c'
fi
echo shar: End of archive 3 \(of 11\).
cp /dev/null ark3isdone
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: cursos2.h demos/newdemo.c doc/intro.man
# portable/flushinp.c portable/initscr.c portable/keyname.c
# portable/wgetch.c portable/wnoutref.c private/_queryad.c
# private/_xfrmlin.c
# Wrapped by kent@sparky on Wed Nov 18 21:44:07 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 4 (of 11)."'
if test -f 'cursos2.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'cursos2.h'\"
else
echo shar: Extracting \"'cursos2.h'\" \(6500 characters\)
sed "s/^X//" >'cursos2.h' <<'END_OF_FILE'
X/* $Header: c:/curses/RCS/cursos2.h%v 2.0 1992/11/16 22:40:44 MH Rel $ */
X#ifndef CURSOS2_INCL
X#define CURSOS2_INCL 1
X
X#ifdef CURSES__32BIT__
X
X#define KbdSetStatus Kbd32SetStatus
X#define KbdGetStatus Kbd32GetStatus
X#define KbdCharIn Kbd32CharIn
X#define KbdPeek Kbd32Peek
X#define KbdFlushBuffer Kbd32FlushBuffer
X
X#define VioGetMode Vio32GetMode
X#define VioSetMode Vio32SetMode
X#define VioGetCurPos Vio32GetCurPos
X#define VioSetCurPos Vio32SetCurPos
X#define VioGetCurType Vio32GetCurType
X#define VioSetCurType Vio32SetCurType
X#define VioScrollDn Vio32ScrollDn
X#define VioScrollUp Vio32ScrollUp
X#define VioGetConfig Vio32GetConfig
X#define VioWrtTTY Vio32WrtTTY
X#define VioReadCellStr Vio32ReadCellStr
X#define VioWrtCellStr Vio32WrtCellStr
X#define VioWrtNAttr Vio32WrtNAttr
X
X#define FARKeyword
X
X#define CURS_INCL_VIO_KBD
X
X
X#ifdef __EMX__
X# ifndef USE_OS2_H
X# define USE_OS2_H
X# endif
X# define APIENTRY
X#else
X# define APIRET ULONG
X#endif
X
X#else
X
X
X# define FARKeyword far
X# define APIRET USHORT
X
X#ifdef USE_OS2_H
X# define INCL_VIO
X# define INCL_KBD
X#else
X# define CURS_INCL_VIO_KBD
X#endif
X
X
X#endif /* __32BIT__ */
X
X
X/* if USE_OS2_H is defined then use the os2.h that comes with your compiler ...*/
X
X#ifdef USE_OS2_H
X# include <os2.h>
X#else
X
X/* ... otherwise use these definitions */
X
X# include <os2def.h>
X
X#endif
X
X#ifdef CURS_INCL_VIO_KBD
X
Xtypedef SHANDLE HKBD;
Xtypedef HKBD FARKeyword * PHKBD;
X
X
Xtypedef SHANDLE HVIO;
Xtypedef HVIO FARKeyword * PHVIO;
X
X
X
Xtypedef struct _KBDINFO {
X USHORT cb;
X USHORT fsMask;
X USHORT chTurnAround;
X USHORT fsInterim;
X USHORT fsState;
X }KBDINFO;
Xtypedef KBDINFO FARKeyword *PKBDINFO;
X
X
XUSHORT APIENTRY KbdSetStatus(
X PKBDINFO pkbdinfo,
X HKBD hkbd );
X
X
XUSHORT APIENTRY KbdGetStatus(
X PKBDINFO pkbdinfo,
X HKBD hdbd );
X
X
Xtypedef struct _KBDKEYINFO {
X UCHAR chChar; /* ASCII character code */
X UCHAR chScan; /* Scan Code */
X UCHAR fbStatus;
X UCHAR bNlsShift;
X USHORT fsState;
X ULONG time;
X }KBDKEYINFO;
Xtypedef KBDKEYINFO FARKeyword *PKBDKEYINFO;
X
X#define IO_WAIT 0
X#define IO_NOWAIT 1
X
XUSHORT APIENTRY KbdCharIn(
X PKBDKEYINFO pkbci,
X USHORT fWait, /* IO_WAIT, IO_NOWAIT */
X HKBD hkbd);
X
XUSHORT APIENTRY KbdFlushBuffer(
X HKBD hkbd);
X
X
Xtypedef struct _VIOMODEINFO {
X USHORT cb;
X UCHAR fbType;
X UCHAR color;
X USHORT col; /* number of text columns */
X USHORT row; /* number of text rows */
X USHORT hres; /* horizontal resolution */
X USHORT vres; /* vertical resolution */
X UCHAR fmt_ID;
X UCHAR attrib; /* number of attributes */
X ULONG buf_addr;
X ULONG buf_length;
X ULONG full_length;
X ULONG partial_length;
X PCH ext_data_addr;
X } VIOMODEINFO;
Xtypedef VIOMODEINFO FARKeyword *PVIOMODEINFO;
X
X
XUSHORT APIENTRY VioGetMode(
X PVIOMODEINFO pvioModeInfo,
X HVIO hvio);
X
X
XUSHORT APIENTRY VioSetMode(
X PVIOMODEINFO pvioModeInfo,
X HVIO hvio);
X
X
XUSHORT APIENTRY VioGetCurPos(
X PUSHORT pusRow,
X PUSHORT pusColumn,
X HVIO hvio );
X
X
XUSHORT APIENTRY VioSetCurPos(
X USHORT usRow,
X USHORT usColumn,
X HVIO hvio);
X
Xtypedef struct _VIOCURSORINFO {
X USHORT yStart;
X USHORT cEnd;
X USHORT cx;
X USHORT attr; /* -1=hidden cursor, any other=normal cursor */
X } VIOCURSORINFO;
Xtypedef VIOCURSORINFO FARKeyword *PVIOCURSORINFO;
X
X
XUSHORT APIENTRY VioGetCurType(
X PVIOCURSORINFO pvioCursorInfo,
X HVIO hvio );
X
X
XUSHORT APIENTRY VioSetCurType(
X PVIOCURSORINFO pvioCursorInfo,
X HVIO hvio );
X
XUSHORT APIENTRY VioScrollDn(
X USHORT usTopRow,
X USHORT usLeftCol,
X USHORT usBotRow,
X USHORT usRightCol,
X USHORT cbLines,
X PBYTE pCell,
X HVIO hvio );
X
X
X
XUSHORT APIENTRY VioScrollUp(
X USHORT usTopRow,
X USHORT usLeftCol,
X USHORT usBotRow,
X USHORT usRightCol,
X USHORT cbLines,
X PBYTE pCell,
X HVIO hvio );
X
X
X /* VIOCONFIGINFO.adapter constants */
X
X #define DISPLAY_MONOCHROME 0x0000
X #define DISPLAY_CGA 0x0001
X #define DISPLAY_EGA 0x0002
X #define DISPLAY_VGA 0x0003
X #define DISPLAY_8514A 0x0007
X
X /* VIOCONFIGINFO.display constants */
X
X #define MONITOR_MONOCHROME 0x0000
X #define MONITOR_COLOR 0x0001
X #define MONITOR_ENHANCED 0x0002
X #define MONITOR_8503 0x0003
X #define MONITOR_851X_COLOR 0x0004
X #define MONITOR_8514 0x0009
X
Xtypedef struct _VIOCONFIGINFO {
X USHORT cb;
X USHORT adapter;
X USHORT display;
X ULONG cbMemory;
X USHORT Configuration;
X USHORT VDHVersion;
X USHORT Flags;
X ULONG HWBufferSize;
X ULONG FullSaveSize;
X ULONG PartSaveSize;
X USHORT EMAdaptersOFF;
X USHORT EMDisplaysOFF;
X } VIOCONFIGINFO;
Xtypedef VIOCONFIGINFO FARKeyword *PVIOCONFIGINFO;
X
X
XUSHORT APIENTRY VioGetConfig(
X USHORT usConfigId, /* Reserved (must be 0) */
X PVIOCONFIGINFO pvioin,
X HVIO hvio );
X
XUSHORT APIENTRY VioWrtTTY(
X PCH pch,
X USHORT cb,
X HVIO hvio );
X
XUSHORT APIENTRY VioReadCellStr(
X PCH pchCellStr,
X PUSHORT pcb,
X USHORT usRow,
X USHORT usColumn,
X HVIO hvio );
X
XUSHORT APIENTRY VioWrtCellStr(
X PCH pchCellStr,
X USHORT cb,
X USHORT usRow,
X USHORT usColumn,
X HVIO hvio );
X
XUSHORT APIENTRY VioWrtNAttr(
X PBYTE pAttr,
X USHORT cb,
X USHORT usRow,
X USHORT usColumn,
X HVIO hvio );
X
X
XUSHORT APIENTRY VioWrtNCell(
X PBYTE pCell,
X USHORT cb,
X USHORT usRow,
X USHORT usColumn,
X HVIO hvio );
X
X#endif
X
X#endif
X
X
X#ifndef KEYBOARD_ASCII_MODE
X#define KEYBOARD_ASCII_MODE 0x0008
X#endif
X
X#ifndef KEYBOARD_BINARY_MODE
X#define KEYBOARD_BINARY_MODE 0x0004
X#endif
END_OF_FILE
if test 6500 -ne `wc -c <'cursos2.h'`; then
echo shar: \"'cursos2.h'\" unpacked with wrong size!
fi
# end of 'cursos2.h'
fi
if test -f 'demos/newdemo.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'demos/newdemo.c'\"
else
echo shar: Extracting \"'demos/newdemo.c'\" \(8479 characters\)
sed "s/^X//" >'demos/newdemo.c' <<'END_OF_FILE'
X/* $Header: c:/curses/demos/RCS/newdemo.c%v 2.0 1992/11/15 03:32:03 MH Rel $
X *
X * DEMO.CPP - A demo program using PDCurses. The program illustrate
X * the use of colours for text output.
X */
X
X#include <stdio.h>
X#include <signal.h>
X#include <time.h>
X#include <curses.h>
X
X/*
X * The Australian map
X */
Xchar *AusMap[16] =
X{
X " A A ",
X " N.T. AAAAA AAAA ",
X " AAAAAAAAAAA AAAAAAAA ",
X " AAAAAAAAAAAAAAAAAAAAAAAAA Qld.",
X "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA ",
X "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ",
X " AAAAAAAAAAAAAAAAAAAAAAAAAAAA ",
X " AAAAAAAAAAAAAAAAAAAAAAAAA N.S.W.",
X "W.A. AAAAAAAAA AAAAAA Vic.",
X " AAA S.A. AA",
X " A Tas.",
X ""
X};
X
X/*
X * Funny messages
X */
X#define NMESSAGES 6
X
Xchar *messages[] =
X{
X "Hello from the Land Down Under",
X "The Land of crocs. and a big Red Rock",
X "Where the sunflower runs along the highways",
X "the dusty red roads lead one to loneliness",
X "Blue sky in the morning and",
X "freezing nights and twinkling stars",
X ""
X};
X
X/*
X * Main driver
X */
Xmain()
X{
XWINDOW *win;
Xint w, x, y, i, j, c, len;
Xtime_t t;
Xchar buffer[80], *message;
Xint width, height;
Xchtype save[80];
Xvoid trap();
X
X initscr();
X start_color();
X signal(SIGINT, trap);
X width = 48;
X height = 13; /* Create a drawing window */
X win = newwin(height, width, (LINES-height)/2, (COLS-width)/2);
X if(win == NULL)
X { endwin();
X return 1;
X }
X
X while(1)
X { init_pair(1,COLOR_WHITE,COLOR_BLUE);
X wattrset(win, COLOR_PAIR(1));
X werase(win);
X
X init_pair(2,COLOR_RED,COLOR_RED);
X wattrset(win, COLOR_PAIR(2));
X box(win, 0xba, 0xcd);
X wrefresh(win);
X /* Do ramdom output of a character */
X wattrset(win, COLOR_PAIR(1));
X c = 'a';
X for(i=0; i < 5000; ++i)
X { x = rand() % (width-2) + 1;
X y = rand() % (height-2) + 1;
X mvwaddch(win, y, x, c);
X wrefresh(win);
X if(typeahead(stdin))
X break;
X if(i == 2000)
X { c = 'b';
X init_pair(3,COLOR_CYAN,COLOR_YELLOW);
X wattron(win, COLOR_PAIR(3));
X }
X }
X
X SubWinTest(win);
X /* Erase and draw green window */
X init_pair(4,COLOR_YELLOW,COLOR_GREEN);
X wattrset(win, COLOR_PAIR(4) | A_BOLD);
X werase(win);
X wrefresh(win);
X /* Draw RED bounding box */
X wattrset(win, COLOR_PAIR(2));
X box(win, ' ', ' ');
X wrefresh(win);
X /* Display Australia map */
X wattrset(win, COLOR_PAIR(4) | A_BOLD);
X i = 0;
X while(*AusMap[i])
X { mvwaddstr(win, i+1, 8, AusMap[i]);
X wrefresh(win);
X delay_output(100);
X ++i;
X }
X
X init_pair(5,COLOR_BLUE,COLOR_WHITE);
X wattrset(win, COLOR_PAIR(5) | A_BLINK);
X mvwaddstr(win, height-2, 1, " PDCurses 2.0 for DOS and OS/2");
X wrefresh(win);
X
X /* Draw running messages */
X init_pair(6,COLOR_YELLOW,COLOR_WHITE);
X wattrset(win, COLOR_PAIR(6));
X message = messages[0];
X len = strlen(message);
X j = 0;
X i = 2;
X w = width-2;
X while(j < NMESSAGES)
X { strncpy(buffer, message, w - i);
X buffer[w-i] = 0;
X mvwaddstr(win, height/2, i, buffer);
X if(w - i < len)
X { memset(buffer, ' ', i);
X strcpy(buffer, message + (w - i));
X buffer[strlen(buffer)] = ' ';
X buffer[i-2] = '\0';
X mvwaddstr(win, height/2, 2, buffer);
X }
X wrefresh(win);
X if(typeahead(stdin))
X { flushinp();
X break;
X }
X mvwaddch(win, height/2, i, ' ');
X i = ++i % w;
X if(i < 2)
X { message = messages[++j%NMESSAGES];
X memset(buffer, ' ', w-2);
X buffer[w-2] = 0;
X mvwaddstr(win, height/2, 2, buffer);
X i = 2;
X }
X delay_output(300);
X }
X
X j = 0;
X /* Draw running As across in RED */
X init_pair(7,COLOR_RED,COLOR_GREEN);
X wattron(win, COLOR_PAIR(7));
X for(i=2; i < width - 4; ++i)
X { c = mvwinch(win, 4, i);
X save[j++] = c;
X c = c & 0x7f;
X mvwaddch(win, 4, i, c);
X }
X wrefresh(win);
X
X /* Put a message up wait for a key */
X i = height-2;
X wattrset(win, COLOR_PAIR(5));
X mvwaddstr(win, i, 1, " Type a key to continue or ESC to quit ");
X wrefresh(win);
X
X if(WaitForUser() == 0x1b)
X break;
X
X j = 0; /* Restore the old line */
X for(i=2; i < width - 4; ++i)
X mvwaddch(win, 4, i, save[j++]);
X wrefresh(win);
X
X BouncingBalls(win);
X /* Put a message up wait for a key */
X i = height-2;
X wattrset(win, COLOR_PAIR(5));
X mvwaddstr(win, i, 1, " Type a key to continue or ESC to quit ");
X wrefresh(win);
X if(WaitForUser() == 0x1b)
X break;
X }
Xexit:
X endwin();
X return 0;
X}
X
X/*
X * Test sub windows
X */
XSubWinTest(WINDOW *win)
X{
Xint w, h, sw, sh, bx, by;
XWINDOW *swin1, *swin2, *swin3;
X
X w = win->_maxx;
X h = win->_maxy;
X bx = win->_begx;
X by = win->_begy;
X sw = w / 3;
X sh = h / 3;
X if((swin1 = subwin(win, sh, sw, by+3, bx+5)) == NULL)
X return 1;
X if((swin2 = subwin(win, sh, sw, by+4, bx+8)) == NULL)
X return 1;
X if((swin3 = subwin(win, sh, sw, by+5, bx+11)) == NULL)
X return 1;
X
X init_pair(8,COLOR_RED,COLOR_BLUE);
X wattrset(swin1, COLOR_PAIR(8));
X werase(swin1);
X mvwaddstr(swin1, 0, 3, "Sub-window 1");
X wrefresh(swin1);
X
X init_pair(8,COLOR_CYAN,COLOR_MAGENTA);
X wattrset(swin2, COLOR_PAIR(8));
X werase(swin2);
X mvwaddstr(swin2, 0, 3, "Sub-window 2");
X wrefresh(swin2);
X
X init_pair(8,COLOR_YELLOW,COLOR_GREEN);
X wattrset(swin3, COLOR_PAIR(8));
X werase(swin3);
X mvwaddstr(swin3, 0, 3, "Sub-window 3");
X wrefresh(swin3);
X
X delwin(swin1);
X delwin(swin2);
X delwin(swin3);
X WaitForUser();
X return 0;
X}
X
X/*
X * Bouncing balls
X */
XBouncingBalls(WINDOW *win)
X{
Xchtype c1, c2, c3;
Xint w, h;
Xint x1, y1, xd1, yd1;
Xint x2, y2, xd2, yd2;
Xint x3, y3, xd3, yd3;
X
X w = win->_maxx;
X h = win->_maxy;
X x1 = 2 + rand() % (w - 4);
X y1 = 2 + rand() % (h - 4);
X x2 = 2 + rand() % (w - 4);
X y2 = 2 + rand() % (h - 4);
X x3 = 2 + rand() % (w - 4);
X y3 = 2 + rand() % (h - 4);
X xd1 = 1; yd1 = 1;
X xd2 = 1; yd2 = 0;
X xd3 = 0; yd3 = 1;
X while(!typeahead(stdin))
X { x1 = xd1 > 0 ? ++x1 : --x1;
X if(x1 <= 1 || x1 >= w - 2)
X xd1 = xd1 ? 0 : 1;
X y1 = yd1 > 0 ? ++y1 : --y1;
X if(y1 <= 1 || y1 >= h - 2)
X yd1 = yd1 ? 0 : 1;
X
X x2 = xd2 > 0 ? ++x2 : --x2;
X if(x2 <= 1 || x2 >= w - 2)
X xd2 = xd2 ? 0 : 1;
X y2 = yd2 > 0 ? ++y2 : --y2;
X if(y2 <= 1 || y2 >= h - 2)
X yd2 = yd2 ? 0 : 1;
X
X x3 = xd3 > 0 ? ++x3 : --x3;
X if(x3 <= 1 || x3 >= w - 2)
X xd3 = xd3 ? 0 : 1;
X y3 = yd3 > 0 ? ++y3 : --y3;
X if(y3 <= 1 || y3 >= h - 2)
X yd3 = yd3 ? 0 : 1;
X
X c1 = mvwinch(win, y1, x1);
X c2 = mvwinch(win, y2, x2);
X c3 = mvwinch(win, y3, x3);
X
X init_pair(8,COLOR_RED,COLOR_BLUE);
X wattrset(win, COLOR_PAIR(8));
X mvwaddch(win, y1, x1, 'O');
X init_pair(8,COLOR_BLUE,COLOR_RED);
X wattrset(win, COLOR_PAIR(8));
X mvwaddch(win, y2, x2, '*');
X init_pair(8,COLOR_YELLOW,COLOR_WHITE);
X wattrset(win, COLOR_PAIR(8));
X mvwaddch(win, y3, x3, '@');
X wmove(win, 0, 0);
X wrefresh(win);
X mvwaddch(win, y1, x1, c1);
X mvwaddch(win, y2, x2, c2);
X mvwaddch(win, y3, x3, c3);
X delay_output(150);
X }
X return 0;
X}
X
X/*
X * Wait for user
X */
XWaitForUser()
X{
Xtime_t t;
X
X t = time((time_t *)0);
X while(1)
X { if(typeahead(stdin))
X { if(PDC_get_bios_key() == 0x1b)
X return 0x1b;
X else
X return 0;
X }
X if(time((time_t *)0) - t > 5)
X return 0;
X }
X}
X
X/*
X * Trap interrupt
X */
Xvoid trap()
X{
X endwin();
X exit(0);
X}
X
X/* End of DEMO.C */
END_OF_FILE
if test 8479 -ne `wc -c <'demos/newdemo.c'`; then
echo shar: \"'demos/newdemo.c'\" unpacked with wrong size!
fi
# end of 'demos/newdemo.c'
fi
if test -f 'doc/intro.man' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'doc/intro.man'\"
else
echo shar: Extracting \"'doc/intro.man'\" \(6418 characters\)
sed "s/^X//" >'doc/intro.man' <<'END_OF_FILE'
X/*man-start*********************************************************************
X
X Introduction to XSI Curses Interface
X
XThe X/Open Group has identified a strong need for a generic terminal
Xinterface for applications that wish to be independent of terminal
Xhardware and connection method.
X
XThis interface should allow the attachment of character and
Xblock-oriented terminals. Furthermore, it should not put any
Xconstraints on how the terminals are attached (e.g., Local Area
XNetworks, PADs on X.25, etc.).
X
XThe curses library interfaces provides the user with a method of
Xupdating screens with reasonable optimisation.
X
XThe X/Open group has found it impossible to define a totally portable
Xset of curses interface routines that cover asynchronous, networked,
Xand synchronous terminals. The functions are oriented towards locally
Xconnected asynchronous terminals. For such terminals, applications
Xconforming to this interface are portable. The interface routines
Xcurses may, however, also be used with synchronous and networked
Xterminals, provided the restrictions below are considered.
X
XThese functions have been included been included in the X/Open
Xdefinition in the "optional" category. This means that although they
Xare likely to appear on many X/Open compliant systems, they are not
Xguaranteed to be on all systems. Where they are supported, they will
Xconform to the given definition.
X
X
X----------------------------------------------------------------------
X
X Synchronous and Networked Asynchronous Terminals
X
XThese notes indicate to the application writer some considerations to
Xbe borne in mind when driving synchronous, networked asynchronous
X(NWA) or non-standard directly connected asynchronous terminals.
X
XSuch terminals are often used in a mainframe environment and
Xcommunicatie to the host in block mode. That is, the user types
Xcharacters at the terminal then presses a special key to initiate
Xtransmission of the characters to the host.
X
XFrequently, although it may be possible to send arbitrary sized blocks
Xto the host, it may not be possible or desireable to cause a character
Xto be transmitted with only a single keystroke.
X
XThis can cause severe problems to an application wishing to make use
Xof single character input.
X
X
X
XOUTPUT
X
XThe curses package can be used in the normal way for all operations
Xpertaining to output to the terminal, with the possible exception that
Xon some terminals the refresh() routine may have to redraw the entire
Xscreen contents in order to perform any update.
X
XIf it is additionally necessary to clear the screen before each such
Xoperation, the result could be unacceptable.
X
X
XINPUT
X
XBecause of the nature of operation of synchronous (block-mode) and NWA
Xterminals, it may not be possible to support all or any of the curses
Xinput functions. In particular, the following points should be noted:
X
X* Single-character input may not be possible. It may be necessary to
X press a special key to cause all characters typed at the terminal to
X be transmitted to the host.
X
X* It may not be possibel to disable echo. Character echo may be performed
X directly by the terminal. On terminals that behave this way, any curses
X application that performs input should be aware that any characters
X type will appear on the screen wherever the cursor is positioned.
X This may not necessarily correspond to the position of the cursor in
X the window.
X
X
X----------------------------------------------------------------------
X
X Data Types and the <curses.h> Header
X
XThe data types supported by curses are described in this section.
X
XAs the library supports a procedural interface to the data types,
Xactual structure contents are not described. All curses data are
Xmanipulated using the routines provided.
X
X
XTHE <curses.h> HEADER
X
XThe <curses.h> header defines various constants and declares the data types
Xthat are available to the application.
X
X
XDATA TYPES
X
XThe following data types are declared:
X
X WINDOW* pointer to screen representation
X SCREEN* pointer to terminal descriptor
X bool boolean data type
X chtype representation of a character in a window
X
XThe actual WINDOW and SCREEN objects used to store information are
Xcreated by the corresponding routiens and a pointer to them is
Xprovided. All manipulation is through that pointer.
X
X
XCONSTANTS
X
XThe following constants are defined.
X
X
XGENERAL
X
X COLS number of columns on terminal screen
X ERR value returned on error condition
X FALSE boolean false value
X LINES number of lines on terminal screen
X OK value returned on successful completion
X NULL zero pointer value
X TRUE boolean true value
X
XVIDEO ATTRIBUTES
X
X A_BLINK blinking
X A_BOLD extra bright or bold
X A_DIM half bright
X A_REVERSE reverse video
X A_STANDOUT terminal's best highlighting mode
X A_UNDERLINE underlining
X A_ATTRIBUTES bit-mask to extract attributes
X A_CHARTEXT bit-mask to extract a character
X
XNormally, attributres are a property of the character.
X
X
XINPUT VALUES
X
XThe following constants might be returned by getch() if keypad() has
Xbeen enabled. Note that not all of these may be supported on a
Xparticular terminal if the terminal does not transmit a unique code
Xwhen the key is pressed or the definition for the key is not present
Xin the underlying table of terminal capabilities.
X
X KEY_BREAK break key
X KEY_DOWN the four arrow keys
X KEY_UP
X KEY_LEFT
X KEY_RIGHT
X KEY_HOME home key (upward+left arrow)
X KEY_BACKSPACE backspace
X KEY_F0 function keys; space for 64 keys is reserved
X KEY_F(n) (KEY_F0+(n))
X KEY_DL delete line
X KEY_IL insert line
X KEY_DC delete character
X KEY_IC insert character
X KEY_EIC exit insert character mode
X KEY_CLEAR clear screen
X KEY_EOS clear to end of screen
X KEY_EOL clear to end of line
X KEY_SF scroll 1 line forwards
X KEY_SR scroll 1 line backwards (reverse)
X KEY_NPAGE next page
X KEY_PPAGE previous page
X KEY_STAB set tab
X KEY_CTAB clear tab
X KEY_CATAB clear all tabs
X KEY_ENTER enter or send
X KEY_SRESET soft (partial) reset
X KEY_RESET reset or hard reset
X KEY_PRINT print or copy
X KEY_LL home down or bottom (lower left)
X KEY_A1 upper left of virtual keypad
X KEY_A3 upper right of virtual keypad
X KEY_B2 centre of virtual keypad
X KEY_C1 lower left of virtual keypad
X KEY_C3 lower right of virtual keypad
X
XThe virtual keypad is arranged like this:
X
X A1 up A3
X left B2 right
X C1 down C3
X
X**man-end**********************************************************************/
END_OF_FILE
if test 6418 -ne `wc -c <'doc/intro.man'`; then
echo shar: \"'doc/intro.man'\" unpacked with wrong size!
fi
# end of 'doc/intro.man'
fi
if test -f 'portable/flushinp.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/flushinp.c'\"
else
echo shar: Extracting \"'portable/flushinp.c'\" \(1744 characters\)
sed "s/^X//" >'portable/flushinp.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef flushinp
X
X#ifndef NDEBUG
Xchar *rcsid_flushinp = "$Header: c:/curses/portable/RCS/flushinp.c%v 2.0 1992/11/15 03:28:52 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X flushinp() - discard type-ahead
X
X X/Open Description:
X Throws away any type-ahead that has been typed by the user and
X has not yet been read by the program.
X
X PDCurses Description:
X If the PDCurses library is compiled under DOS with the FAST_VIDEO
X define true, then we will poke the BIOS keyboard buffer head and
X tail pointers, resetting the typeahead.
X
X If this is not true, then we will be unable to reliably flush
X the typeahead.
X
X X/Open Return Value:
X The flushinp() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int flushinp( void );
X X/Open Dec '88 int flushinp( void );
X BSD Curses int flushinp( void );
X SYS V Curses int flushinp( void );
X
X**man-end**********************************************************************/
X
Xint flushinp(void)
X{
Xextern int c_pindex; /* putter index */
Xextern int c_gindex; /* getter index */
Xextern int c_ungind; /* wungetch() push index */
X
X
X#if defined(DOS) && defined(FAST_VIDEO)
X short *KB_HEAD = (short *) 0x041aL; /* 40:1A BIOS KB head */
X short *KB_TAIL = (short *) 0x041cL; /* 40:1A BIOS KB tail */
X
X *KB_HEAD = *KB_TAIL; /* Force the BIOS kbd buf */
X /* head/tail pointers to be the */
X /* same... Real nasty trick... */
X
X#endif
X#ifdef OS2
X KbdFlushBuffer(0);
X#endif
X c_gindex = 1; /* set indices to kill buffer */
X c_pindex = 0;
X c_ungind = 0; /* clear c_ungch array */
X return( OK );
X}
END_OF_FILE
if test 1744 -ne `wc -c <'portable/flushinp.c'`; then
echo shar: \"'portable/flushinp.c'\" unpacked with wrong size!
fi
# end of 'portable/flushinp.c'
fi
if test -f 'portable/initscr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/initscr.c'\"
else
echo shar: Extracting \"'portable/initscr.c'\" \(4451 characters\)
sed "s/^X//" >'portable/initscr.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#define LOCAL_VAR
X#include <curses.h>
X#undef initscr
X
X
X
X
X#ifndef NDEBUG
Xchar *rcsid_initscr = "$Header: c:/curses/portable/RCS/initscr.c%v 2.0 1992/11/15 03:29:35 MH Rel $";
X#else
Xchar* _curses_notice = "PDCurses 2.0 - Public Domain 1992";
X#endif
X
X
X
XSCREEN _cursvar; /* curses variables */
X
XWINDOW* curscr; /* the current screen image */
XWINDOW* stdscr; /* the default screen window */
XWINDOW* tmpwin; /* the temporary screen image. formally in _cursvar */
Xint _default_lines = 25; /* default terminal height */
Xint LINES; /* current terminal height */
Xint COLS; /* current terminal width */
X
X#if defined DOS
XRegs regs;
X#endif
X
X/*
X * Global definitions for charget routines
X */
Xint c_pindex = 0; /* putter index */
Xint c_gindex = 1; /* getter index */
Xint c_ungind = 0; /* wungetch() push index */
Xchtype c_ungch[NUNGETCH]; /* array of ungotten chars */
XWINDOW* _getch_win_;
X
X/*
X * Global definitions for setmode routines
X */
Xstruct cttyset c_sh_tty = {0}; /* tty modes for def_shell_mode */
Xstruct cttyset c_pr_tty = {0}; /* tty modes for def_prog_mode */
Xstruct cttyset c_save_tty = {0};
Xstruct cttyset c_save_trm = {0};
X
X/*
X * Global definitions for printscan routines
X */
Xchar c_printscanbuf[513]; /* buffer used during I/O */
X
X/*
X * Global definitions for strget routines
X */
Xchar *c_strbeg;
X
X#if EMALLOC
Xvoid* emalloc( size_t );
Xvoid* ecalloc( size_t, size_t );
Xvoid efree( void* );
X
Xextern void* emalloc(); /* user's emalloc(size) */
Xextern void* ecalloc(); /* user's ecalloc(num,size) */
Xextern void efree(); /* user's efree(ptr) */
X#endif
X
Xextern void* malloc(); /* runtime's malloc(size) */
Xextern void* calloc(); /* runtime's calloc(num,size) */
Xextern void free(); /* runtime's free(ptr) */
X
Xvoid* (*mallc)(); /* ptr to some malloc(size) */
Xvoid* (*callc)(); /* ptr to some ecalloc(num,size)*/
Xvoid (*fre)(); /* ptr to some free(ptr) */
X
X
X
X
X/*man-start*********************************************************************
X
X initscr() - Initialize terminal environment
X
X X/Open Description:
X The first routine called should be initscr(). This will
X deterine the terminal type and initialize all curses data
X structures. The initscr() function also arranges that the
X first call to refresh() will clear the screen. If errors
X occur, initscr() will write an appropriate error message to
X standard error and exit. If the program wants an indication
X of error conditions, newterm() should be used instead of
X initscr().
X
X PDCurses Description:
X Due to the fact that newterm() does not yet exist in PDCurses,
X there is no way to recover from an error in initscr().
X
X X/Open Return Value:
X The initscr() function returns stdscr on success and calls
X exit() on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses WINDOW* initscr( void );
X X/Open Dec '88 WINDOW* initscr( void );
X BSD Curses WINDOW* initscr( void );
X SYS V Curses WINDOW* initscr( void );
X
X**man-end**********************************************************************/
X
XWINDOW* initscr(void)
X{
X if (_cursvar.alive)
X return( ERR );
X
X if (_cursvar.emalloc == EMALLOC_MAGIC)
X {
X#if EMALLOC
X memset(&_cursvar, 0, sizeof(SCREEN));
X _cursvar.emalloc = TRUE;
X mallc = emalloc;
X callc = ecalloc;
X fre = efree;
X#endif
X }
X else
X {
X memset(&_cursvar, 0, sizeof(SCREEN));
X mallc = malloc;
X callc = calloc;
X fre = free;
X }
X PDC_scr_open(&_cursvar, 0);
X _cursvar.orig_cursor = _cursvar.cursor;
X/* _cursvar.orig_font = PDC_get_font();*/
X _cursvar.orig_font = _cursvar.font;
X _cursvar.orgcbr = PDC_get_ctrl_break();
X _cursvar.blank = ' ';
X#ifdef FLEXOS
X _flexos_16bitmode();
X#endif
X/* savetty();*/
X/* LINES = PDC_get_rows();*/
X/* COLS = PDC_get_columns(); */
X LINES = _cursvar.lines;
X COLS = _cursvar.cols;
X
X if ((tmpwin = newwin(LINES, COLS, 0, 0)) == (WINDOW *) ERR)
X {
X fprintf( stderr, "initscr(): Unable to create tmpwin.\n" );
X exit( 3 );
X }
X if ((curscr = newwin(LINES, COLS, 0, 0)) == (WINDOW *) ERR)
X {
X fprintf( stderr, "initscr(): Unable to create curscr.\n" );
X exit( 2 );
X }
X if ((stdscr = newwin(LINES, COLS, 0, 0)) == (WINDOW *) ERR)
X {
X fprintf( stderr, "initscr(): Unable to create stdscr.\n" );
X exit( 1 );
X }
X curscr->_clear = FALSE;
X#ifdef REGISTERWINDOWS
X _cursvar.refreshall = FALSE;
X _inswin(stdscr, (WINDOW *)NULL);
X#endif
X _cursvar.alive = TRUE;
X def_shell_mode();
X return( stdscr );
X}
END_OF_FILE
if test 4451 -ne `wc -c <'portable/initscr.c'`; then
echo shar: \"'portable/initscr.c'\" unpacked with wrong size!
fi
# end of 'portable/initscr.c'
fi
if test -f 'portable/keyname.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/keyname.c'\"
else
echo shar: Extracting \"'portable/keyname.c'\" \(4209 characters\)
sed "s/^X//" >'portable/keyname.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef keyname
X
X#ifndef NDEBUG
Xchar *rcsid_keyname = "$Header: c:/curses/portable/RCS/keyname.c%v 2.0 1992/11/15 03:28:57 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X keyname() - returns pointer to name of key.
X
X X/Open Description:
X Returns a pointer to a character string containing a symbolic name
X corresponding to that specified in the argument key. key may be any
X key returned by wgetch().
X
X X/Open Return Value:
X The keyname() function a pointer to the symbolic name of a key or
X a pointer to NULL if an invalid key is passed.
X
X X/Open Errors:
X It is an error to pass a key value less than KEY_MIN or greater
X than KEY_MAX (these values defined in curses.h.
X
X Portability:
X PDCurses char *keyname( int );
X X/Open Dec '88 char * keyname( int );
X BSD Curses
X SYS V Curses char *keyname( int );
X
X**man-end**********************************************************************/
X
Xchar * keyname(int key)
X{
X static char *key_name[] =
X {
X "KEY_BREAK","KEY_DOWN","KEY_UP","KEY_LEFT","KEY_RIGHT","KEY_HOME","KEY_BACKSPACE",
X "KEY_F0","KEY_F(1)","KEY_F(2)","KEY_F(3)","KEY_F(4)","KEY_F(5)",
X "KEY_F(6)","KEY_F(7)","KEY_F(8)","KEY_F(9)","KEY_F(10)",
X "KEY_F(11)","KEY_F(12)","KEY_F(13)","KEY_F(14)","KEY_F(15)",
X "KEY_F(16)","KEY_F(17)","KEY_F(18)","KEY_F(19)","KEY_F(20)",
X "KEY_F(21)","KEY_F(22)","KEY_F(23)","KEY_F(24)","KEY_F(25)",
X "KEY_F(26)","KEY_F(27)","KEY_F(28)","KEY_F(29)","KEY_F(30)",
X "KEY_F(31)","KEY_F(32)","KEY_F(33)","KEY_F(34)","KEY_F(35)",
X "KEY_F(36)","KEY_F(37)","KEY_F(38)","KEY_F(39)","KEY_F(40)",
X "KEY_F(41)","KEY_F(42)","KEY_F(43)","KEY_F(44)","KEY_F(45)",
X "KEY_F(46)","KEY_F(47)","KEY_F(48)","KEY_F(49)","KEY_F(50)",
X "KEY_F(51)","KEY_F(52)","KEY_F(53)","KEY_F(54)","KEY_F(55)",
X "KEY_F(56)","KEY_F(57)","KEY_F(58)","KEY_F(59)","KEY_F(60)",
X "KEY_F(61)","KEY_F(62)","KEY_F(63)",
X "KEY_DL","KEY_IL","KEY_DC","KEY_IC","KEY_EIC","KEY_CLEAR","KEY_EOS","KEY_EOL",
X "KEY_SF","KEY_SR","KEY_NPAGE","KEY_PPAGE","KEY_STAB","KEY_CTAB","KEY_CATAB",
X "KEY_ENTER","KEY_SRESET","KEY_RESET","KEY_PRINT","KEY_LL","KEY_ABORT","KEY_SHELP",
X "KEY_LHELP","KEY_BTAB","KEY_BEG","KEY_CANCEL","KEY_CLOSE","KEY_COMMAND","KEY_COPY",
X "KEY_CREATE","KEY_END","KEY_EXIT","KEY_FIND","KEY_HELP","KEY_MARK","KEY_MESSAGE",
X "KEY_MOVE","KEY_NEXT","KEY_OPEN","KEY_OPTIONS","KEY_PREVIOUS","KEY_REDO",
X "KEY_REFERENCE","KEY_REFRESH","KEY_REPLACE","KEY_RESTART","KEY_RESUME","KEY_SAVE",
X "KEY_SBEG","KEY_SCANCEL","KEY_SCOMMAND","KEY_SCOPY","KEY_SCREATE","KEY_SDC","KEY_SDL",
X "KEY_SELECT","KEY_SEND","KEY_SEOL","KEY_SEXIT","KEY_SFIND","KEY_SHOME","KEY_SIC",
X "NO KEY NAME",
X "KEY_SLEFT","KEY_SMESSAGE","KEY_SMOVE","KEY_SNEXT","KEY_SOPTIONS","KEY_SPREVIOUS",
X "KEY_SPRINT","KEY_SREDO","KEY_SREPLACE","KEY_SRIGHT","KEY_SRSUME","KEY_SSAVE",
X "KEY_SSUSPEND","KEY_SUNDO","KEY_SUSPEND","KEY_UNDO",
X "ALT_0","ALT_1","ALT_2","ALT_3","ALT_4","ALT_5","ALT_6","ALT_7","ALT_8","ALT_9",
X "ALT_A","ALT_B","ALT_C","ALT_D","ALT_E","ALT_F","ALT_G","ALT_H","ALT_I","ALT_J",
X "ALT_K","ALT_L","ALT_M","ALT_N","ALT_O","ALT_P","ALT_Q","ALT_R","ALT_S","ALT_T",
X "ALT_U","ALT_V","ALT_W","ALT_X","ALT_Y","ALT_Z","CTL_LEFT","CTL_RIGHT","CTL_PGUP",
X "CTL_PGDN","CTL_HOME","CTL_END","KEY_BACKTAB","KEY_A1","KEY_A2","KEY_A3","KEY_B1",
X "KEY_B2","KEY_B3","KEY_C1","KEY_C2","KEY_C3","PADSLASH","PADENTER","CTL_PADENTER",
X "ALT_PADENTER","SHF_PADSTOP","PADSTAR","PADMINUS","PADPLUS","CTL_PADSTOP",
X "CTL_PADCENTER","CTL_PADPLUS","CTL_PADMINUS","CTL_PADSLASH","CTL_PADSTAR","ALT_PADPLUS",
X "ALT_PADMINUS","ALT_PADSLASH","ALT_PADSTAR","CTL_INS","ALT_DEL","ALT_INS","CTL_UP",
X "CTL_DOWN","CTL_TAB","ALT_TAB","ALT_MINUS","ALT_EQUAL","ALT_HOME","ALT_PGUP","ALT_PGDN",
X "ALT_END","ALT_UP","ALT_DOWN","ALT_RIGHT","ALT_LEFT","ALT_ENTER","ALT_ESC","ALT_BQUOTE",
X "ALT_LBRACKET","ALT_RBRACKET","ALT_SEMICOLON","ALT_FQUOTE","ALT_COMMA","ALT_STOP",
X "ALT_FSLASH","ALT_BKSP","CTL_BKSP","CTL_PAD0","CTL_PAD1","CTL_PAD2","CTL_PAD3","CTL_PAD4",
X "CTL_PAD5","CTL_PAD6","CTL_PAD7","CTL_PAD8","CTL_PAD9","CTL_DEL","ALT_BSLASH","CTL_ENTER"
X };
X if (key < KEY_MIN
X || key > KEY_MAX)
X return((char *)"NO KEY NAME");
X return( key_name[key-KEY_MIN] );
X}
END_OF_FILE
if test 4209 -ne `wc -c <'portable/keyname.c'`; then
echo shar: \"'portable/keyname.c'\" unpacked with wrong size!
fi
# end of 'portable/keyname.c'
fi
if test -f 'portable/wgetch.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wgetch.c'\"
else
echo shar: Extracting \"'portable/wgetch.c'\" \(4290 characters\)
sed "s/^X//" >'portable/wgetch.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wgetch
X
X#ifndef NDEBUG
Xchar *rcsid_wgetch = "$Header: c:/curses/portable/RCS/wgetch.c%v 2.0 1992/11/15 03:29:25 MH Rel $";
X#endif
X
Xstatic WINDOW *w; /* to reduce stack usage */
X
X
X
X
X
X
X
X/*man-start*********************************************************************
X
X wgetch() - read character
X
X X/Open Description:
X A character is read from the terminal associated with the
X window. In nodelay mode, if there is no input waiting,
X the value ERR is returned. In delay mode, the program will
X hang until the system passes text through to the program.
X Depending on the setting of cbreak(), this will be after one
X character or after the first newline. Unless noecho() has
X been set, the character will also be echoed into the designated
X window.
X
X If keypad() is TRUE, and a function key is pressed, the token for
X that function key will be returned instead of the raw characters.
X Possible function keys are defined in <curses.h> with integers
X beginning with 0401, whose names begin with KEY_. If a character
X is received that could be the beginning of a function key (such as
X escape), curses will set a timer. If the remainder of the sequence
X does not come in within the designated time, the character will be
X passed through, otherwise the function key value will be returned.
X For this reason, on many terminals, there will be a delay after a
X user presses the escape key before the escape is returned to the
X program. (Use by a programmer of the escape key for a single
X character function is discouraged.)
X
X NOTE: getch(), mvgetch() and mvwgetch() are macros.
X
X PDCurses Description:
X Given the nature of the PC, there is no such timer set for an
X incoming ESCAPE value, because function keys generate unique
X scan codes that are not prefixed with the ESCAPE character.
X
X Also, note that the getch() definition will conflict with
X many DOS compiler's runtime libraries.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wgetch( WINDOW* win );
X X/Open Dec '88 int wgetch( WINDOW* win );
X BSD Curses int wgetch( WINDOW* win );
X SYS V Curses int wgetch( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint wgetch(WINDOW *win)
X{
Xextern short c_pindex; /* putter index */
Xextern short c_gindex; /* getter index */
Xextern short c_ungind; /* wungetch() push index */
Xextern chtype c_ungch[NUNGETCH]; /* array of ungotten chars */
Xextern WINDOW* _getch_win_;
X
X signed key;
X bool cbr;
Xstatic chtype buffer[_INBUFSIZ]; /* character buffer */
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X _getch_win_ = win;
X if (c_ungind) /* if ungotten char exists */
X return( c_ungch[--c_ungind] ); /* remove and return it */
X if ((!_cursvar.raw_inp) &&
X (!_cursvar.cbreak))
X {
X /*
X * if normal
X */
X if (c_gindex < c_pindex)
X {
X /*
X * and data in buffer
X */
X return( buffer[c_gindex++] );
X }
X }
X
X w = win; /* static for speed & stack */
X c_pindex = 0; /* prepare to buffer data */
X c_gindex = 0;
X for(;;) /* loop for any buffering */
X {
X if (_cursvar.raw_inp)
X {
X /*
X * get a raw character
X */
X key = PDC_rawgetch();
X }
X else
X {
X /*
X * get a system character
X * if break return proper
X */
X cbr = PDC_get_ctrl_break();
X PDC_set_ctrl_break(_cursvar.orgcbr);
X key = PDC_sysgetch();
X PDC_set_ctrl_break(cbr); /* restore as it was */
X }
X if (w->_nodelay && (key == -1))
X {
X /*
X * if nodelay and no char
X */
X return( ERR );
X }
X if ((key == '\r') &&
X (_cursvar.autocr) &&
X (!_cursvar.raw_inp))
X {
X /*
X * translate CR
X */
X key = '\n';
X }
X if (_cursvar.echo && (key < 0x100))
X {
X /*
X * if echo is enabled
X */
X waddch(w, key);
X wrefresh(w);
X }
X if (_cursvar.raw_inp || _cursvar.cbreak)
X {
X /*
X * if no buffering
X */
X return( key );
X }
X
X if (c_pindex < _INBUFSIZ - 2)
X {
X /*
X * if no overflow, put data in buffer
X */
X buffer[c_pindex++] = key;
X }
X if ((key == '\n') || (key == '\r'))
X {
X /*
X * if we got a line
X */
X return( buffer[c_gindex++] );
X }
X }
X}
END_OF_FILE
if test 4290 -ne `wc -c <'portable/wgetch.c'`; then
echo shar: \"'portable/wgetch.c'\" unpacked with wrong size!
fi
# end of 'portable/wgetch.c'
fi
if test -f 'portable/wnoutref.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wnoutref.c'\"
else
echo shar: Extracting \"'portable/wnoutref.c'\" \(4158 characters\)
sed "s/^X//" >'portable/wnoutref.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wnoutrefresh
X
X#ifndef NDEBUG
Xchar *rcsid_wnoutref = "$Header: c:/curses/portable/RCS/wnoutref.c%v 2.0 1992/11/15 03:29:36 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wnoutrefresh() - do effiecient refresh
X
X X/Open Description: (part of the wnoutrefresh() description.)
X These two routines allow multiple updates with more efficiency
X than wrefresh() alone. In addition to all of the window
X structures representing the terminal screen: a physical screen,
X describing what is actually on the screen and a virtual screen,
X describing what the programmer wants to have on the screen.
X
X The wrefresh() function works by first calling wnoutrefresh(),
X which copies the named window to the virtual screen. It then
X calls doupdate(), which compares the virtual screen to the
X physical screen and does the actual update. If the programmer
X wishes to output several windows at once, a series of cals to
X wrefresh() will result in alternating calls to wnoutrefresh()
X and doupdate(), causing several bursts of output to the
X screen. By first calling wnoutrefresh() for each window, it
X is then possible to call doupdate() once. This results in
X only one burst of output, with probably fewer total characters
X transmitted and certainly less CPU time used.
X
X PDCurses Description:
X In addition to the above, if REGISTERWINDOWS is TRUE when the
X library was compiled, any windows registered (true by default
X with PDCurses and _cursvar.refreshall is TRUE, then all
X registered windows will be called via wnoutrefresh() before
X the actual screen update begins.
X
X X/Open Return Value:
X The doupdate() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int wnoutrefresh( WINDOW* w );
X X/Open Dec '88 int wnoutrefresh( WINDOW* w );
X BSD Curses int wnoutrefresh( WINDOW* w );
X SYS V Curses int wnoutrefresh( WINDOW* w );
X
X**man-end**********************************************************************/
X
Xint wnoutrefresh(register WINDOW *win)
X{
Xregister chtype* dstp;
Xregister chtype* srcp;
Xregister int first; /* first changed char on line */
Xregister int last; /* last changed char on line */
X int begy; /* window's place on screen */
X int begx;
X WINDOW* s;
X int i;
X int j;
X int y;
X int x;
X int len;
X chtype attrs;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X y = win->_cury;
X x = win->_curx;
X attrs = win->_attrs;
X if (win->_title != NULL)
X len = strlen(win->_title);
X /*
X * There may be a better place to implement window titles, but this
X * seems to be the best place. -- Frotz
X */
X if ((len > 0) && (win->_title != NULL) && !(win->_flags & _SUBWIN))
X {
X wattrset(win, win->_title_attr);
X mvwprintw(win, 0, (win->_title_ofs), "%s", (long) win->_title);
X wmove(win, y, x); /* restore cursor postion */
X wattrset(win, attrs); /* restore attributes */
X }
X
X if (win->_flags & _PAD)
X return( ERR );
X
X s = tmpwin;
X begy = win->_begy;
X begx = win->_begx;
X
X for (i = 0, j = begy; i < win->_maxy; i++, j++)
X {
X if (win->_firstch[i] != _NO_CHANGE)
X {
X first = win->_firstch[i];
X last = win->_lastch[i];
X
X#if defined(DOS) || defined(OS2)
X# if SMALL || MEDIUM
X srcp = &(win->_y[i][first]);
X dstp = &(s->_y[j][begx + first]);
X movedata( FP_SEG(srcp), FP_OFF(srcp),
X FP_SEG(dstp), FP_OFF(dstp),
X (last - first + 1) * sizeof(chtype));
X# else
X memcpy(&(s->_y[j][begx + first]),
X &(win->_y[i][first]),
X (last - first + 1) * sizeof(chtype));
X# endif
X#endif
X first += begx; /* s's min/max change positions */
X last += begx;
X
X if (s->_firstch[j] != _NO_CHANGE)
X s->_firstch[j] = min(s->_firstch[j], first);
X else
X s->_firstch[j] = first;
X
X s->_lastch[j] = max(s->_lastch[j], last);
X
X win->_firstch[i] = _NO_CHANGE; /* updated now */
X }
X win->_lastch[i] = _NO_CHANGE; /* updated now */
X }
X
X if (win->_clear)
X {
X win->_clear = FALSE;
X s->_clear = TRUE;
X }
X
X if (!win->_leave)
X {
X s->_cury = win->_cury + begy;
X s->_curx = win->_curx + begx;
X }
X return( OK );
X}
END_OF_FILE
if test 4158 -ne `wc -c <'portable/wnoutref.c'`; then
echo shar: \"'portable/wnoutref.c'\" unpacked with wrong size!
fi
# end of 'portable/wnoutref.c'
fi
if test -f 'private/_queryad.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_queryad.c'\"
else
echo shar: Extracting \"'private/_queryad.c'\" \(4567 characters\)
sed "s/^X//" >'private/_queryad.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__queryad = "$Header: c:/curses/private/RCS/_queryad.c%v 2.0 1992/11/15 03:24:30 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_query_adapter_type() - Determine PC video adapter type
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Thanks to Jeff Duntemann, K16RA for providing the impetus
X (through the Dr. Dobbs Journal, March 1989 issue) for getting
X the routines below merged into Bjorn Larsson's PDCurses 1.3...
X -- fr...@dri.com 900730
X
X PDCurses Return Value:
X This function returns a macro identifier indicating the adapter
X type. See the list of adapter types in PRIVATE/CURSPRIV.H.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_query_adapter_type( void );
X
X**man-end**********************************************************************/
X
X#ifdef OS2
XVIOCONFIGINFO PDC_query_adapter_type(void)
X#else
Xint PDC_query_adapter_type(void)
X#endif
X{
X#ifdef FLEXOS
X return (_FLEXOS);
X#endif
X#ifdef DOS
X int retval = _NONE;
X int equip;
X short far *VIDEO_BASE;
X
X /*
X * Attempt to call VGA Identify Adapter Function...
X */
X regs.h.ah = 0x1a;
X regs.h.al = 0;
X int86(0x10, ®s, ®s);
X if ((regs.h.al == 0x1a) && (retval == _NONE))
X {
X /*
X * We know that the PS/2 video BIOS is alive and well.
X */
X switch (regs.h.al)
X {
X case 0:
X retval = _NONE;
X break;
X case 1:
X retval = _MDA;
X break;
X case 2:
X retval = _CGA;
X break;
X case 4:
X retval = _EGACOLOR;
X _cursvar.sizeable = TRUE;
X break;
X case 5:
X retval = _EGAMONO;
X break;
X case 26:
X retval = _VGACOLOR; /* ...alt. VGA BIOS... */
X case 7:
X retval = _VGACOLOR;
X _cursvar.sizeable = TRUE;
X break;
X case 8:
X retval = _VGAMONO;
X break;
X case 10:
X case 13:
X retval = _MCGACOLOR;
X break;
X case 12:
X retval = _MCGAMONO;
X break;
X default:
X retval = _CGA;
X break;
X }
X }
X else
X {
X /*
X * No VGA BIOS, check for an EGA BIOS by selecting an
X * Alternate Function Service...
X *
X * bx == 0x0010 --> return EGA information
X */
X regs.h.ah = 0x12;
X regs.x.bx = 0x10;
X int86(0x10, ®s, ®s);
X if ((regs.h.bl != 0x10) && (retval == _NONE))
X {
X /*
X * An EGA BIOS exists...
X */
X regs.h.ah = 0x12;
X regs.h.bl = 0x10;
X int86(0x10, ®s, ®s);
X if (regs.h.bh == 0)
X retval = _EGACOLOR;
X else
X retval = _EGAMONO;
X }
X else
X if (retval == _NONE)
X {
X /*
X * Now we know we only have CGA or MDA...
X */
X int86(0x11, ®s, ®s);
X equip = (regs.h.al & 0x30) >> 4;
X switch (equip)
X {
X case 1:
X case 2:
X retval = _CGA;
X break;
X case 3:
X retval = _MDA;
X break;
X default:
X retval = _NONE;
X break;
X }
X }
X }
X VIDEO_BASE = (void far *) 0x0463L;
X if (*VIDEO_BASE == 0x3d4)
X {
X _cursvar.video_seg = 0xb800;
X switch (retval)
X {
X case _EGAMONO:
X retval = _EGACOLOR;
X break;
X case _VGAMONO:
X retval = _VGACOLOR;
X break;
X default:
X break;
X }
X }
X if (*VIDEO_BASE == 0x3b4)
X {
X _cursvar.video_seg = 0xb000;
X switch (retval)
X {
X case _EGACOLOR:
X retval = _EGAMONO;
X break;
X case _VGACOLOR:
X retval = _VGAMONO;
X break;
X default:
X break;
X }
X }
X if ((retval == _NONE) ||
X (retval == _CGA))
X {
X _cursvar.direct_video = FALSE;
X }
X if ((unsigned int) _cursvar.video_seg == 0xb000)
X _cursvar.mono = TRUE;
X else
X _cursvar.mono = FALSE;
X if (!_cursvar.adapter)
X _cursvar.adapter = retval;
X return (PDC_sanity_check(retval));
X#endif
X#ifdef OS2
X int retval = _NONE;
X VIOCONFIGINFO configInfo;
X
X VioGetConfig(0, &configInfo, 0);
X _cursvar.sizeable = TRUE;
X return configInfo;
X# if 0
X switch (configInfo.adapter)
X {
X case 0:
X retval = _MDA;
X _cursvar.mono =TRUE;
X break;
X case 1:
X retval = _CGA;
X _cursvar.mono = FALSE;
X break;
X case 2: switch (configInfo.display)
X {
X case 0:
X case 3:
X retval = _EGAMONO;
X _cursvar.mono = TRUE;
X break;
X case 1:
X case 2:
X case 4:
X case 9:
X retval = _EGACOLOR;
X _cursvar.mono = FALSE;
X break;
X }
X break;
X case 3: switch (configInfo.display)
X {
X case 0:
X case 3:
X retval = _VGAMONO;
X _cursvar.sizeable = TRUE;
X _cursvar.mono = TRUE;
X break;
X case 1:
X case 2:
X case 4:
X case 9:
X retval = _VGACOLOR;
X _cursvar.sizeable = TRUE;
X _cursvar.mono = FALSE;
X break;
X }
X break;
X default:
X retval = _CGA;
X _cursvar.mono = FALSE;
X break;
X }
X return (PDC_sanity_check(retval));
X# endif
X#endif
X}
END_OF_FILE
if test 4567 -ne `wc -c <'private/_queryad.c'`; then
echo shar: \"'private/_queryad.c'\" unpacked with wrong size!
fi
# end of 'private/_queryad.c'
fi
if test -f 'private/_xfrmlin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_xfrmlin.c'\"
else
echo shar: Extracting \"'private/_xfrmlin.c'\" \(4281 characters\)
sed "s/^X//" >'private/_xfrmlin.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__xfrmlin = "$Header: c:/curses/private/RCS/_xfrmlin.c%v 2.0 1992/11/15 03:24:38 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_transform_line() - transform
X
X PDCurses Description:
X This is a private PDCurses function.
X
X Updates the given physical line to look like the corresponding
X line in _cursvar.tmpwin.
X
X PDCurses Return Value:
X This routine returns TRUE if a premature refresh end
X is allowed, and there is an input character pending. Otherwise,
X FALSE is returned.
X
X PDCurses Errors:
X No errors are defined for this routine.
X
X Portability:
X PDCurses bool PDC_transform_line( int lineno );
X
X**man-end**********************************************************************/
X
Xbool PDC_transform_line(register int lineno)
X{
X#if defined (MSC) && defined (DOS)
Xchtype* dstp;
Xchtype* srcp;
X#else
Xregister chtype* dstp;
Xregister chtype* srcp;
X#endif
X int rc;
X int x;
X int endx;
X int len;
X chtype* ch;
X extern unsigned char atrtab[MAX_ATRTAB];
X chtype temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */
X chtype chr;
X register int j;
X#ifdef FLEXOS
X char line[80];
X char attr[80];
X FFRAME sframe;
X RECT drect;
X RECT srect;
X#endif
X
X if (twin == (WINDOW *)NULL)
X return( FALSE );
X
X x = twin->_firstch[lineno];
X endx = twin->_lastch[lineno];
X dstp = curscr->_y[lineno] + x;
X srcp = twin->_y[lineno] + x;
X len = endx-x+1;
X
X ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */
X#ifdef DOS
X# if SMALL || MEDIUM
X movedata(FP_SEG(srcp), FP_OFF(srcp),
X FP_SEG(ch), FP_OFF(ch),len * sizeof(chtype));
X# else
X memcpy(ch, srcp, len * sizeof(chtype));
X# endif
X#else
X memcpy(ch, srcp, len * sizeof(chtype));
X#endif
X for (j=0;j<len;j++) /* for each chtype in the line... */
X {
X chr = temp_line[j] & A_CHARTEXT;
X temp_line[j] = chtype_attr(temp_line[j]) | chr;
X }
X
X if (_cursvar.direct_video)
X {
X#ifdef DOS
X# if SMALL || MEDIUM
X movedata(FP_SEG(srcp), FP_OFF(srcp),
X FP_SEG(dstp), FP_OFF(dstp),len * sizeof(chtype));
X# else
X memcpy(dstp, srcp, len * sizeof(chtype));
X# endif
X#endif
X#ifdef OS2
X memcpy(dstp, srcp, len * sizeof(chtype));
X#endif
X#ifdef FLEXOS
X _split_plane(curscr, &line[0], &attr[0], lineno, x, lineno, endx);
X
X drect.r_row = lineno;
X drect.r_col = x;
X drect.r_nrow = 1;
X drect.r_ncol = len;
X
X sframe.fr_pl[0] = (UBYTE *) line;
X sframe.fr_pl[1] = (UBYTE *) attr;
X sframe.fr_nrow = 1;
X sframe.fr_ncol = len;
X sframe.fr_use = 0x03;
X
X srect.r_col = 0;
X srect.r_row = 0;
X srect.r_nrow = 1;
X srect.r_ncol = len;
X
X s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect,
X (far unsigned short *) &sframe, (far unsigned
X short *) &srect);
X
X#endif
X#ifdef DOS
X# if SMALL || MEDIUM || MSC
X movedata(FP_SEG(ch), FP_OFF(ch),
X _cursvar.video_seg,
X _cursvar.video_ofs+(((lineno*curscr->_maxx)+x)*sizeof(chtype)),
X len * sizeof(chtype));
X# else
X memcpy(MK_FP(_cursvar.video_seg,
X _cursvar.video_ofs + (((lineno * curscr->_maxx) + x) * sizeof(chtype))),
X ch, len * sizeof(chtype));
X# endif
X#endif
X#ifdef OS2
X VioWrtCellStr ((PCH)ch, (USHORT)(len*sizeof(chtype)), (USHORT)lineno, (USHORT)x, 0);
X#endif
X }
X else
X {
X for (; x <= endx; x++)
X {
X PDC_gotoxy(lineno, x);
X PDC_putc( (*ch & A_CHARTEXT),(*ch & A_ATTRIBUTES) >> 8 );
X ch++;
X }
X }
X twin->_firstch[lineno] = _NO_CHANGE;
X twin->_lastch[lineno] = _NO_CHANGE;
X
X/*****************************************************************/
X/*****************************************************************/
X/*****************************************************************/
X/*****************************************************************/
X/* temporarily turn off check for typeahead() */
X/*
X rc = typeahead(stdin);
X if (_cursvar.refrbrk && rc)
X return(TRUE);
X else
X return(FALSE);
X*/
X/*****************************************************************/
X/*****************************************************************/
X/*****************************************************************/
X/*****************************************************************/
X return(FALSE);
X}
END_OF_FILE
if test 4281 -ne `wc -c <'private/_xfrmlin.c'`; then
echo shar: \"'private/_xfrmlin.c'\" unpacked with wrong size!
fi
# end of 'private/_xfrmlin.c'
fi
echo shar: End of archive 4 \(of 11\).
cp /dev/null ark4isdone
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: demos/firework.c doc/overview.man nonport/resizew.c
# nonport/winprint.c portable/initpair.c portable/longname.c
# portable/pnoutref.c portable/waddch.c portable/wgetstr.c
# private/_chadd.c private/_clrupda.c private/_inswin.c
# private/_makenew.c tools/manext.c
# Wrapped by kent@sparky on Wed Nov 18 21:44:07 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 5 (of 11)."'
if test -f 'demos/firework.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'demos/firework.c'\"
else
echo shar: Extracting \"'demos/firework.c'\" \(3454 characters\)
sed "s/^X//" >'demos/firework.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include <signal.h>
X#include <curses.h>
X#include <ctype.h>
X#include <sys/types.h>
X#include <time.h>
X#define DELAYSIZE 100
Xmain()
X{
X int start,end,row,diff,flag,direction,seed;
X int myrefresh();
X void explode();
X
X initscr();
X if (has_colors())
X start_color();
X seed = time((time_t *)0);
X srand(seed);
X while(typeahead(stdin) == FALSE)
X {
X do {
X start = rand() % (COLS -3);
X end = rand() % (COLS - 3);
X start = (start < 2) ? 2 : start;
X end = (end < 2) ? 2 : end;
X direction = (start > end) ? -1 : 1;
X diff = abs(start-end);
X } while (diff<2 || diff>=LINES-2);
X attrset(A_NORMAL);
X for (row=0;row<diff;row++)
X {
X mvprintw(LINES - row,start + (row * direction),
X (direction < 0) ? "\\" : "/");
X if (flag++)
X {
X myrefresh();
X clear();
X flag = 0;
X }
X }
X if (flag++)
X {
X myrefresh();
X flag = 0;
X }
X seed = time((time_t *)0);
X srand(seed);
X explode(LINES-row,start+(diff*direction));
X clear();
X myrefresh();
X }
X endwin();
X exit(0);
X}
Xvoid explode(row,col)
Xint row,col;
X{
X clear();
X mvprintw(row,col,"-");
X myrefresh();
X
X init_pair(1,get_colour(),COLOR_BLACK);
X attrset(COLOR_PAIR(1));
X mvprintw(row-1,col-1," - ");
X mvprintw(row,col-1,"-+-");
X mvprintw(row+1,col-1," - ");
X myrefresh();
X
X init_pair(1,get_colour(),COLOR_BLACK);
X attrset(COLOR_PAIR(1));
X mvprintw(row-2,col-2," --- ");
X mvprintw(row-1,col-2,"-+++-");
X mvprintw(row, col-2,"-+#+-");
X mvprintw(row+1,col-2,"-+++-");
X mvprintw(row+2,col-2," --- ");
X myrefresh();
X
X init_pair(1,get_colour(),COLOR_BLACK);
X attrset(COLOR_PAIR(1));
X mvprintw(row-2,col-2," +++ ");
X mvprintw(row-1,col-2,"++#++");
X mvprintw(row, col-2,"+# #+");
X mvprintw(row+1,col-2,"++#++");
X mvprintw(row+2,col-2," +++ ");
X myrefresh();
X
X init_pair(1,get_colour(),COLOR_BLACK);
X attrset(COLOR_PAIR(1));
X mvprintw(row-2,col-2," # ");
X mvprintw(row-1,col-2,"## ##");
X mvprintw(row, col-2,"# #");
X mvprintw(row+1,col-2,"## ##");
X mvprintw(row+2,col-2," # ");
X myrefresh();
X
X init_pair(1,get_colour(),COLOR_BLACK);
X attrset(COLOR_PAIR(1));
X mvprintw(row-2,col-2," # # ");
X mvprintw(row-1,col-2,"# #");
X mvprintw(row, col-2," ");
X mvprintw(row+1,col-2,"# #");
X mvprintw(row+2,col-2," # # ");
X myrefresh();
X return;
X}
Xint myrefresh()
X{
X delay_output(DELAYSIZE);
X move(LINES-1,COLS-1);
X refresh();
X}
X
Xint get_colour()
X{
X int attr;
X attr = (rand() % 16)+1;
X if (attr == 1 || attr == 9)
X attr = COLOR_RED;
X if (attr > 8)
X attr |= A_BOLD;
X return(attr);
X}
END_OF_FILE
if test 3454 -ne `wc -c <'demos/firework.c'`; then
echo shar: \"'demos/firework.c'\" unpacked with wrong size!
fi
# end of 'demos/firework.c'
fi
if test -f 'doc/overview.man' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'doc/overview.man'\"
else
echo shar: Extracting \"'doc/overview.man'\" \(3058 characters\)
sed "s/^X//" >'doc/overview.man' <<'END_OF_FILE'
X/*man-start*********************************************************************
X
X Curses Overview
X
XThe X/Open Curses Interface Definition describes a set of C-Language
Xfunctions that provide screen-handling and updating, which are
Xcollectively known as the curses library.
X
XThe curses library permits manipulation of data structures called
Xwindows which may be thought of as two-dimensional arrays of
Xcharacters representing all or part of a terminal's screen. The
Xwindows are manipulated using a procedural interface described
Xelsewhere. The curses package maintains a record of what characters
Xare on the screen. At the most basic level, manipulation is done with
Xthe routines move() and addch() which are used to "move" the curses
Xaround and add characters to the default window, stdscr, which
Xrepresents the whole screen.
X
XAn application may use these routines to add data to the window in any
Xconvenient order. Once all data have been added, the routine
Xrefresh() is called. The package then determines what changes have
Xbeen made which affect the screen. The screen contents are then
Xchanged to reflect those characters now in the window. using a
Xsequence of operations optimised for the type of terminal in use.
X
XAt a higher level routines combining the actions of move() and addch()
Xare defined, as are routines to add whole strings and to perform
Xformat conversions in the manner of printf().
X
XInterfaces are alse defined to erase the entire window and to specify
Xthe attributes of individual characters in the winodw. Attributes
Xsuch as inverse video, underline and blink can be used on a
Xper-character basis.
X
XNew windows can be created by allowing the application to build
Xseveral images of the screen and display the appropriate one very
Xquickly. New windows are created using the routine newwin(). For
Xeach routine that manipulates the default window, stdscr, there is a
Xcorresponding routine prefixed with w to manipulate the contents of a
Xspecified window; for example, move() and wmove(). In fact, move(...)
Xis functionally equivalent to wmove( stdscr, ...). This is similar to
Xthe interface offered by printf(...) and fprintf(stdout, ...).
X
XWindows do not have to correspond to the entire screen. It is
Xpossible to create smaller windows, and also to indicate that the
Xwindow is only partially visible on the screen. Furthermore, large
Xwindows or pads, which are bigger than the actual screen size, may be
Xcreated.
X
XThe routine newterm() may be called to "open" additional terminals by
Xlarge applications wishing to manipulate several terminals at once.
XThe set_term() function is used to select the terminal whose screen is
Xto be updated by the next refresh().
X
XInterfaces are also defined to allow input character manipulation and
Xto disable and enable many input attributes: character echo, single
Xcharacter input with or without signal processing (cbreak or raw
Xmodes), carriage returns mapping to newlines, screen scrolling, etc.
X
X**man-end**********************************************************************/
END_OF_FILE
if test 3058 -ne `wc -c <'doc/overview.man'`; then
echo shar: \"'doc/overview.man'\" unpacked with wrong size!
fi
# end of 'doc/overview.man'
fi
if test -f 'nonport/resizew.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/resizew.c'\"
else
echo shar: Extracting \"'nonport/resizew.c'\" \(3723 characters\)
sed "s/^X//" >'nonport/resizew.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef resize_win
X
X#ifndef NDEBUG
Xchar *rcsid_resizew = "$Header: c:/curses/nonport/RCS/resizew.c%v 2.0 1992/11/15 03:18:28 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X resize_win() - Resize a window
X
X PDCurses Description:
X Resizes the passed WINDOW* to reflect the maximum size
X represented by the WINDOW* fields _pmaxy and _pmaxx.
X
X If _maxy < _pmaxy then new lines will be added.
X The same is also true for _maxx and _pmaxx.
X
X WARNING TO PROGRAMMERS:
X
X This function assumes that when a window is enlarged
X horizontally, the contents on each existing line will be
X copied to the new, enlarged line and the remainder of the
X enlarged line will be cleared.
X
X When a window is enlarged vertically, each new line added
X will be blank.
X
X All borders will be observed and enlarged appropriately.
X
X When a windows are shrunk, only the WINDOW* fields _pmaxy and
X _pmaxx are affected.
X
X PDCurses Return Value:
X The resize_win() function returns a NULL pointer or a valid
X WINDOW* which may or may not point to the same physical
X window. Besure to change all pointers to the passed window
X to the address returned by this function (but only if it is
X non-zero).
X
X PDCurses Errors:
X It is an error to pass a NULL WINDOW pointer.
X
X Portability:
X PDCurses WINDOW* resize_win( WINDOW* w, int lines, int cols );
X
X**man-end**********************************************************************/
X
XWINDOW* resize_win(WINDOW *w, int lines, int cols)
X{
Xextern void* (*mallc)(); /* ptr to some malloc(size) */
Xextern void* (*callc)(); /* ptr to some ecalloc(num,size)*/
Xextern void (*fre)(); /* ptr to some free(ptr) */
X
X WINDOW* new;
X int ncols = max(cols, w->_pmaxx);
X int nlines = max(lines, w->_pmaxy);
X int i;
X int j;
X
X if (w == (WINDOW *)NULL)
X return( (WINDOW *)NULL );
X
X if ((lines > w->_pmaxy) || (cols > w->_pmaxx))
X {
X if ((new = PDC_makenew(nlines, ncols, w->_begy, w->_begx)) == (WINDOW *)NULL)
X return( (WINDOW *)NULL );
X
X new->_curx = w->_curx;
X new->_cury = w->_cury;
X new->_flags = w->_flags;
X new->_attrs = w->_attrs;
X new->_tabsize = w->_tabsize;
X new->_clear = w->_clear;
X new->_leave = w->_leave;
X new->_scroll = w->_scroll;
X new->_nodelay = w->_nodelay;
X new->_use_keypad = w->_use_keypad;
X new->_tmarg = w->_tmarg;
X new->_bmarg = w->_bmarg;
X new->_title = w->_title;
X new->_title_ofs = w->_title_ofs;
X new->_title_attr = w->_title_attr;
X new->_parent = w->_parent;
X memcpy(new->_borderchars, w->_borderchars, 8*sizeof(chtype));
X
X for (i = 0; i < nlines; i++)
X {
X /*
X * make and clear the lines
X */
X if ((new->_y[i] = (chtype*)(*callc)(ncols, sizeof(chtype))) == NULL)
X {
X for (j = 0; j < i; j++)
X {
X /*
X * if error, free all the data
X */
X (*fre)(new->_y[j]);
X }
X (*fre)(new->_firstch);
X (*fre)(new->_lastch);
X (*fre)(new->_y);
X (*fre)(new);
X return( (WINDOW *)NULL );
X }
X }
X if ((w != curscr) && (w != tmpwin))
X {
X overwrite(w, new);
X wmove(new, w->_maxy - 1, 0);
X wclrtobot(new);
X/* JGB box uses defaults if arguments are zero, but we don't want to do
X this if the window currently has no box */
X if (w->_borderchars[0] || w->_borderchars[2])
X box(new, w->_borderchars[0], w->_borderchars[2]);
X }
X delwin(w);
X return( new );
X }
X else
X {
X w->_bmarg = lines - 1;
X w->_maxy = lines;
X w->_maxx = cols;
X/* JGB box uses defaults if arguments are zero, but we don't want to do
X this if the window currently has no box */
X if (w->_borderchars[0] || w->_borderchars[2])
X box(w, w->_borderchars[0], w->_borderchars[2]);
X return( w );
X }
X}
END_OF_FILE
if test 3723 -ne `wc -c <'nonport/resizew.c'`; then
echo shar: \"'nonport/resizew.c'\" unpacked with wrong size!
fi
# end of 'nonport/resizew.c'
fi
if test -f 'nonport/winprint.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/winprint.c'\"
else
echo shar: Extracting \"'nonport/winprint.c'\" \(3060 characters\)
sed "s/^X//" >'nonport/winprint.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#define CURSES_LIBRARY 1
X#endif
X#include <curses.h>
X#undef winPDC_print
X
X#ifndef NDEBUG
Xchar *rcsid_winprint = "$Header: c:/curses/nonport/RCS/winprint.c%v 2.0 1992/11/15 03:18:31 MH Rel $";
X#endif
X
X
X
X
X#define PRINT 0
X#define INIT 1
X#define READ 2
X
X/*man-start*********************************************************************
X
X win_print() - print contents of window to LPT1
X
X PDCurses Description:
X Prints the contents of the passed window or pad to LPT1:. All
X attributes are ignored. Newlines will be appended to the end
X of all win->_y[]s. The caller must supply the compiler-
X dependent port number.
X
X PDCurses Return Value:
X Return Status: bit 0 0x01 Device Time Out
X bit 1 0x02 Bad WINDOW* passed
X bit 2 0x04 Unable to malloc memory
X bit 3 0x08 I/O Error
X bit 4 0x10 Selected
X bit 5 0x20 Out of paper
X bit 6 0x40 Acknowledge
X bit 7 0x80 Not Busy
X
X A return value of 0 indicates success.
X
X PDCurses Errors:
X It is an error to pass a NULL WINDOW pointer.
X
X Portability:
X PDCurses int win_print( WINDOW* win, int port );
X
X**man-end**********************************************************************/
X
Xint win_print(WINDOW *win, int port)
X{
X#if defined( DOS )
X char *text;
X int i;
X int j;
X int status;
X int retry = 0;
Xextern void* (*mallc)(); /* ptr to some malloc(size) */
Xextern void* (*callc)(); /* ptr to some ecalloc(num,size)*/
Xextern void (*fre)(); /* ptr to some free(ptr) */
X
X if (win == (WINDOW *)NULL)
X return( 0x02 );
X
X status = PDC_print(READ, 0, port);
X
X if (((status & 0x20) != 0) || ((status & 0x08) != 0))
X return( status );
X /*
X * Print the window title First
X */
X text = win->_title;
X while (text != (char *)NULL)
X {
X status = PDC_print(PRINT, (int) *text, port);
X while ((status & 0x80) == 0x00)
X {
X if ((status & 0x01) == 0x01)
X {
X retry++;
X if (retry > 10)
X return( status );
X }
X if (((status & 0x20) == 0x20) ||
X ((status & 0x10) == 0x00) ||
X ((status & 0x08) == 0x08))
X {
X return( status );
X }
X status = PDC_print(READ, 0, port);
X }
X }
X PDC_print(PRINT, '\r', port);
X PDC_print(PRINT, '\n', port);
X PDC_print(PRINT, '\n', port);
X text = (*mallc)(win->_maxx);
X if (text != (char *)NULL)
X {
X for (i = 0; i < win->_maxy; i++)
X {
X for (j = 0; j < win->_maxx; j++)
X {
X status = PDC_print(PRINT, (int) win->_y[i][j], port);
X while ((status & 0x80) == 0x00)
X {
X if ((status & 0x01) == 0x01)
X {
X retry++;
X if (retry > 10)
X {
X (*fre)(text);
X return( status );
X }
X }
X if (((status & 0x20) == 0x20) ||
X ((status & 0x10) == 0x00) ||
X ((status & 0x08) == 0x08))
X {
X (*fre)(text);
X return( status );
X }
X
X status = PDC_print(READ, 0, port);
X }
X retry = 0;
X
X }
X PDC_print(PRINT, '\r', port);
X PDC_print(PRINT, '\n', port);
X }
X PDC_print(PRINT, '\f', port);
X (*fre)(text);
X return( 0x00 );
X }
X return( 0x04 );
X#endif
X#if defined( HC ) && defined( FLEXOS )
X return( 0x03 );
X#endif
X#ifdef OS2
X return( 0x03 );
X#endif
X}
END_OF_FILE
if test 3060 -ne `wc -c <'nonport/winprint.c'`; then
echo shar: \"'nonport/winprint.c'\" unpacked with wrong size!
fi
# end of 'nonport/winprint.c'
fi
if test -f 'portable/initpair.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/initpair.c'\"
else
echo shar: Extracting \"'portable/initpair.c'\" \(3582 characters\)
sed "s/^X//" >'portable/initpair.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef init_pair
X
X#ifndef NDEBUG
Xchar *rcsid_initpair = "$Header: c:/curses/portable/RCS/initpair.c%v 2.0 1992/11/15 03:28:56 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X initpair() - Change the definition of a color-pair.
X
X PDCurses Description:
X
X This routine is used to change the definition of a color-pair.
X The routine takes three arguments: the number of the color-pair
X to be redefined, and the new values of the foreground and
X background colors.
X
X The value of colorpair must be between 1 and COLOR_PAIRS-1.
X The values of foreground and background must be between 0 and
X COLORS-1.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with values outside of the
X ranges specified above.
X
X Portability:
X PDCurses int init_pair( int colorpair, short foreground, short background);
X SYS V Curses int init_pair( int colorpair, short foreground, short background);
X
X**man-end**********************************************************************/
X
X
Xunsigned char atrtab[MAX_ATRTAB] = /* COLOR_PAIR to attribute encoding table. */
X {0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,0x07,0x0F,0x70,0x78,0x87,0x8F,0xF0,0xF8,
X 0x70,0x00,0x17,0x00,0x00,0x00,0x00,0x00
X };
X
Xint init_pair(int colorpair,short foreground,short background)
X{
X extern int COLOR_PAIRS;
X unsigned char norm,reverse;
X
X if (colorpair >= COLOR_PAIRS || colorpair < 1)
X return(ERR);
X
X norm = (unsigned char)(foreground & 0x0007) + ((background & 0x0007)<<4);
X reverse = (unsigned char)(background & 0x0007) + ((foreground & 0x0007)<<4);
X
X atrtab[(colorpair*8)+0] = norm; /* normal */
X atrtab[(colorpair*8)+1] = norm + 8; /* bold */
X atrtab[(colorpair*8)+2] = reverse; /* reverse */
X atrtab[(colorpair*8)+3] = reverse + 8; /* bold-reverse */
X atrtab[(colorpair*8)+4] = norm + 128; /* blink */
X atrtab[(colorpair*8)+5] = norm + 8 + 128; /* bold-blink */
X atrtab[(colorpair*8)+6] = reverse + 128; /* reverse-blink */
X atrtab[(colorpair*8)+7] = reverse + 8 + 128;/* reverse-bold-blink */
X return(OK);
X}
END_OF_FILE
if test 3582 -ne `wc -c <'portable/initpair.c'`; then
echo shar: \"'portable/initpair.c'\" unpacked with wrong size!
fi
# end of 'portable/initpair.c'
fi
if test -f 'portable/longname.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/longname.c'\"
else
echo shar: Extracting \"'portable/longname.c'\" \(3294 characters\)
sed "s/^X//" >'portable/longname.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef longname
X
X#ifndef NDEBUG
Xchar *rcsid_longname = "$Header: c:/curses/portable/RCS/longname.c%v 2.0 1992/11/15 03:28:59 MH Rel $";
X#endif
X
X
X
X
X#ifdef FLEXOS
Xextern char* _flexos_gname();
X#endif
X
Xstatic char _display[ 128 ];
X
X
X
X
X/*man-start*********************************************************************
X
X longname() - return full terminal type name
X
X X/Open Description:
X This function returns a pointer to a static area containing a
X verbose description of the current terminal. The maximum length
X of the string is 128 characters. It is defined only after the
X call to initscr() or newterm(). The area is overwritten by each
X call to newterm() and is not restored by set_term(). The value
X should therefore be saved between calls to newterm(), if
X longname() is going to be used with multiple terminals.
X
X PDCurses Description:
X In addition to the above definition, the form of this string is
X the adapter name (or video card name) and the text resolution.
X This may also be followed by the notation that the video card
X may be a clone, which indicates that the card identification
X maps to more than one unique card.
X
X e.g. The MDS Genius and the Quadram QuadHPG identify themselves
X in the same manner, but are vastly different in maximum resolution.
X
X X/Open Return Value:
X The longname() function returns a pointer to a verbose description
X of the current terminal on success and the null pointer on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses char* longname( void );
X X/Open Dec '88 char* longname( void );
X BSD Curses char* longname( void );
X SYS V Curses char* longname( void );
X
X**man-end**********************************************************************/
X
Xchar* longname(void)
X{
X#ifdef OS2
X switch (_cursvar.adapter.adapter)
X {
X case DISPLAY_CGA: sprintf(_display, "CGA-%dx%d", LINES, COLS); break;
X case DISPLAY_MONOCHROME: sprintf(_display, "MDA-%dx%d", LINES, COLS); break;
X case DISPLAY_EGA: sprintf(_display, "EGA-%dx%d", LINES, COLS); break;
X case DISPLAY_VGA: sprintf(_display, "VGA-%dx%d", LINES, COLS); break;
X case DISPLAY_8514A: sprintf(_display, "8514-%dx%d", LINES, COLS); break;
X default: sprintf(_display, "Unknown-%dx%d", LINES, COLS); break;
X }
X#else
X switch (_cursvar.adapter)
X {
X case _CGA: sprintf(_display, "CGA-%dx%d", LINES, COLS); break;
X case _MDA: sprintf(_display, "MDA-%dx%d", LINES, COLS); break;
X case _EGACOLOR: sprintf(_display, "EGAColor-%dx%d", LINES, COLS); break;
X case _EGAMONO: sprintf(_display, "EGAMono-%dx%d", LINES, COLS); break;
X case _VGACOLOR: sprintf(_display, "VGAColor-%dx%d", LINES, COLS); break;
X case _VGAMONO: sprintf(_display, "VGAMono-%dx%d", LINES, COLS); break;
X case _MCGACOLOR:sprintf(_display, "MCGAColor-%dx%d", LINES, COLS);break;
X case _MCGAMONO: sprintf(_display, "MCGAMono-%dx%d", LINES, COLS); break;
X case _MDS_GENIUS:sprintf(_display, "Genius-%dx%d", LINES, COLS); break;
X#ifdef FLEXOS
X case _FLEXOS: sprintf(_display, "%s", _cursesgname()); break;
X#endif
X default: sprintf(_display, "Unknown-%dx%d", LINES, COLS); break;
X }
X#endif
X
X if (_cursvar.bogus_adapter)
X strcat(_display, " (Clone)");
X return (_display);
X}
END_OF_FILE
if test 3294 -ne `wc -c <'portable/longname.c'`; then
echo shar: \"'portable/longname.c'\" unpacked with wrong size!
fi
# end of 'portable/longname.c'
fi
if test -f 'portable/pnoutref.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/pnoutref.c'\"
else
echo shar: Extracting \"'portable/pnoutref.c'\" \(3448 characters\)
sed "s/^X//" >'portable/pnoutref.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef pnoutrefresh
X
X#ifndef NDEBUG
Xchar *rcsid_pnoutref = "$Header: c:/curses/portable/RCS/pnoutref.c%v 2.0 1992/11/15 03:29:14 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X pnoutrefresh() - refresh pad without updating physical screen
X
X X/Open Description:
X The prefresh routine copies the specified pad to the physical
X terminal screen. It takes account of what is already
X displayed on the screen to optimize cursor movement.
X
X The pnoutrefresh routine copies the named pad to the virtual
X screen. It then compares the virtual screen with the physical
X screen and performs the actual update.
X
X These routines are analogous to the routines wrefresh and
X wnoutrefresh except that pads, instead of windows, are
X involved. Additional parameters are also needed to indicate
X what part of the pad and screen are involved. The upper left
X corner of the part of the pad to be displayed is specified by
X py and px. The coordinates sy1, sx1, sy2, and sx2 specify the
X edges of the screen rectangle that will contain the selected
X part of the pad.
X
X The lower right corner of the pad rectangle to be displayed is
X calculated from the screen co-ordinates. This ensures that
X the screen rectangle and the pad rectangle are the same size.
X
X Both rectangles must be entirely contained within their
X respective structures.
X
X PDCurses Description:
X Contrary to the statements above, the pnoutrefresh() routine
X will not perform an update to the physical screen. This task
X is performed by doupdate().
X
X X/Open Return Value:
X The prefresh() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to pass a null WINDOW* pointer.
X
X Portability:
X PDCurses int pnoutrefresh( WINDOW* w, int py, int px,
X int sy1, int sx1,
X int sy2, int sx2 );
X X/Open Dec '88 int pnoutrefresh( WINDOW* win, int py, int px,
X int sy1, int sx1,
X int sy2, int sx2 );
X BSD Curses int pnoutrefresh( WINDOW* w, int pminrow, int pmincol,
X int sminrow, int smincol,
X int smaxrow, int smaxcol );
X SYS V Curses int pnoutrefresh( WINDOW* win, int py, int px,
X int sy1, int sx1,
X int sy2, int sx2 );
X
X**man-end**********************************************************************/
X
Xint pnoutrefresh(WINDOW* w,int py,int px,int sy1,int sx1,int sy2,int sx2)
X{
Xregister chtype* dstp;
Xregister chtype* srcp;
X WINDOW* s = tmpwin;
X int sline = sy1;
X int pline = py;
X
X
X if (w == (WINDOW *)NULL)
X return( ERR );
X
X while (sline <= sy2)
X {
X if (pline < w->_maxy)
X {
X#if defined(DOS) || defined(OS2)
X# if SMALL || MEDIUM
X srcp = &(w->_y[pline][px]);
X dstp = &(s->_y[sline][sx1]);
X movedata(FP_SEG(srcp), FP_OFF(srcp),
X FP_SEG(dstp), FP_OFF(dstp),
X (sx2 - sx1 + 1) * sizeof(chtype));
X# else
X memcpy(&(s->_y[sline][sx1]),
X &(w->_y[pline][px]),
X (sx2 - sx1 + 1) * sizeof(chtype));
X# endif
X#endif
X
X if ((s->_firstch[sline] == _NO_CHANGE) ||
X (s->_firstch[sline] > sx1))
X {
X s->_firstch[sline] = sx1;
X }
X
X if (sx2 > s->_lastch[sline])
X s->_lastch[sline] = sx2;
X
X w->_firstch[pline] = _NO_CHANGE; /* updated now */
X w->_lastch[pline] = _NO_CHANGE; /* updated now */
X }
X sline++;
X pline++;
X }
X
X if (w->_clear)
X {
X w->_clear = FALSE;
X s->_clear = TRUE;
X }
X return( OK );
X}
END_OF_FILE
if test 3448 -ne `wc -c <'portable/pnoutref.c'`; then
echo shar: \"'portable/pnoutref.c'\" unpacked with wrong size!
fi
# end of 'portable/pnoutref.c'
fi
if test -f 'portable/waddch.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/waddch.c'\"
else
echo shar: Extracting \"'portable/waddch.c'\" \(3156 characters\)
sed "s/^X//" >'portable/waddch.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef waddch
X
X#ifndef NDEBUG
Xchar *rcsid_waddch = "$Header: c:/curses/portable/RCS/waddch.c%v 2.0 1992/11/15 03:29:20 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X waddch() - add character to window
X
X X/Open Description:
X The routine addch inserts the character ch into the default
X window at the current cursor position and the window cursor is
X advanced. The character is of the type chtype as containing
X both data and attributes.
X
X The routine waddch inserts the character ch into the specified
X window at the current cursor position. The cursor position is
X advanced.
X
X The routine mvaddch moves the cursor to the specified (y, x)
X position and inserts the character ch into the default window.
X The cursor position is advanced after the character has been
X inserted.
X
X The routine mvwaddch moves the cursor to the specified (y, x)
X position and inserts the character ch into the specified
X window. The cursor position is advanced after the character
X has been inserted.
X
X All these routines are similar to putchar. The following
X information applies to all the routines.
X
X If the cursor moves on to the right margin, an automatic
X newline is performed. If scrollok is enabled, and a character
X is added to the bottom right corner of the screen, the
X scrolling region will be scrolled up one line. If scrolling
X is not allowed, ERR will be returned.
X
X If ch is a tab, newline, or backspace, the cursor will be
X moved appropriately within the window. If ch is a newline,
X the clrtoeol routine is called before the cursor is moved to
X the beginning of the next line. If newline mapping is off,
X the cursor will be moved to the next line, but the x
X coordinate will be unchanged. If ch is a tab the cursor is
X moved to the next tab position within the window. If ch is
X another control character, it will be drawn in the ^X
X notation. Calling the inch routine after adding a control
X character returns the representation of the control character,
X not the control character.
X
X Video attributes can be combined with a character by ORing
X them into the parameter. This will result in these attributes
X being set. The intent here is that text, including
X attributes, can be copied from one place to another using inch
X and addch.
X
X NOTE: addch(), mvaddch(), and mvwaddch() are macros.
X
X PDCurses Description:
X Depending upon the state of the raw character output, 7- or
X 8-bit characters will be output. NOTE: Needs work before release!
X
X X/Open Return Value:
X The waddch() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int waddch( WINDOW* win, chtype c );
X X/Open Dec '88 int waddch( WINDOW* win, chtype c );
X BSD Curses int waddch( WINDOW* win, chtype c );
X SYS V Curses int waddch( WINDOW* win, chtype c );
X
X**man-end**********************************************************************/
X
Xint waddch(WINDOW *win, chtype c)
X{
X return( PDC_chadd( win, (chtype)c, !(_cursvar.raw_out), TRUE ) );
X}
END_OF_FILE
if test 3156 -ne `wc -c <'portable/waddch.c'`; then
echo shar: \"'portable/waddch.c'\" unpacked with wrong size!
fi
# end of 'portable/waddch.c'
fi
if test -f 'portable/wgetstr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wgetstr.c'\"
else
echo shar: Extracting \"'portable/wgetstr.c'\" \(3103 characters\)
sed "s/^X//" >'portable/wgetstr.c' <<'END_OF_FILE'
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wgetstr
X
X#ifndef NDEBUG
Xchar *rcsid_wgetstr = "$Header: c:/curses/portable/RCS/wgetstr.c%v 2.0 1992/11/15 03:29:26 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wgetstr() - read string
X
X X/Open Description:
X A series of characters are read until a newline or carriage
X return is received. The resulting value is placed in the area
X pointed to by the character pointer str. The user's erase and
X kill characters are interpreted.
X
X NOTE: getstr(), mvgetstr(), and mvwgetstr() are macros.
X
X PDCurses Description:
X The largest string returned will be 255 characters long.
X This can be altered in the library be changing the MAXLINE #define.
X
X WARNING: This routine does not interpret the user's ERASE and
X KILL characters as advertised.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wgetstr( WINDOW* win, char* str );
X X/Open Dec '88 int wgetstr( WINDOW* win, char* str );
X BSD Curses int wgetstr( WINDOW* win, char* str );
X SYS V Curses int wgetstr( WINDOW* win, char* str );
X
X**man-end**********************************************************************/
X
X
X#define MAXLINE 255
X
Xint wgetstr(WINDOW *win, char *str)
X{
X char tmp[MAXLINE+1];
X char txt[MAXLINE+1];
X char new_char[2] = {0};
X int ch;
X int chars = strlen(str);
X int sy = win->_cury;
X int sx = win->_curx;
X WINDOW* w;
X bool oldecho;
X bool oldcbreak;
X bool oldnodelay;
X
X if (win == (WINDOW *)NULL)
X return (ERR);
X
X w = win;
X c_strbeg = txt; /* save for backspacing */
X oldcbreak = _cursvar.cbreak; /* remember states */
X oldecho = _cursvar.echo;
X oldnodelay = w->_nodelay;
X _cursvar.echo = FALSE; /* we do echo ourselves */
X w->_nodelay = FALSE; /* don't return -1 */
X
X strcpy(txt, str);
X wprintw(w, str);
X wrefresh(w);
X ch = wgetch(w);
X while (ch != '\n')
X {
X
X new_char[0] = (ch & CHR_MSK);
X strcat(txt, new_char);
X chars++;
X
X switch (ch)
X {
X case 0x1b: /* Escape */ /* Terminate String */
X case '\r': /* CTRL-M */
X case KEY_ENTER:
X chars--;
X ch = '\n';
X continue;
X
X case 0x04: /* CTRL-D */ /* Delete character */
X case 0x08: /* CTRL-H */
X if (chars > 0)
X PDC_backchar(w, txt, &chars);
X break;
X
X case 0x17: /* CTRL-W */ /* Delete word */
X chars--;
X while ((txt[chars] == ' ') && (chars > 0))
X PDC_backchar(w, txt, &chars);
X
X while ((txt[chars] != ' ') && (chars > 0))
X PDC_backchar(w, txt, &chars);
X break;
X
X case 0x15: /* CTRL-U */ /* Delete line */
X case 0x18: /* CTRL-X */
X chars++;
X while (chars > 0)
X PDC_backchar(w, txt, &chars);
X break;
X
X default:
X waddch(w, ch);
X wrefresh(w);
X break;
X }
X ch = wgetch(w);
X }
X
X memset(str, '\0', MAXLINE+1);
X#ifdef FLEXOS
X _split_plane(w, txt, tmp, sy, sx, w->_cury, w->_curx - 1);
X#endif
X if (strlen(txt) > 0);
X strcpy(str, txt);
X
X _cursvar.echo = oldecho;
X _cursvar.cbreak = oldcbreak;
X win->_nodelay = oldnodelay;
X return (OK);
X}
END_OF_FILE
if test 3103 -ne `wc -c <'portable/wgetstr.c'`; then
echo shar: \"'portable/wgetstr.c'\" unpacked with wrong size!
fi
# end of 'portable/wgetstr.c'
fi
if test -f 'private/_chadd.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_chadd.c'\"
else
echo shar: Extracting \"'private/_chadd.c'\" \(4147 characters\)
sed "s/^X//" >'private/_chadd.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__chadd = "$Header: c:/curses/private/RCS/_chadd.c%v 2.0 1992/11/15 03:24:16 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_chadd() - Low level; Put a character to a window
X
X PDCurses Description:
X This is a private PDCurses function.
X
X This routine will insert the character 'c' at the current cursor
X position in the passed window.
X
X If 'xlat' is TRUE, PDC_chadd() will handle things in a cooked
X manner (tabs, newlines, carriage returns, etc). If 'xlat' is
X FALSE, the characters are simply output directly.
X
X If 'advance' is TRUE, PDC_chadd() will move the current cusor position
X appropriately. The *addch functions call PDC_chadd() with noadvance TRUE,
X while the *insch functions call PDC_chadd() with noadvance FALSE.
X
X The normal curses routines (non-raw-output-mode) call PDC_chadd()
X with 'xlat' TRUE.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int PDC_chadd( WINDOW* win, chtype ch, bool xlat, bool noadvance );
X
X**man-end**********************************************************************/
X
Xint PDC_chadd(register WINDOW *win, chtype ch,bool xlat, bool advance)
X{
X int retval = ERR;
X int x;
X int y;
X int newx;
X chtype attr;
X int ts;
X
X if (win == (WINDOW *)NULL)
X return( retval );
X
X x = win->_curx;
X y = win->_cury;
X ts = win->_tabsize;
X
X/* if the incoming character doesn't have its own attribute
X then use the current attributes for the window.
X if the incoming character has attributes but not a colour
X component, or the attributes to the current attributes
X for the window.
X if the incoming character has a colour component use the
X attributes solely from the incoming character */
X
X if ((ch & A_ATTRIBUTES) == 0)
X attr = win->_attrs;
X else
X if ((ch & A_COLOR) == 0)
X attr = (ch & A_ATTRIBUTES) | win->_attrs;
X else
X attr = (ch & A_ATTRIBUTES);
X
X ch = (ch & A_CHARTEXT);
X
X if ((y > win->_maxy) ||
X (x > win->_maxx) ||
X (y < 0) ||
X (x < 0))
X {
X return( retval );
X }
X
X if (xlat)
X {
X switch (ch) {
X case '\t':
X for (newx = ((x / ts) + 1) * ts; x < newx; x++)
X {
X if (waddch(win, ' ') == ERR)
X {
X return( retval );
X }
X /*
X * if tab to next line
X */
X if (win->_curx == 0)
X {
X /*
X * exit the loop
X */
X return( OK );
X }
X }
X return( OK );
X
X case '\n':
X if (_cursvar.autocr && !(_cursvar.raw_out))
X {
X /*
X * if lf -> crlf
X */
X x = 0;
X }
X wclrtoeol( win );
X if ((y = PDC_newline(win, y)) < 0)
X return( retval );
X if (advance)
X {
X win->_cury = y;
X win->_curx = x;
X }
X return( OK );
X
X case '\r':
X if (advance)
X win->_curx = x = 0;
X return( OK );
X
X case '\b':
X if (--x < 0)
X {
X /*
X * no back over left margin
X */
X x = 0;
X }
X if (advance)
X win->_curx = x;
X return( OK );
X
X case 0x7f:
X if (waddch(win, '^') == ERR)
X {
X return( retval );
X }
X retval = waddch(win, '?');
X return( retval );
X
X default:
X break;
X } /* switch */
X
X if (ch < ' ')
X {
X /*
X * handle control chars
X */
X if (waddch(win, '^') == ERR)
X return( retval );
X
X retval = (waddch(win, ch + '@'));
X return( retval );
X }
X }
X
X /*
X * Add the attribute back into the character.
X */
X ch |= attr;
X if (win->_y[y][x] != ch)
X {
X /*
X * only if data change
X */
X if (win->_firstch[y] == _NO_CHANGE)
X {
X win->_firstch[y] = win->_lastch[y] = x;
X }
X else
X {
X if (x < win->_firstch[y])
X {
X win->_firstch[y] = x;
X }
X else
X {
X if (x > win->_lastch[y])
X {
X win->_lastch[y] = x;
X }
X }
X }
X }
X win->_y[y][x++] = ch;
X if (x >= win->_maxx)
X {
X /*
X * wrap around test
X */
X x = 0;
X if ((y = PDC_newline(win, y)) < 0)
X return( retval );
X }
X if (advance)
X {
X win->_curx = x;
X win->_cury = y;
X }
X return( OK );
X}
END_OF_FILE
if test 4147 -ne `wc -c <'private/_chadd.c'`; then
echo shar: \"'private/_chadd.c'\" unpacked with wrong size!
fi
# end of 'private/_chadd.c'
fi
if test -f 'private/_clrupda.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_clrupda.c'\"
else
echo shar: Extracting \"'private/_clrupda.c'\" \(3916 characters\)
sed "s/^X//" >'private/_clrupda.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__clrupda = "$Header: c:/curses/private/RCS/_clrupda.c%v 2.0 1992/11/15 03:24:28 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_clr_update() - Updates the screen with a full redraw.
X
X PDCurses Description:
X Updates the screen by clearing it and then redraw it in its
X entirety. If _cursvar.refrbrk is TRUE, and there is pending
X input characters, the update will be prematurely terminated.
X
X PDCurses Return Value:
X This routine returns ERR if it is unable to accomplish it's task.
X This return value is ONLY under FLEXOS.
X
X The return value OK is returned if there were no errors.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_clr_update( WINDOW* s );
X
X**man-end**********************************************************************/
X
Xint PDC_clr_update(WINDOW *s)
X{
Xregister int i;
Xregister int j;
X WINDOW* w;
X chtype* ch;
X bool rc;
X#ifdef FLEXOS
X char line[80];
X char attr[80];
X FFRAME sframe;
X RECT drect,
X srect;
X#endif
X extern unsigned char atrtab[MAX_ATRTAB];
X chtype temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */
X chtype chr;
X
X w = curscr;
X if (w == (WINDOW *)NULL)
X return( ERR );
X if (_cursvar.full_redraw)
X PDC_clr_scrn(s); /* clear physical screen */
X
X s->_clear = FALSE;
X for (i = 0; i < LINES; i++) /* update physical screen */
X {
X if (s != w) /* copy s to curscr */
X#ifdef DOS
X# if SMALL || MEDIUM
X movedata(FP_SEG(s->_y[i]),
X FP_OFF(s->_y[i]),
X FP_SEG(w->_y[i]),
X FP_OFF(w->_y[i]),
X COLS * sizeof(chtype));
X# else
X memcpy(w->_y[i], s->_y[i], COLS * sizeof(chtype));
X# endif
X#endif
X#ifdef OS2
X memcpy(w->_y[i], s->_y[i], COLS * sizeof(chtype));
X#endif
X
X ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */
X#ifdef DOS
X# if SMALL || MEDIUM
X movedata(FP_SEG(s->_y[i]), FP_OFF(s->_y[i]),
X FP_SEG(ch), FP_OFF(ch),COLS * sizeof(chtype));
X# else
X memcpy(ch,s->_y[i],COLS*sizeof(chtype)); /* copy current line to temp_line. MH-920715 */
X# endif
X#else
X memcpy(ch,s->_y[i],COLS*sizeof(chtype)); /* copy current line to temp_line. MH-920715 */
X#endif
X for (j=0;j<COLS;j++) /* for each chtype in the line... */
X {
X chr = temp_line[j] & A_CHARTEXT;
X temp_line[j] = chtype_attr(temp_line[j]) | chr;
X }
X
X if (_cursvar.direct_video)
X {
X#ifdef FLEXOS
X PDC_split_plane(w, &line[0], &attr[0], i, 0, i, COLS);
X/* need to translate attr[] array to real attributes before displaying it. MH-920715 */
X drect.r_row = i;
X drect.r_col = 0;
X drect.r_nrow = 1;
X drect.r_ncol = COLS;
X
X sframe.fr_pl[0] = (UBYTE *) line;
X sframe.fr_pl[1] = (UBYTE *) attr;
X sframe.fr_nrow = 1;
X sframe.fr_ncol = COLS;
X sframe.fr_use = 0x03;
X
X srect.r_col = 0;
X srect.r_row = 0;
X srect.r_nrow = 1;
X srect.r_ncol = COLS;
X
X s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect,
X (far unsigned short *) &sframe,
X (far unsigned short *) &srect);
X#endif
X#ifdef DOS
X# if SMALL || MEDIUM || MSC
X movedata(FP_SEG(ch), FP_OFF(ch),
X _cursvar.video_seg,
X _cursvar.video_ofs + (i*COLS*sizeof(chtype)),
X (COLS * sizeof(chtype)));
X# else
X memcpy(MK_FP(_cursvar.video_seg,
X _cursvar.video_ofs + (i * COLS * sizeof(chtype))),
X ch, (COLS * sizeof(chtype)));
X# endif
X#endif
X#ifdef OS2
X VioWrtCellStr ((PCH)ch, (USHORT)(COLS * sizeof(chtype)), (USHORT)i, 0, 0);
X#endif
X }
X else
X {
X for (j = 0; j < COLS; j++)
X {
X PDC_gotoxy(i, j);
X PDC_putc( (*ch & A_CHARTEXT), (*ch & A_ATTRIBUTES) >> 8 );
X ch++;
X }
X }
X#if defined(MSC) && defined (DOS)
X rc = typeahead(stdin);
X if (_cursvar.refrbrk && rc)
X#else
X if (_cursvar.refrbrk && typeahead(stdin))
X#endif
X return( OK );
X }
X return( OK );
X}
END_OF_FILE
if test 3916 -ne `wc -c <'private/_clrupda.c'`; then
echo shar: \"'private/_clrupda.c'\" unpacked with wrong size!
fi
# end of 'private/_clrupda.c'
fi
if test -f 'private/_inswin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_inswin.c'\"
else
echo shar: Extracting \"'private/_inswin.c'\" \(1923 characters\)
sed "s/^X//" >'private/_inswin.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifdef REGISTERWINDOWS
X#ifndef NDEBUG
Xchar *rcsid__inswin = "$Header: c:/curses/private/RCS/_inswin.c%v 2.0 1992/11/15 03:24:27 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X _inswin() - Register Window with PDCurses for auto refresh
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X This routine inserts the passed window pointer after the specified
X window. If the specified window is a (void*)0, then the passed
X window pointer is inserted first in the list.
X
X If the 'before' window is not on the visible list, then 'win'
X will be insed to the end of the list.
X
X This is the beginnings of full-tiled window support. It is _very_
X raw at this point.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses bool _inswin( WINDOW* win, WINDOW* before );
X
X**man-end**********************************************************************/
X
Xbool _inswin(WINDOW *win, WINDOW *before)
X{
Xextern void* (*mallc)( size_t );
Xextern void* (*callc)( size_t, size_t );
Xextern void (*fre)( void* );
X
X WINDS *root = _cursvar.visible;
X WINDS *wlst = _findwin(before);
X WINDS *new = (*mallc)(sizeof(WINDS));
X
X if (new == (WINDS *)NULL)
X return( FALSE );
X
X _rmwin(win);
X memset(new, 0, sizeof(WINDS));
X new->w = win;
X if (wlst == (WINDS *)NULL)
X {
X if (root == (WINDS *)NULL)
X {
X _cursvar.visible = new;
X }
X else
X {
X new->next = root;
X root->prev = new;
X _cursvar.visible = new;
X }
X }
X else
X {
X if (wlst == root)
X {
X new->next = root;
X root->prev = new;
X _cursvar.visible = new;
X }
X else
X {
X new->next = wlst;
X new->prev = wlst->prev;
X wlst->prev->next = new;
X wlst->prev = new;
X }
X }
X return( TRUE );
X}
X#endif
END_OF_FILE
if test 1923 -ne `wc -c <'private/_inswin.c'`; then
echo shar: \"'private/_inswin.c'\" unpacked with wrong size!
fi
# end of 'private/_inswin.c'
fi
if test -f 'private/_makenew.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_makenew.c'\"
else
echo shar: Extracting \"'private/_makenew.c'\" \(3179 characters\)
sed "s/^X//" >'private/_makenew.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__makenew = "$Header: c:/curses/private/RCS/_makenew.c%v 2.0 1992/11/15 03:24:28 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_makenew() - Create a WINDOW* (sans line allocation)
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Allocates all data for a new WINDOW* except the actual lines
X themselves.
X
X PDCurses Return Value:
X This function returns a valid WINDOW* on success and NULL on error.
X
X PDCurses Errors:
X If PDC_makenew() is unable to allocate memory for the window
X structure, it will free all allocated memory and return
X a NULL pointer.
X
X Portability:
X PDCurses WINDOW* makenew( int num_lines, int num_columns,
X int begy, int begx );
X
X**man-end**********************************************************************/
X
XWINDOW* PDC_makenew(int num_lines, int num_columns, int begy, int begx)
X{
Xextern void* (*mallc)( size_t );
Xextern void* (*callc)( size_t, size_t );
Xextern void (*fre)( void* );
X
X short i;
X WINDOW *win;
X
X /*
X * Use the standard runtime malloc/calloc package or use
X * the user's emalloc/ecalloc package.
X *
X * Allocate the window structure itself
X */
X if ((win = (*mallc)(sizeof(WINDOW))) == (WINDOW *)NULL)
X {
X return( win );
X }
X
X /*
X * allocate the line pointer array
X */
X if ((win->_y = (*callc)(num_lines, sizeof(chtype *))) == NULL)
X {
X (*fre)(win);
X return( (WINDOW *)NULL );
X }
X
X /*
X * allocate the minchng and maxchng arrays
X */
X if ((win->_firstch = (*callc)(num_lines, sizeof(int))) == NULL)
X {
X (*fre)(win->_y);
X (*fre)(win);
X return( (WINDOW *)NULL );
X }
X if ((win->_lastch = (*callc)(num_lines, sizeof(int))) == NULL)
X {
X (*fre)(win->_firstch);
X (*fre)(win->_y);
X (*fre)(win);
X return( (WINDOW *)NULL );
X }
X
X /*
X * initialize window variables
X */
X win->_curx = 0;
X win->_cury = 0;
X win->_maxy = num_lines; /* real max screen size */
X win->_maxx = num_columns; /* real max screen size */
X win->_pmaxy = num_lines; /* real max window size */
X win->_pmaxx = num_columns; /* real max window size */
X win->_begy = begy;
X win->_begx = begx;
X win->_flags = 0;
X win->_attrs = 0; /* No attributes */
X win->_tabsize = 8;
X win->_clear = (bool) ((num_lines == LINES) && (num_columns == COLS));
X win->_leave = FALSE;
X win->_scroll = FALSE;
X win->_nodelay = FALSE;
X win->_use_keypad = FALSE;
X win->_use_idl = FALSE;
X win->_tmarg = 0;
X win->_bmarg = num_lines - 1;
X win->_title = NULL;
X win->_title_ofs = 1;
X win->_title_attr = win->_attrs;
X win->_blank = ' ';
X win->_parent = NULL;
X
X memset(win->_borderchars, '\0', 8*sizeof(chtype));
X
X /*
X * init to say window unchanged
X */
X for (i = 0; i < num_lines; i++)
X {
X win->_firstch[i] = 0;
X win->_lastch[i] = num_columns - 1;
X }
X
X /*
X * set flags for window properties
X */
X if ((begy + num_lines) == LINES)
X {
X win->_flags |= _ENDLINE;
X if ((begx == 0) &&
X (num_columns == COLS) &&
X (begy == 0))
X {
X win->_flags |= _FULLWIN;
X }
X }
X
X if (((begy + num_lines) == LINES) &&
X ((begx + num_columns) == COLS))
X {
X win->_flags |= _SCROLLWIN;
X }
X return( win );
X}
END_OF_FILE
if test 3179 -ne `wc -c <'private/_makenew.c'`; then
echo shar: \"'private/_makenew.c'\" unpacked with wrong size!
fi
# end of 'private/_makenew.c'
fi
if test -f 'tools/manext.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tools/manext.c'\"
else
echo shar: Extracting \"'tools/manext.c'\" \(3983 characters\)
sed "s/^X//" >'tools/manext.c' <<'END_OF_FILE'
X/***********************************************************************/
X/* MANEXT - Extract manual pages from C source code. */
X/***********************************************************************/
X/*
X * MANEXT - A program to extract manual pages from C source code.
X * Copyright (C) 1991,1992 Mark Hessling
X *
X * This program is free software; you can redistribute it and/or
X * modify it under the terms of the GNU General Public License as
X * published by the Free Software Foundation; either version 2 of
X * the License, or any later version.
X *
X * This program is distributed in the hope that it will be useful,
X * but WITHOUT ANY WARRANTY; without even the implied warranty of
X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
X * General Public License for more details.
X *
X * You should have received a copy of the GNU General Public License
X * along with this program; if not, write to:
X *
X * The Free Software Foundation, Inc.
X * 675 Mass Ave,
X * Cambridge, MA 02139 USA.
X *
X *
X * If you make modifications to this software that you feel increases
X * it usefulness for the rest of the community, please email the
X * changes, enhancements, bug fixes as well as any and all ideas to me.
X * This software is going to be maintained and enhanced as deemed
X * necessary by the community.
X *
X * Mark Hessling email: M.Hes...@itc.gu.edu.au
X * 36 David Road Phone: +61 7 849 7731
X * Holland Park Fax: +61 7 875 7877
X * QLD 4121
X * Australia
X */
X#include <stdio.h>
X
Xvoid display_info();
X
X#define MAX_LINE 255
X
X/***********************************************************************/
Xint main(argc,argv)
Xint argc;
Xchar *argv[];
X/***********************************************************************/
X{
X char s[MAX_LINE + 1]; /* input line */
X register int i = 0;
X FILE *fp;
X char c;
X char append=0;
X
X if (strcmp(argv[1],"-h") == 0)
X {
X display_info();
X exit(1);
X }
X for(i=1;i<argc;i++)
X {
X if ((fp = fopen(argv[i],"r")) == NULL)
X {
X fprintf(stderr,"\nCould not open %s\n",argv[i]);
X continue;
X }
X while(1)
X {
X if (fgets(s, (int)sizeof(s), fp) == NULL)
X {
X if (ferror(fp) != 0)
X {
X fprintf(stderr, "*** Error reading %s. Exiting.\n",argv[i]);
X exit(1);
X }
X break;
X }
X
X /* check for manual entry marker at beginning of line */
X if (strncmp(s, "/*man-start*", 12) != 0)
X continue;
X
X /* inner loop */
X for (;;)
X {
X /* read next line of manual entry */
X if (fgets(s, (int)sizeof(s), fp) == NULL)
X {
X if (ferror(fp) != 0)
X {
X fprintf(stderr, "*** Error reading %s. Exiting.\n",argv[i]);
X exit(1);
X }
X break;
X }
X /* check for end of entry marker */
X if (strncmp(s, "**man-end", 9) == 0)
X break;
X
X printf(" %s",s);
X }
X printf("\n\n\n --------------------------------------------------------------------------\n");
X
X /* check if end of file */
X if (feof(fp) != 0)
X break;
X }
X fclose(fp);
X }
X printf("\n\n\n\n\n");
X return(0);
X}
X/***********************************************************************/
Xvoid display_info()
X/***********************************************************************/
X{
X/*--------------------------- local data ------------------------------*/
X/*--------------------------- processing ------------------------------*/
X
X fprintf(stderr,"\nMANEXT 1.00 Copyright (C) 1991,1992 Mark Hessling\n");
X fprintf(stderr,"All rights reserved.\n");
X fprintf(stderr,"MANEXT is distributed under the terms of the GNU\n");
X fprintf(stderr,"General Public License and comes with NO WARRANTY.\n");
X fprintf(stderr,"See the file COPYING for details.\n");
X fprintf(stderr,"\nUsage: MANEXT sourcefile [...]\n\n");
X fflush(stderr);
X return;
X}
END_OF_FILE
if test 3983 -ne `wc -c <'tools/manext.c'`; then
echo shar: \"'tools/manext.c'\" unpacked with wrong size!
fi
# end of 'tools/manext.c'
fi
echo shar: End of archive 5 \(of 11\).
cp /dev/null ark5isdone
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: nonport/resize.c portable/doupdate.c portable/hascolor.c
# portable/mvprintw.c portable/mvwprint.c portable/mvwscanw.c
# portable/newpad.c portable/newwin.c portable/overlay.c
# portable/overwrit.c portable/prefresh.c portable/subwin.c
# private/_chins.c private/_gbiosky.c private/_getrows.c
# private/_scroll.c private/_scropen.c private/_setfont.c
# Wrapped by kent@sparky on Wed Nov 18 21:44:08 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 6 (of 11)."'
if test -f 'nonport/resize.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/resize.c'\"
else
echo shar: Extracting \"'nonport/resize.c'\" \(2953 characters\)
sed "s/^X//" >'nonport/resize.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef resize
X
X#ifndef NDEBUG
Xchar *rcsid_resize = "$Header: c:/curses/nonport/RCS/resize.c%v 2.0 1992/11/15 03:18:27 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X resize() - Resizes PDCurses; Changes video text size if necessary.
X
X PDCurses Description:
X Does necessary initializations for the PDCurses package when
X doing screen size changes. The user is responsible for
X deleting and/or resizing windows after this call is made.
X
X See the call _resize_win().
X
X WARNING: This routine deallocated the existing stdscr, curscr
X and modifies LINES, COLS and other internal PDCurses
X variables.
X
X PDCurses Return Value:
X The resize() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function before calling initscr().
X Also, an error will be generated if we fail to create a newly
X sized replacement window for _cursvar.tmpwin, curscr, or stdscr.
X This will typically happen when increasing the window size.
X
X NOTE: If this happens, the previously successfully allocated
X windows are left alone. i.e. The resize is NOT cancelled for
X those windows.
X
X PDCurses BUGS:
X
X At this time, there is no support for any 40-column screen modes.
X
X Portability:
X PDCurses int resize( int newlines );
X
X**man-end**********************************************************************/
X
Xint resize(int newlines)
X{
X WINDOW* tmp;
X
X if (stdscr == (WINDOW *)NULL)
X return(ERR);
X
X#ifdef FLEXOS
X /*
X * Under FlexOS, this is functionally equivalent to a recallable
X * initscr() because FlexOS does not yet support determination of
X * screen fonts and therefore font loading and therefore text mode
X * screen resolution changes...
X */
X return( ERR );
X#endif
X#if !defined(OS2)
X switch (_cursvar.adapter)
X {
X case _EGACOLOR:
X if (newlines >= 43) PDC_set_font(_FONT8);
X else PDC_set_80x25();
X break;
X
X case _VGACOLOR:
X if (newlines > 28) PDC_set_font(_FONT8);
X else if (newlines > 25) PDC_set_font(_FONT14);
X else PDC_set_80x25();
X break;
X
X default:
X break;
X }
X#endif
X#ifdef OS2
X if (newlines >= 43) PDC_set_font(_FONT8);
X else if (newlines > 25) PDC_set_font(_FONT14);
X else PDC_set_80x25();
X#endif
X _cursvar.lines = LINES = PDC_get_rows();
X _cursvar.cols = COLS = PDC_get_columns();
X
X if (curscr->_pmaxy > LINES)
X {
X PDC_scroll(0, 0, curscr->_pmaxy - 1, COLS - 1, 0, _cursvar.orig_attr);
X }
X else
X {
X PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, _cursvar.orig_attr);
X }
X if ((tmp = resize_win(tmpwin, LINES, COLS)) != (WINDOW *) NULL)
X {
X tmpwin = tmp;
X }
X else
X {
X return (ERR);
X }
X if ((tmp = resize_win(curscr, LINES, COLS)) != (WINDOW *) NULL)
X {
X curscr = tmp;
X }
X else
X {
X return (ERR);
X }
X if ((tmp = resize_win(stdscr, LINES, COLS)) != (WINDOW *) NULL)
X {
X stdscr = tmp;
X touchwin(stdscr);
X wnoutrefresh(stdscr);
X }
X else
X {
X return (ERR);
X }
X return (OK);
X}
END_OF_FILE
if test 2953 -ne `wc -c <'nonport/resize.c'`; then
echo shar: \"'nonport/resize.c'\" unpacked with wrong size!
fi
# end of 'nonport/resize.c'
fi
if test -f 'portable/doupdate.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/doupdate.c'\"
else
echo shar: Extracting \"'portable/doupdate.c'\" \(2951 characters\)
sed "s/^X//" >'portable/doupdate.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef doupdate
X
X#ifndef NDEBUG
Xchar *rcsid_doupdate = "$Header: c:/curses/portable/RCS/doupdate.c%v 2.0 1992/11/15 03:28:50 MH Rel $";
X#endif
X
XWINDOW *twin; /* used by many routines */
X
X
X/*man-start*********************************************************************
X
X doupdate() - do effiecient refresh
X
X X/Open Description: (part of the wnoutrefresh() description.)
X These two routines allow multiple updates with more efficiency
X than wrefresh() alone. In addition to all of the window
X structures representing the terminal screen: a physical screen,
X describing what is actually on the screen and a virtual screen,
X describing what the programmer wants to have on the screen.
X
X The wrefresh() function works by first calling wnoutrefresh(),
X which copies the named window to the virtual screen. It then
X calls doupdate(), which compares the virtual screen to the
X physical screen and does the actual update. If the programmer
X wishes to output several windows at once, a series of cals to
X wrefresh() will result in alternating calls to wnoutrefresh()
X and doupdate(), causing several bursts of output to the
X screen. By first calling wnoutrefresh() for each window, it
X is then possible to call doupdate() once. This results in
X only one burst of output, with probably fewer total characters
X transmitted and certainly less CPU time used.
X
X PDCurses Description:
X In addition to the above, if REGISTERWINDOWS is TRUE when the
X library was compiled, any windows registered (true by default
X with PDCurses and _cursvar.refreshall is TRUE, then all
X registered windows will be called via wnoutrefresh() before
X the actual screen update begins.
X
X X/Open Return Value:
X The doupdate() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int doupdate( void );
X X/Open Dec '88 int doupdate( void );
X BSD Curses int doupdate( void );
X SYS V Curses int doupdate( void );
X
X**man-end**********************************************************************/
X
Xint doupdate(void)
X{
Xregister int i;
X#ifdef REGISTERWINDOWS
X WINDS* next = _cursvar.visible;
X
X if (_cursvar.refreshall)
X {
X while (next != NULL)
X {
X if (next->w->_parent != NULL)
X {
X touchwin(next->w->_parent);
X wnoutrefresh(next->w->_parent);
X }
X touchwin(next->w);
X wnoutrefresh(next->w);
X next = next->next;
X }
X }
X#endif
X if (_cursvar.shell)
X reset_prog_mode();
X
X twin = tmpwin;
X if (twin == (WINDOW *)NULL)
X return( ERR );
X
X if (curscr->_clear)
X {
X PDC_clr_update(curscr);
X }
X else
X {
X if (twin->_clear)
X {
X PDC_clr_update(twin);
X }
X else
X {
X for (i = 0; i < LINES; i++)
X {
X if (twin->_firstch[i] != _NO_CHANGE)
X if (PDC_transform_line(i))
X break;
X }
X }
X }
X curscr->_curx = twin->_curx;
X curscr->_cury = twin->_cury;
X PDC_gotoxy(curscr->_cury, curscr->_curx);
X return( OK );
X}
END_OF_FILE
if test 2951 -ne `wc -c <'portable/doupdate.c'`; then
echo shar: \"'portable/doupdate.c'\" unpacked with wrong size!
fi
# end of 'portable/doupdate.c'
fi
if test -f 'portable/hascolor.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/hascolor.c'\"
else
echo shar: Extracting \"'portable/hascolor.c'\" \(763 characters\)
sed "s/^X//" >'portable/hascolor.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef has_colors
X
X#ifndef NDEBUG
Xchar *rcsid_hascolor = "$Header: c:/curses/portable/RCS/hascolor.c%v 2.0 1992/11/15 03:28:54 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X has_colors() - Indicates if the terminal supports color.
X
X PDCurses Description:
X
X This routine indicates if the terminal supports and can maniplulate
X color.
X
X PDCurses Return Value:
X This function returns TRUE on success and FALSE on error.
X
X PDCurses Errors:
X N/A
X
X Portability:
X PDCurses int has_colors( void );
X
X**man-end**********************************************************************/
X
Xint has_colors(void)
X{
X if (_cursvar.mono)
X return(FALSE);
X return(TRUE);
X}
END_OF_FILE
if test 763 -ne `wc -c <'portable/hascolor.c'`; then
echo shar: \"'portable/hascolor.c'\" unpacked with wrong size!
fi
# end of 'portable/hascolor.c'
fi
if test -f 'portable/mvprintw.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/mvprintw.c'\"
else
echo shar: Extracting \"'portable/mvprintw.c'\" \(2365 characters\)
sed "s/^X//" >'portable/mvprintw.c' <<'END_OF_FILE'
X#include <stdarg.h>
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef mvprintw
X
X#ifndef NDEBUG
Xchar *rcsid_mvprintw = "$Header: c:/curses/portable/RCS/mvprintw.c%v 2.0 1992/11/15 03:29:31 MH Rel $";
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X mvprintw() - formatted write to a window
X
X X/Open Description:
X The printw routine adds a string to the default window
X starting at the current cursor position. This routine causes
X the string that would normally be output by printf to be
X output by addstr.
X
X The routine wprintw adds a string to the specified window
X starting at the current cursor position. This routine causes
X the string that would normally be output by printf to be
X output by waddstr.
X
X The routine mvprintw adds a string to the default window
X starting at the specified cursor position. This routine
X causes the string that would normally be output by printf to
X be output by addstr.
X
X The routine mvwprintw adds a string to the specified window
X starting at the specified cursor position. This routine
X causes the string that would normally be output by printf to
X be output by waddstr.
X
X All these routines are analogous to printf. It is advisable
X to use the field width options of printf to avoid leaving
X unwanted characters on the screen from earlier calls.
X
X PDCurses Description:
X The old Bjorn Larssen code for the 68K platform has been removed
X from this module.
X
X X/Open Return Value:
X The mvprintw() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int mvprintw( int y, int x, char* fmt, ... );
X X/Open Dec '88 int mvprintw( int y, int x, char* fmt, ... );
X BSD Curses int mvprintw( int y, int x, char* fmt, ... );
X SYS V Curses int mvprintw( int y, int x, char* fmt, ... );
X
X**man-end**********************************************************************/
X
Xint mvprintw(int y, int x, char *fmt, ...)
X{
X int retval = ERR;
X va_list args;
X
X if (stdscr == (WINDOW *)NULL)
X return (retval);
X
X if (wmove(stdscr, y, x) == ERR)
X return( retval );
X
X va_start(args, fmt);
X vsprintf(c_printscanbuf, fmt, args);
X va_end(args);
X
X if (waddstr(stdscr, c_printscanbuf) == ERR)
X return( retval );
X retval = (strlen(c_printscanbuf));
X return( retval );
X}
END_OF_FILE
if test 2365 -ne `wc -c <'portable/mvprintw.c'`; then
echo shar: \"'portable/mvprintw.c'\" unpacked with wrong size!
fi
# end of 'portable/mvprintw.c'
fi
if test -f 'portable/mvwprint.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/mvwprint.c'\"
else
echo shar: Extracting \"'portable/mvwprint.c'\" \(2414 characters\)
sed "s/^X//" >'portable/mvwprint.c' <<'END_OF_FILE'
X#include <stdarg.h>
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef mvwprintw
X
X#ifndef NDEBUG
Xchar *rcsid_mvwprint = "$Header: c:/curses/portable/RCS/mvwprint.c%v 2.0 1992/11/15 03:29:32 MH Rel $";
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X mvwprintw() - formatted write to a window
X
X X/Open Description:
X The printw routine adds a string to the default window
X starting at the current cursor position. This routine causes
X the string that would normally be output by printf to be
X output by addstr.
X
X The routine wprintw adds a string to the specified window
X starting at the current cursor position. This routine causes
X the string that would normally be output by printf to be
X output by waddstr.
X
X The routine mvprintw adds a string to the default window
X starting at the specified cursor position. This routine
X causes the string that would normally be output by printf to
X be output by addstr.
X
X The routine mvwprintw adds a string to the specified window
X starting at the specified cursor position. This routine
X causes the string that would normally be output by printf to
X be output by waddstr.
X
X All these routines are analogous to printf. It is advisable
X to use the field width options of printf to avoid leaving
X unwanted characters on the screen from earlier calls.
X
X PDCurses Description:
X The old Bjorn Larssen code for the 68K platform has been removed
X from this module.
X
X X/Open Return Value:
X The mvprintw() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int mvwprintw(WINDOW* win, int y, int x, char *fmt, ...)
X X/Open Dec '88 int mvwprintw(WINDOW* win, int y, int x, char *fmt, ...)
X BSD Curses int mvwprintw(WINDOW* win, int y, int x, char *fmt, ...)
X SYS V Curses int mvwprintw(WINDOW* win, int y, int x, char *fmt, ...)
X
X**man-end**********************************************************************/
X
Xint mvwprintw(WINDOW * win, int y, int x, char *fmt, ...)
X{
X int retval = ERR;
X va_list args;
X
X if (win == (WINDOW *)NULL)
X return (retval);
X
X if (wmove(win, y, x) == ERR)
X return (retval);
X
X va_start(args, fmt);
X vsprintf(c_printscanbuf, fmt, args);
X va_end(args);
X
X if (waddstr(win, c_printscanbuf) == ERR)
X return (retval);
X retval = (strlen(c_printscanbuf));
X return (retval);
X}
END_OF_FILE
if test 2414 -ne `wc -c <'portable/mvwprint.c'`; then
echo shar: \"'portable/mvwprint.c'\" unpacked with wrong size!
fi
# end of 'portable/mvwprint.c'
fi
if test -f 'portable/mvwscanw.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/mvwscanw.c'\"
else
echo shar: Extracting \"'portable/mvwscanw.c'\" \(2341 characters\)
sed "s/^X//" >'portable/mvwscanw.c' <<'END_OF_FILE'
X#include <stdarg.h>
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef mvwscanw
X
X#ifndef NDEBUG
Xchar *rcsid_mvwscanw = "$Header: c:/curses/portable/RCS/mvwscanw.c%v 2.0 1992/11/15 03:29:02 MH Rel $";
X#endif
X
X
X
X/*man-start*********************************************************************
X
X mvwscanw() - read formatted from window
X
X X/Open Description:
X These routines correspond to scanf. The function scanw reads
X input from the default window. The function wscanw reads
X input from the specified window. The function mvscanw moves
X the cursor to the specified position and then reads input from
X the default window. The function mvwscanw moves the cursor to
X the specified position and then reads input from the specified
X window.
X
X For all the functions, the routine wgetstr is called to get a
X string from the window, and the resulting line is used as
X input for the scan. All character interpretation is carried
X out according to the scanf function rules.
X
X PDCurses Description:
X The old Bjorn Larssen code for the 68K platform has been removed
X from this module.
X
X X/Open Return Value:
X Upon successful completion, the scanw, mvscanw, mvwscanw and
X wscanw functions return the number of items successfully
X matched. On end-of-file, they return EOF. Otherwise they
X return ERR.
X
X PDCurses Errors:
X No errors.
X
X Portability:
X PDCurses int mvwscanw(WINDOW* win, int y, int x, char *fmt, ...);
X X/Open Dec '88 int mvwscanw(WINDOW* win, int y, int x, char *fmt, ...);
X BSD Curses int mvwscanw(WINDOW* win, int y, int x, char *fmt, ...);
X SYS V Curses int mvwscanw(WINDOW* win, int y, int x, char *fmt, ...);
X
X**man-end**********************************************************************/
X
Xint mvwscanw(WINDOW * win, int y, int x, char *fmt,...)
X{
X va_list args;
X int retval = ERR;
X
X#if !defined (HC)
X if (win == (WINDOW *)NULL)
X return( retval );
X
X if (wmove(win, y, x) == ERR)
X return( retval );
X
X wrefresh(win); /* set cursor position */
X
X /*
X * get string
X */
X c_printscanbuf[0] = '\0'; /* reset to empty string */
X if (wgetstr(win, c_printscanbuf) == ERR)
X return( retval );
X va_start(args, fmt);
X#ifdef NO_VSSCANF
X retval = PDC_vsscanf(c_printscanbuf, fmt, args);
X#else
X retval = vsscanf(c_printscanbuf, fmt, args);
X#endif
X va_end(args);
X#endif
X return( retval );
X}
END_OF_FILE
if test 2341 -ne `wc -c <'portable/mvwscanw.c'`; then
echo shar: \"'portable/mvwscanw.c'\" unpacked with wrong size!
fi
# end of 'portable/mvwscanw.c'
fi
if test -f 'portable/newpad.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/newpad.c'\"
else
echo shar: Extracting \"'portable/newpad.c'\" \(2641 characters\)
sed "s/^X//" >'portable/newpad.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef newpad
X
X#ifndef NDEBUG
Xchar *rcsid_newpad = "$Header: c:/curses/portable/RCS/newpad.c%v 2.0 1992/11/15 03:29:27 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X newpad() - Create new pad
X
X X/Open Description:
X Creates a new pad data structure. A pad is a special case of a
X window, which is not restricted by the screen size, and is not
X necessarily associated with a particular part of the screen. A
X pad can be used when a large window is needed, and only a part
X of the window will be on the screen at one tme. Automatic
X refreshes of pads (e.g., from scrolling or echoing of input) do
X not occur. It is not legal to call refresh() with a pad as an
X argument; the routines prefresh() or pnoutrefresh() should be
X called instead. Note that these routines require additional
X parameters to specify the part of the pad to be displayed and
X the location on the screen to be used for display.
X
X PDCurses Description:
X PDCurses (as a library) provides the developer with the ability to
X hook in their own malloc debugging package. See the details in
X INITSCR.C for details on how to accomplish this.
X
X X/Open Return Value:
X The newpad() function returns a pointer to the new WINDOW structure
X created on success and returns a null pointer on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses WINDOW* newpad( int nlines, int ncols );
X X/Open Dec '88 WINDOW* newpad( int nlines, int ncols );
X BSD Curses WINDOW* newpad( int nlines, int ncols );
X SYS V Curses WINDOW* newpad( int nlines, int ncols );
X
X**man-end**********************************************************************/
X
XWINDOW* newpad( int nlines, int ncols )
X{
Xextern void* (*mallc)( size_t );
Xextern void* (*callc)( size_t, size_t );
Xextern void (*fre)( void* );
X
X WINDOW* win;
X chtype* ptr;
X int i;
X int j;
X
X if ((win = PDC_makenew( nlines, ncols, -1, -1 )) == (WINDOW *)NULL)
X return( (WINDOW *)NULL );
X
X for (i = 0; i < nlines; i++)
X {
X /*
X * make and clear the lines
X */
X if ((win->_y[i] = (*callc)(ncols, sizeof(chtype))) == NULL)
X {
X for (j = 0; j < i; j++)
X {
X /*
X * if error, free all the data
X */
X (*fre)(win->_y[j]);
X }
X (*fre)(win->_firstch);
X (*fre)(win->_lastch);
X (*fre)(win->_y);
X (*fre)(win);
X return( (WINDOW *)NULL );
X }
X else
X {
X for (ptr = win->_y[i];
X ptr < win->_y[i] + ncols;)
X {
X /*
X * Retain the original screen attributes...
X */
X
X *ptr++ = _cursvar.blank;
X }
X }
X }
X win->_flags = _PAD;
X return( win );
X}
END_OF_FILE
if test 2641 -ne `wc -c <'portable/newpad.c'`; then
echo shar: \"'portable/newpad.c'\" unpacked with wrong size!
fi
# end of 'portable/newpad.c'
fi
if test -f 'portable/newwin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/newwin.c'\"
else
echo shar: Extracting \"'portable/newwin.c'\" \(2602 characters\)
sed "s/^X//" >'portable/newwin.c' <<'END_OF_FILE'
X#include <stdlib.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef newwin
X
X#ifndef NDEBUG
Xchar *rcsid_newwin = "$Header: c:/curses/portable/RCS/newwin.c%v 2.0 1992/11/15 03:29:28 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X newwin() - create new window
X
X X/Open Description:
X Create a new window with the given number of lines, nlines and
X columns, ncols. The upper left corner of the window is at line
X begy, column begx. If either nlines or ncols is zero,
X they will be defaulted to LINES - begy and COLS - begx. A
X new full-screen window is created by calling newwin(0, 0, 0, 0).
X
X PDCurses Description:
X PDCurses allows developers to provide a hook into the malloc
X package used. See initscr(3c) for more details.
X
X Also, when a window is created, it uses the default screen
X colors and attributes in effect when initscr() was called.
X
X X/Open Return Value:
X On success the newwin() function returns a pointer to the new
X WINDOW structure created. On failure the function returns a
X null pointer.
X
X PDCurses Errors:
X The following conditions are errors:
X o number of lines == 0,
X o number of columns == 0,
X o failure to allocate memory for the window structure
X
X Portability:
X PDCurses WINDOW* newwin(int nlines,int ncols,int begy,int begx);
X X/Open Dec '88 WINDOW* newwin(int nlines,int ncols,int begy,int begx);
X BSD Curses WINDOW* newwin(int nlines,int ncols,int begy,int begx);
X SYS V Curses WINDOW* newwin(int nlines,int ncols,int begy,int begx);
X
X**man-end**********************************************************************/
X
XWINDOW* newwin(int nlines, int ncols, int begy, int begx)
X{
Xextern void* (*mallc)( size_t );
Xextern void* (*callc)( size_t, size_t );
Xextern void (*fre)( void* );
X
X WINDOW* win;
X chtype* ptr;
X int i;
X int j;
X
X if (nlines == 0) nlines = LINES - begy;
X if (ncols == 0) ncols = COLS - begx;
X
X if ((win = PDC_makenew(nlines, ncols, begy, begx)) == (WINDOW *) NULL)
X return( (WINDOW *)NULL );
X
X for (i = 0; i < nlines; i++)
X {
X /*
X * make and clear the lines
X */
X if ((win->_y[i] = (*callc)(ncols, sizeof(chtype))) == NULL)
X {
X for (j = 0; j < i; j++)
X {
X /*
X * if error, free all the data
X */
X (*fre)(win->_y[j]);
X }
X (*fre)(win->_firstch);
X (*fre)(win->_lastch);
X (*fre)(win->_y);
X (*fre)(win);
X return( (WINDOW *)NULL );
X }
X else
X {
X for (ptr = win->_y[i];
X ptr < win->_y[i] + ncols;)
X {
X /*
X * Retain the original screen attributes...
X */
X *ptr++ = _cursvar.blank;
X }
X }
X }
X return( win );
X}
END_OF_FILE
if test 2602 -ne `wc -c <'portable/newwin.c'`; then
echo shar: \"'portable/newwin.c'\" unpacked with wrong size!
fi
# end of 'portable/newwin.c'
fi
if test -f 'portable/overlay.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/overlay.c'\"
else
echo shar: Extracting \"'portable/overlay.c'\" \(2366 characters\)
sed "s/^X//" >'portable/overlay.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef overlay
X
X#ifndef NDEBUG
Xchar *rcsid_overlay = "$Header: c:/curses/portable/RCS/overlay.c%v 2.0 1992/11/15 03:29:35 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X overlay() - Overlay windows
X
X X/Open Description: overlay() and overwrite()
X These functions overlay src_w on top of dst_w; that is,
X all text in src_w is copied into dst_w. The windows
X src_w and dst_w are not required to be the same size. The
X copy starts at (0, 0) on each window. The difference between
X the two functions is that overlay() is non-destructive
X (blanks are not copied) while overwrite() is destructive
X (blanks are copied).
X
X PDCurses Description:
X No additional PDCurses functionality.
X
X X/Open Return Value:
X The overlay() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to pass a NULL window pointer.
X
X Portability:
X PDCurses int overlay( WINDOW* src_w, WINDOW* dst_w );
X X/Open Dec '88 int overlay( WINDOW* src_w, WINDOW* dst_w );
X BSD Curses int overlay( WINDOW* src_w, WINDOW* dst_w );
X SYS V Curses int overlay( WINDOW* src_w, WINDOW* dst_w );
X
X**man-end**********************************************************************/
X
Xint overlay(WINDOW *src_w, WINDOW *dst_w)
X{
X int* minchng;
X int* maxchng;
X chtype* w1ptr;
X chtype* w2ptr;
X chtype attrs;
X int col;
X int line;
X int last_line;
X int last_col;
X
X if (src_w == (WINDOW *)NULL) return( ERR );
X if (dst_w == (WINDOW *)NULL) return( ERR );
X
X minchng = dst_w->_firstch;
X maxchng = dst_w->_lastch;
X last_col = min(src_w->_maxx, dst_w->_maxx) - 1;
X last_line = min(src_w->_maxy, dst_w->_maxy) - 1;
X attrs = dst_w->_attrs;
X
X for (line = 0; line <= last_line; line++)
X {
X register int fc;
X register int lc;
X
X w1ptr = src_w->_y[line];
X w2ptr = dst_w->_y[line];
X fc = _NO_CHANGE;
X
X for (col = 0; col <= last_col; col++)
X {
X if ((*w1ptr & A_CHARTEXT) != src_w->_blank)
X {
X *w2ptr = (*w1ptr & A_CHARTEXT) | attrs;
X if (fc == _NO_CHANGE)
X {
X fc = col;
X }
X lc = col;
X }
X w1ptr++;
X w2ptr++;
X }
X
X if (*minchng == _NO_CHANGE)
X {
X *minchng = fc;
X *maxchng = lc;
X }
X else if (fc != _NO_CHANGE)
X {
X if (fc < *minchng) *minchng = fc;
X if (lc > *maxchng) *maxchng = lc;
X }
X minchng++;
X maxchng++;
X }
X return( OK );
X}
END_OF_FILE
if test 2366 -ne `wc -c <'portable/overlay.c'`; then
echo shar: \"'portable/overlay.c'\" unpacked with wrong size!
fi
# end of 'portable/overlay.c'
fi
if test -f 'portable/overwrit.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/overwrit.c'\"
else
echo shar: Extracting \"'portable/overwrit.c'\" \(2396 characters\)
sed "s/^X//" >'portable/overwrit.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef overwrite
X
X#ifndef NDEBUG
Xchar *rcsid_overwrit = "$Header: c:/curses/portable/RCS/overwrit.c%v 2.0 1992/11/15 03:29:36 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X overwrite() - Overwrite windows
X
X X/Open Description: overlay() and overwrite()
X These functions overlay src_w on top of dst_w; that is,
X all text in src_w is copied into dst_w. The windows
X src_w and dst_w are not required to be the same size. The
X copy starts at (0, 0) on each window. The difference between
X the two functions is that overlay() is non-destructive
X (blanks are not copied) while overwrite() is destructive
X (blanks are copied).
X
X PDCurses Description:
X No additional PDCurses functionality.
X
X X/Open Return Value:
X The overwrite() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to pass a NULL window pointer.
X
X Portability:
X PDCurses int overwrite( WINDOW* src_w, WINDOW* dst_w );
X X/Open Dec '88 int overwrite( WINDOW* src_w, WINDOW* dst_w );
X BSD Curses int overwrite( WINDOW* src_w, WINDOW* dst_w );
X SYS V Curses int overwrite( WINDOW* src_w, WINDOW* dst_w );
X
X**man-end**********************************************************************/
X
Xint overwrite(WINDOW *src_w, WINDOW *dst_w)
X{
X int* minchng;
X int* maxchng;
X chtype* w1ptr;
X chtype* w2ptr;
X chtype attrs;
X int col;
X int line;
X int last_line;
X int last_col;
X
X if (src_w == (WINDOW *)NULL) return( ERR );
X if (dst_w == (WINDOW *)NULL) return( ERR );
X
X minchng = dst_w->_firstch;
X maxchng = dst_w->_lastch;
X last_col = min(src_w->_maxx, dst_w->_maxx) - 1;
X last_line = min(src_w->_maxy, dst_w->_maxy) - 1;
X attrs = dst_w->_attrs;
X
X for (line = 0; line <= last_line; line++)
X {
X register int fc;
X register int lc;
X
X w1ptr = src_w->_y[line];
X w2ptr = dst_w->_y[line];
X fc = _NO_CHANGE;
X
X for (col = 0; col <= last_col; col++)
X {
X if ((*w1ptr & A_CHARTEXT) != (*w2ptr & A_CHARTEXT))
X {
X *w2ptr = (*w1ptr & A_CHARTEXT) | attrs;
X if (fc == _NO_CHANGE)
X {
X fc = col;
X }
X lc = col;
X }
X w1ptr++;
X w2ptr++;
X }
X
X if (*minchng == _NO_CHANGE)
X {
X *minchng = fc;
X *maxchng = lc;
X }
X else if (fc != _NO_CHANGE)
X {
X if (fc < *minchng) *minchng = fc;
X if (lc > *maxchng) *maxchng = lc;
X }
X minchng++;
X maxchng++;
X }
X return( OK );
X}
X
END_OF_FILE
if test 2396 -ne `wc -c <'portable/overwrit.c'`; then
echo shar: \"'portable/overwrit.c'\" unpacked with wrong size!
fi
# end of 'portable/overwrit.c'
fi
if test -f 'portable/prefresh.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/prefresh.c'\"
else
echo shar: Extracting \"'portable/prefresh.c'\" \(2499 characters\)
sed "s/^X//" >'portable/prefresh.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef prefresh
X
X#ifndef NDEBUG
Xchar *rcsid_prefresh = "$Header: c:/curses/portable/RCS/prefresh.c%v 2.0 1992/11/15 03:29:08 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X prefresh() - refresh pad
X
X X/Open Description:
X The prefresh routine copies the specified pad to the physical
X terminal screen. It takes account of what is already
X displayed on the screen to optimize cursor movement.
X
X The pnoutrefresh routine copies the named pad to the virtual
X screen. It then compares the virtual screen with the physical
X screen and performs the actual update.
X
X These routines are analogous to the routines wrefresh and
X wnoutrefresh except that pads, instead of windows, are
X involved. Additional parameters are also needed to indicate
X what part of the pad and screen are involved. The upper left
X corner of the part of the pad to be displayed is specified by
X py and px. The coordinates sy1, sx1, sy2, and sx2 specify the
X edges of the screen rectangle that will contain the selected
X part of the pad.
X
X The lower right corner of the pad rectangle to be displayed is
X calculated from the screen co-ordinates. This ensures that
X the screen rectangle and the pad rectangle are the same size.
X
X Both rectangles must be entirely contained within their
X respective structures.
X
X PDCurses Description:
X Contrary to the statements above, the pnoutrefresh() routine
X will not perform an update to the physical screen. This task
X is performed by doupdate().
X
X X/Open Return Value:
X The prefresh() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to pass a null WINDOW* pointer.
X
X Portability:
X PDCurses int prefresh( WINDOW* win, int py, int px,
X int sy1, int sx1,
X int sy2, int sx2 );
X X/Open Dec '88 int prefresh( WINDOW* win, int py, int px,
X int sy1, int sx1,
X int sy2, int sx2 );
X BSD Curses int prefresh( WINDOW* win, int pminrow, int pmincol,
X int sminrow, int smincol,
X int smaxrow, int smaxcol );
X SYS V Curses int prefresh( WINDOW* win, int py, int px,
X int sy1, int sx1,
X int sy2, int sx2 );
X
X**man-end**********************************************************************/
X
Xint prefresh(WINDOW* win,int py,int px,int sy1,int sx1,int sy2,int sx2)
X{
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X pnoutrefresh(win, py, px, sy1, sx1, sy2, sx2);
X doupdate();
X return( OK );
X}
END_OF_FILE
if test 2499 -ne `wc -c <'portable/prefresh.c'`; then
echo shar: \"'portable/prefresh.c'\" unpacked with wrong size!
fi
# end of 'portable/prefresh.c'
fi
if test -f 'portable/subwin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/subwin.c'\"
else
echo shar: Extracting \"'portable/subwin.c'\" \(2915 characters\)
sed "s/^X//" >'portable/subwin.c' <<'END_OF_FILE'
X#include <stdlib.h>
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef subwin
X
X#ifndef NDEBUG
Xchar *rcsid_subwin = "$Header: c:/curses/portable/RCS/subwin.c%v 2.0 1992/11/15 03:29:24 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X subwin() - create subwindow
X
X X/Open Description:
X This routine creates a new sub-window within a window. The
X dimensions of the sub-window are nlines lines and ncols
X columns. The sub-window is at position (begin_y, begin_x) on
X the screen. This position is relative to the screen, and not
X to the window orig.
X
X The sub-window is made in the middle of the window orig, so
X that changes made to either window will affect both. When
X using this routine, it will often be necessary to call
X touchwin before calling wrefresh.
X
X PDCurses Description:
X No additional PDCurses functionality.
X
X X/Open Return Value:
X On success the subwin function returns a pointer to the new
X WINDOW structure created. On failure the function returns a
X null pointer.
X
X PDCurses Errors:
X It is an error to pass sub-window coordinates that are out of
X range or a NULL WINDOW pointer. subwin() may also return an
X error if it fails to allocate enough memory for the window
X structure.
X
X Portability:
X PDCurses WINDOW* subwin( WINDOW* orig, int nlines,
X int ncols, int begin_y, int begin_x );
X X/Open Dec '88 WINDOW* subwin( WINDOW* orig, int nlines,
X int ncols, int begin_y, int begin_x );
X BSD Curses WINDOW* subwin( WINDOW* orig, int nlines,
X int ncols, int begin_y, int begin_x );
X SYS V Curses WINDOW* subwin( WINDOW* orig, int nlines,
X int ncols, int begin_y, int begin_x );
X
X**man-end**********************************************************************/
X
XWINDOW* subwin(WINDOW* orig,int nlines,int ncols,int begin_y,int begin_x)
X{
Xextern void* (*mallc)( size_t );
Xextern void* (*callc)( size_t, size_t );
Xextern void (*fre)( void* );
X
X WINDOW* win;
X int i;
X int j = begin_y - orig->_begy;
X int k = begin_x - orig->_begx;
X
X if (!orig)
X return( (WINDOW *)NULL );
X
X /*
X * make sure window fits inside the original one
X */
X if ((begin_y < orig->_begy) ||
X (begin_x < orig->_begx) ||
X (begin_y + nlines) > (orig->_begy + orig->_maxy) ||
X (begin_x + ncols) > (orig->_begx + orig->_maxx))
X {
X return( (WINDOW *)NULL );
X }
X if (!nlines) nlines = orig->_maxy - 1 - j;
X if (!ncols) ncols = orig->_maxx - 1 - k;
X if ((win = PDC_makenew(nlines, ncols, begin_y, begin_x)) == (WINDOW *) NULL)
X {
X return( (WINDOW *)NULL );
X }
X
X /*
X * initialize window variables
X */
X win->_attrs = orig->_attrs;
X win->_leave = orig->_leave;
X win->_scroll = orig->_scroll;
X win->_nodelay = orig->_nodelay;
X win->_use_keypad = orig->_use_keypad;
X win->_parent = orig;
X
X for (i = 0; i < nlines; i++)
X {
X win->_y[i] = (orig->_y[j++]) + k;
X }
X
X win->_flags |= _SUBWIN;
X return (win);
X}
END_OF_FILE
if test 2915 -ne `wc -c <'portable/subwin.c'`; then
echo shar: \"'portable/subwin.c'\" unpacked with wrong size!
fi
# end of 'portable/subwin.c'
fi
if test -f 'private/_chins.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_chins.c'\"
else
echo shar: Extracting \"'private/_chins.c'\" \(2338 characters\)
sed "s/^X//" >'private/_chins.c' <<'END_OF_FILE'
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__chins = "$Header: c:/curses/private/RCS/_chins.c%v 2.0 1992/11/15 03:24:24 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_chins() - Low-level insert character in window
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X This routine provides the basic functionality for the X/Open
X [mv][w]insch() routines. The xlat flag indicates that normal
X character translation is performed or not. If not, then the
X character is output as is.
X
X The 'xlat' flag is TRUE for the normal curses routines.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int PDC_chins( WINDOW* win, chtype c, bool xlat );
X
X**man-end**********************************************************************/
X
Xint PDC_chins(WINDOW *win, chtype c, bool xlat)
X{
X int retval = ERR;
X int x;
X int y;
X int maxx;
X int offset;
X chtype* temp1;
X register chtype* dstp;
X register chtype* srcp;
X char ch = (c & A_CHARTEXT);
X
X if (win == (WINDOW *)NULL)
X return( retval );
X
X x = win->_curx;
X y = win->_cury;
X maxx = win->_maxx;
X offset = 1;
X temp1 = &win->_y[y][x];
X
X/*
X if ((ch < ' ') &&
X ((ch == '\n') ||
X (ch == '\r') ||
X (ch == '\t') ||
X (ch == '\b')))
X {
X retval = PDC_chadd(win, c, xlat,FALSE);
X return( retval );
X }
X*/
X if ((ch < ' ') && xlat)
X {
X offset++;
X }
X
X#ifdef DOS
X# if SMALL || MEDIUM
X srcp = temp1;
X dstp = temp1+offset;
X movedata(FP_SEG(srcp), FP_OFF(srcp),
X FP_SEG(dstp), FP_OFF(dstp),
X (maxx - x -offset) * sizeof(chtype));
X# else
X /* Changed from memcpy to memmove. Should work with
X * TC and MSC.
X * -- MH 920605
X */
X/* memmove( temp1 + sizeof(chtype), temp1, (maxx - x -1) * sizeof(chtype) );*/
X memmove( temp1+offset, temp1, (maxx - x -offset) * sizeof(chtype) );
X# endif
X#endif
X#ifdef OS2
X memmove( temp1+offset, temp1, (maxx - x -offset) * sizeof(chtype) );
X#endif
X
X win->_lastch[y] = maxx-1;
X
X if ((win->_firstch[y] == _NO_CHANGE) ||
X (win->_firstch[y] > x))
X {
X win->_firstch[y] = x;
X }
X /*
X * PDC_chadd() fixes CTRL-chars too
X */
X retval = (PDC_chadd(win, c, xlat,FALSE));
X return( retval );
X}
END_OF_FILE
if test 2338 -ne `wc -c <'private/_chins.c'`; then
echo shar: \"'private/_chins.c'\" unpacked with wrong size!
fi
# end of 'private/_chins.c'
fi
if test -f 'private/_gbiosky.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_gbiosky.c'\"
else
echo shar: Extracting \"'private/_gbiosky.c'\" \(2473 characters\)
sed "s/^X//" >'private/_gbiosky.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__gbiosky = "$Header: c:/curses/private/RCS/_gbiosky.c%v 2.0 1992/11/15 03:24:21 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_get_bios_key() - Returns the next key available from the BIOS.
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Returns the next key code struck at the keyboard. If the low 8
X bits are 0, the upper bits contain the extended character
X code. If bit 0-7 are non-zero, the upper bits = 0.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_get_bios_key( void );
X
X**man-end**********************************************************************/
X
Xint PDC_get_bios_key(void)
X{
X#ifdef FLEXOS
Xunsigned ch = 0;
X
X retcode = s_read(0x00, 0L, (char *) &ch, 2L, 0L);
X return( (retcode < 0L) ? ERR : ch );
X#endif
X#if defined (DOS) || defined (OS2)
X int ascii,scan;
X#ifdef DOS
X static unsigned char keyboard_function=0xFF;
X unsigned char far *enhanced_keyboard;
X
X if (keyboard_function == 0xFF)
X {
X enhanced_keyboard = (unsigned char far *) 0x0496L;
X regs.h.ah = 0x02; /* get shift status for all keyboards */
X int86(0x16, ®s, ®s);
X scan = regs.h.al;
X regs.h.ah = 0x12; /* get shift status for enhanced keyboards */
X int86(0x16, ®s, ®s);
X if (scan == regs.h.al
X && *enhanced_keyboard == 0x10)
X keyboard_function = 0x10;
X else
X keyboard_function = 0x0;
X }
X regs.h.ah = keyboard_function;
X int86(0x16, ®s, ®s);
X ascii = regs.h.al;
X scan = regs.h.ah;
X#endif
X#ifdef OS2
X KBDKEYINFO keyInfo;
X
X KbdCharIn(&keyInfo, IO_WAIT, 0); /* get a character */
X ascii = keyInfo.chChar;
X scan = keyInfo.chScan;
X#endif
X if (scan == 0x1c && ascii == 0x0a) /* ^Enter */
X return ((int) (0xfc00));
X if ((scan == 0x03 && ascii == 0x00) /* ^@ - Null */
X || (scan == 0xe0 && ascii == 0x0d) /* PadEnter */
X || (scan == 0xe0 && ascii == 0x0a)) /* ^PadEnter */
X return ((int) (ascii << 8));
X if ((scan == 0x37 && ascii == 0x2a) /* Star */
X || (scan == 0x4a && ascii == 0x2d) /* Minus */
X || (scan == 0x4e && ascii == 0x2b) /* Plus */
X || (scan == 0xe0 && ascii == 0x2f)) /* Slash */
X return ((int) ((ascii & 0x0f) | 0xf0) << 8);
X if (ascii == 0x00 || ascii == 0xe0)
X return ((int) (scan << 8));
X return ((int) (ascii));
X#endif
X}
END_OF_FILE
if test 2473 -ne `wc -c <'private/_gbiosky.c'`; then
echo shar: \"'private/_gbiosky.c'\" unpacked with wrong size!
fi
# end of 'private/_gbiosky.c'
fi
if test -f 'private/_getrows.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_getrows.c'\"
else
echo shar: Extracting \"'private/_getrows.c'\" \(2370 characters\)
sed "s/^X//" >'private/_getrows.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__getrows = "$Header: c:/curses/private/RCS/_getrows.c%v 2.0 1992/11/15 03:24:26 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_get_rows() - Return number of screen rows.
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Returns the maximum number of rows supported by the display.
X e.g. 25, 28, 43, 50, 60, 66...
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_get_rows( void );
X
X**man-end**********************************************************************/
X
Xint PDC_get_rows(void)
X{
X#ifdef FLEXOS
X return (vir.vc_size.rs_nrows);
X#endif
X#ifdef DOS
X char far* ROWS;
X int rows;
X char *env_rows;
X/* use the value from LINES environment variable, if set. MH 10-Jun-92 */
X/* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */
X ROWS = (char far *) 0x0484L;
X rows = *ROWS + 1;
X env_rows = (char *)getenv("LINES");
X if (env_rows != (char *)NULL)
X rows = min(atoi(env_rows),rows);
X
X if ((rows == 1) && (_cursvar.adapter == _MDS_GENIUS))
X rows = 66;
X if ((rows == 1) && (_cursvar.adapter == _MDA))
X rows = 25; /* new test MH 10-Jun-92 */
X if (rows == 1)
X {
X rows = _default_lines; /* Allow pre-setting LINES */
X _cursvar.direct_video = FALSE;
X }
X switch (_cursvar.adapter)
X {
X case _EGACOLOR:
X case _EGAMONO:
X switch (rows)
X {
X case 25:
X case 43:
X break;
X default:
X rows = 25;
X }
X break;
X
X case _VGACOLOR:
X case _VGAMONO:
X/* lets be reasonably flexible with VGAs - they could be Super VGAs */
X/* capable of displaying any number of lines. MH 10-Jun-92 */
X/*
X switch (rows)
X {
X case 25:
X case 28:
X case 50:
X break;
X default:
X rows = 25;
X }
X*/
X break;
X
X default:
X rows = 25;
X break;
X }
X return (rows);
X#endif
X#ifdef OS2
X VIOMODEINFO modeInfo;
X int rows;
X char *env_rows;
X/* use the value from LINES environment variable, if set. MH 10-Jun-92 */
X/* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */
X
X modeInfo.cb = sizeof(modeInfo);
X VioGetMode(&modeInfo, 0);
X rows = modeInfo.row;
X env_rows = (char *)getenv("LINES");
X if (env_rows != (char *)NULL)
X rows = min(atoi(env_rows),rows);
X return(rows);
X#endif
X}
END_OF_FILE
if test 2370 -ne `wc -c <'private/_getrows.c'`; then
echo shar: \"'private/_getrows.c'\" unpacked with wrong size!
fi
# end of 'private/_getrows.c'
fi
if test -f 'private/_scroll.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_scroll.c'\"
else
echo shar: Extracting \"'private/_scroll.c'\" \(2928 characters\)
sed "s/^X//" >'private/_scroll.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__scroll = "$Header: c:/curses/private/RCS/_scroll.c%v 2.0 1992/11/15 03:24:34 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_scroll() - low level screen scroll
X
X PDCurses Description:
X Scrolls a window in the current page up or down. Urow, lcol,
X lrow, rcol are the window coordinates. Lines is the number of
X lines to scroll. If 0, clears the window, if < 0 scrolls down,
X if > 0 scrolls up. Blanks areas that are left, and sets
X character attributes to attr. If in a colour graphics mode,
X fills them with the colour 'attr' instead.
X
X PDCurses Return Value:
X The PDC_scroll() function returns OK on success otherwise ERR is returned.
X
X PDCurses Errors:
X An error will only be returned on the Flexos platform if s_copy()
X fails.
X
X Portability:
X PDCurses int PDC_scroll( int urow, int lcol, int rcol,
X int lines, chtype attr );
X
X**man-end**********************************************************************/
X
Xint PDC_scroll(int urow, int lcol, int lrow, int rcol, int lines, chtype attr)
X{
X#ifdef FLEXOS
X int srow;
X int scol;
X int drow;
X int dcol;
X int nrows
X int ncols;
X char blank = (char) _cursvar.blank;
X
X if (lines == 0)
X {
X sframe.fr_pl[0] = (UBYTE *) & blank;
X sframe.fr_pl[1] = (UBYTE *) & attr;
X sframe.fr_pl[2] = (UBYTE *) " ";
X sframe.fr_nrow = 1;
X sframe.fr_ncol = 1;
X sframe.fr_use = 0x00;
X nrows = lrow;
X ncols = rcol;
X srow = drow = 0;
X scol = dcol = 0;
X }
X else
X if (lines < 0)
X {
X srow = urow;
X scol = lcol;
X drow = lrow;
X dcol = rcol;
X }
X else
X if (lines > 0)
X {
X srow = urow;
X scol = lcol;
X drow = lrow;
X dcol = lcol;
X }
X
X drect.r_row = drow;
X drect.r_col = dcol;
X drect.r_nrow = nrows;
X drect.r_ncol = ncols;
X
X srect.r_col = scol;
X srect.r_row = srow;
X srect.r_nrow = nrows;
X srect.r_ncol = ncols;
X
X if (lines != 0)
X retcode = s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect, 0L, (far unsigned short *) &srect);
X else
X retcode = s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect, (far unsigned short *) &sframe, (far unsigned short *) &srect);
X return( (retcode < 0L) ? ERR : OK );
X#endif
X#ifdef DOS
X if (lines >= 0)
X {
X regs.h.ah = 0x06;
X regs.h.al = (unsigned char) lines;
X }
X else
X {
X regs.h.ah = 0x07;
X regs.h.al = (unsigned char) (-lines);
X }
X regs.h.bh = (unsigned char)((attr & A_ATTRIBUTES) >> 8);
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( OK );
X#endif
X#ifdef OS2
X USHORT ch=((attr << 8) & _cursvar.blank);
X if (lines > 0)
X VioScrollUp(urow, lcol, lrow, rcol, lines, (PBYTE)&ch, 0);
X else
X if (lines < 0)
X VioScrollDn(urow, lcol, lrow, rcol, lines, (PBYTE)&ch, 0);
X else
X/* this clears the whole screen */
X VioScrollUp(0, 0, -1, -1, -1, (PBYTE)&ch, 0);
X#endif
X}
END_OF_FILE
if test 2928 -ne `wc -c <'private/_scroll.c'`; then
echo shar: \"'private/_scroll.c'\" unpacked with wrong size!
fi
# end of 'private/_scroll.c'
fi
if test -f 'private/_scropen.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_scropen.c'\"
else
echo shar: Extracting \"'private/_scropen.c'\" \(2851 characters\)
sed "s/^X//" >'private/_scropen.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__scropen = "$Header: c:/curses/private/RCS/_scropen.c%v 2.0 1992/11/15 03:24:35 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_scr_open() - Internal low-level binding to open the physical screen
X
X PDCurses Description:
X This function provides a low-level binding for the Flexos
X platform which must open the screen before writing to it.
X
X This function is provided in order to access the FlexOS 16 bit
X character set for input rather than the limited input
X character set associated with the VT52.
X
X PDCurses Return Value:
X This function returns OK on success, otherwise an ERR is returned.
X
X PDCurses Errors:
X The DOS platform will never fail. The Flexos platform may fail
X depending on the ability to open the current virtual console in
X 8 (as opposed to 16) bit mode.
X
X Portability:
X PDCurses int PDC_scr_open( SCREEN* internal, bool echo );
X
X**man-end**********************************************************************/
X
Xint PDC_scr_open(SCREEN *internal, bool echo)
X{
X#ifdef FLEXOS
X retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X if (retcode < 0L)
X return( ERR );
X
X kbmode = vir.vc_kbmode;
X cmode = vir.vc_mode;
X vir.vc_mode = 0;
X
X if (!echo) vir.vc_kbmode |= VCKM_NECHO;
X else vir.vc_kbmode &= ~VCKM_NECHO;
X
X smode = vir.vc_smode;
X retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X if (retcode < 0L)
X return( ERR );
X
X if (vir.vc_type & 0x03) internal->mono = TRUE;
X else internal->mono = FALSE;
X
X internal->orig_attr = vir.vc_flcolor | vir.vc_blcolor;
X _flexos_16bitmode();
X#endif
X
X#ifdef DOS
X char far *INFO = (char far *) 0x0487L;
X
X internal->orig_attr = 0;
X internal->orig_emulation = *INFO;
X#endif
X#ifdef OS2
X internal->orig_attr = 0;
X internal->orig_emulation = 0;
X#endif
X
X PDC_get_cursor_pos(&internal->cursrow, &internal->curscol);
X internal->autocr = TRUE; /* lf -> crlf by default */
X internal->raw_out = FALSE; /* tty I/O modes */
X internal->raw_inp = FALSE; /* tty I/O modes */
X internal->cbreak = FALSE;
X internal->echo = echo;
X internal->refrbrk = FALSE; /* no premature end of refresh*/
X#if !defined OS2
X internal->video_seg = 0xb000; /* Base screen segment addr */
X internal->video_ofs = 0x0; /* Base screen segment ofs */
X#endif
X internal->video_page = 0; /* Current Video Page */
X internal->direct_video = TRUE; /* Assume that we can */
X internal->visible_cursor= TRUE; /* Assume that it is visible */
X internal->cursor = PDC_get_cursor_mode();
X internal->adapter = PDC_query_adapter_type();
X internal->font = PDC_get_font();
X internal->scrnmode = PDC_get_scrn_mode();
X internal->lines = PDC_get_rows();
X internal->cols = PDC_get_columns();
X internal->audible = TRUE;
X return( OK );
X}
END_OF_FILE
if test 2851 -ne `wc -c <'private/_scropen.c'`; then
echo shar: \"'private/_scropen.c'\" unpacked with wrong size!
fi
# end of 'private/_scropen.c'
fi
if test -f 'private/_setfont.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_setfont.c'\"
else
echo shar: Extracting \"'private/_setfont.c'\" \(2836 characters\)
sed "s/^X//" >'private/_setfont.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__setfont = "$Header: c:/curses/private/RCS/_setfont.c%v 2.0 1992/11/15 03:24:36 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_set_font() - sets the current font size
X
X PDCurses Description:
X This is a private PDCurses function.
X
X This routine sets the current font size, if the adapter allows
X such a change.
X
X PDCurses Return Value:
X This function returns OK upon success otherwise ERR is returned.
X
X PDCurses Errors:
X It is an error to attempt to change the font size on a "bogus"
X adapter. The reason for this is that we have a known video
X adapter identity problem. e.g. Two adapters report the same
X identifying characteristics.
X
X It is also an error to attempt to change the size of the Flexos
X console (as there is currently no support for that).
X
X Portability:
X PDCurses int PDC_set_font( int size );
X
X**man-end**********************************************************************/
X
Xint PDC_set_font(int size)
X{
X#ifdef FLEXOS
X return( ERR );
X#endif
X#ifdef DOS
X if (_cursvar.bogus_adapter)
X return( ERR );
X
X switch (_cursvar.adapter)
X {
X case _CGA:
X case _MDA:
X case _MCGACOLOR:
X case _MCGAMONO:
X case _MDS_GENIUS:
X break;
X
X case _EGACOLOR:
X case _EGAMONO:
X if (_cursvar.sizeable && (_cursvar.font != size))
X {
X switch (size)
X {
X case _FONT8:
X regs.h.ah = 0x11;
X regs.h.al = 0x12;
X regs.h.bl = 0x00;
X int86(0x10, ®s, ®s);
X break;
X case _FONT14:
X regs.h.ah = 0x11;
X regs.h.al = 0x11;
X regs.h.bl = 0x00;
X int86(0x10, ®s, ®s);
X break;
X default:
X break;
X }
X }
X break;
X
X case _VGACOLOR:
X case _VGAMONO:
X if (_cursvar.sizeable && (_cursvar.font != size))
X {
X switch (size)
X {
X case _FONT8:
X regs.h.ah = 0x11;
X regs.h.al = 0x12;
X regs.h.bl = 0x00;
X int86(0x10, ®s, ®s);
X break;
X case _FONT14:
X regs.h.ah = 0x11;
X regs.h.al = 0x11;
X regs.h.bl = 0x00;
X int86(0x10, ®s, ®s);
X break;
X case _FONT16:
X regs.h.ah = 0x11;
X regs.h.al = 0x14;
X regs.h.bl = 0x00;
X int86(0x10, ®s, ®s);
X break;
X default:
X break;
X }
X }
X break;
X default:
X break;
X }
X if (_cursvar.visible_cursor)
X curson();
X else
X cursoff();
X _cursvar.font = PDC_get_font();
X return( OK );
X#endif
X#ifdef OS2
X VIOMODEINFO modeInfo;
X if (_cursvar.sizeable && (_cursvar.font != size))
X {
X modeInfo.cb = sizeof(modeInfo);
X /* set most parameters of modeInfo */
X VioGetMode(&modeInfo, 0);
X modeInfo.cb = 8; /* ignore horiz an vert resolution */
X modeInfo.row = modeInfo.vres / size;
X VioSetMode(&modeInfo, 0);
X }
X if (_cursvar.visible_cursor)
X curson();
X else
X cursoff();
X _cursvar.font = PDC_get_font();
X return( OK );
X#endif
X}
END_OF_FILE
if test 2836 -ne `wc -c <'private/_setfont.c'`; then
echo shar: \"'private/_setfont.c'\" unpacked with wrong size!
fi
# end of 'private/_setfont.c'
fi
echo shar: End of archive 6 \(of 11\).
cp /dev/null ark6isdone
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: portable/endwin.c portable/mvscanw.c portable/printw.c
# portable/resetty.c portable/scanw.c portable/standend.c
# portable/standout.c portable/typeahea.c portable/wattroff.c
# portable/wattron.c portable/wattrset.c portable/wdelch.c
# portable/wprintw.c portable/wscanw.c portable/wstanden.c
# portable/wstandou.c private/_backchr.c private/_cattr.c
# private/_sanity.c private/_scb.c tools/buildlrf.c
# Wrapped by kent@sparky on Wed Nov 18 21:44:08 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 7 (of 11)."'
if test -f 'portable/endwin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/endwin.c'\"
else
echo shar: Extracting \"'portable/endwin.c'\" \(2189 characters\)
sed "s/^X//" >'portable/endwin.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef endwin
X
X#ifndef NDEBUG
Xchar *rcsid_endwin = "$Header: c:/curses/portable/RCS/endwin.c%v 2.0 1992/11/15 03:28:46 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X endwin() - restore initial terminal environment
X
X X/Open Description:
X A program should always call endwin() before exiting or
X escaping from curses mode temporarily. This routine will
X restore tty modes, move the cursor to the lower left corner
X of the screen and reset the terminal into the proper non-visual
X mode. To resume curses after a temporary escape, refresh() or
X doupdate() should be called.
X
X PDCurses Description:
X At this time, endwin() must be followed by a call to initscr()
X for temporary escapes.
X
X In addition, endwin() will resize the screen, if necessary.
X
X X/Open Return Value:
X The endwin() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int endwin( void );
X X/Open Dec '88 int endwin( void );
X BSD Curses
X SYS V Curses
X
X**man-end**********************************************************************/
X
Xint endwin(void)
X{
X PDC_scr_close();
X/* resetty();*/
X if (_cursvar.orig_font != _cursvar.font) /* screen has not been resized */
X {
X PDC_set_font(_cursvar.orig_font);
X resize(PDC_get_rows());
X }
X
X _cursvar.visible_cursor = FALSE; /* Force the visible cursor */
X _cursvar.cursor = _cursvar.orig_cursor;
X curson();
X#if 0
X _cursvar.blank = ' '; /* Reset blank char to a space */
X wmove(stdscr, 0, 0); /* Ensure full window clear */
X wclrtobot(stdscr);
X wrefresh(stdscr);
X#endif
X
X delwin(stdscr);
X delwin(curscr);
X delwin(tmpwin);
X stdscr = (WINDOW *)NULL;
X curscr = (WINDOW *)NULL;
X tmpwin = (WINDOW *)NULL;
X _cursvar.alive = FALSE;
X
X /*
X * Position cursor so that the screen will not scroll until they hit
X * a carriage return.
X */
X PDC_gotoxy(PDC_get_rows() - 2, 0);
X#ifdef FLEXOS
X _flexos_8bitmode();
X#endif
X/* PDC_fix_cursor(_cursvar.orig_emulation);*/
X if (_cursvar.orig_font != _cursvar.font) /* screen has not been resized */
X reset_shell_mode();
X return( OK );
X}
END_OF_FILE
if test 2189 -ne `wc -c <'portable/endwin.c'`; then
echo shar: \"'portable/endwin.c'\" unpacked with wrong size!
fi
# end of 'portable/endwin.c'
fi
if test -f 'portable/mvscanw.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/mvscanw.c'\"
else
echo shar: Extracting \"'portable/mvscanw.c'\" \(2287 characters\)
sed "s/^X//" >'portable/mvscanw.c' <<'END_OF_FILE'
X#include <stdarg.h>
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef mvscanw
X
X#ifndef NDEBUG
Xchar *rcsid_mvscanw = "$Header: c:/curses/portable/RCS/mvscanw.c%v 2.0 1992/11/15 03:29:01 MH Rel $";
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X mvscanw() - read formatted from window
X
X X/Open Description:
X These routines correspond to scanf. The function scanw reads
X input from the default window. The function wscanw reads
X input from the specified window. The function mvscanw moves
X the cursor to the specified position and then reads input from
X the default window. The function mvwscanw moves the cursor to
X the specified position and then reads input from the specified
X window.
X
X For all the functions, the routine wgetstr is called to get a
X string from the window, and the resulting line is used as
X input for the scan. All character interpretation is carried
X out according to the scanf function rules.
X
X PDCurses Description:
X The old Bjorn Larssen code for the 68K platform has been removed
X from this module.
X
X X/Open Return Value:
X Upon successful completion, the scanw, mvscanw, mvwscanw and
X wscanw functions return the number of items successfully
X matched. On end-of-file, they return EOF. Otherwise they
X return ERR.
X
X PDCurses Errors:
X No errors.
X
X Portability:
X PDCurses int mvscanw( int y, int x, char *fmt, ...);
X X/Open Dec '88 int mvscanw( int y, int x, char *fmt, ...);
X BSD Curses int mvscanw( int y, int x, char *fmt, ...);
X SYS V Curses int mvscanw( int y, int x, char *fmt, ...);
X
X**man-end**********************************************************************/
X
Xint mvscanw(int y, int x, char *fmt, ... )
X{
X va_list args;
X int retval = ERR;
X
X#if !defined (HC)
X if (stdscr == (WINDOW *)NULL)
X return( retval );
X
X if (wmove(stdscr, y, x) == ERR)
X return( retval );
X
X wrefresh(stdscr); /* set cursor position */
X
X /*
X * get string
X */
X c_printscanbuf[0] = '\0'; /* reset to empty string */
X if (wgetstr(stdscr, c_printscanbuf) == ERR)
X return( retval );
X va_start(args, fmt);
X#ifdef NO_VSSCANF
X retval = PDC_vsscanf(c_printscanbuf, fmt, args);
X#else
X retval = vsscanf(c_printscanbuf, fmt, args);
X#endif
X va_end(args);
X#endif
X return( retval );
X}
END_OF_FILE
if test 2287 -ne `wc -c <'portable/mvscanw.c'`; then
echo shar: \"'portable/mvscanw.c'\" unpacked with wrong size!
fi
# end of 'portable/mvscanw.c'
fi
if test -f 'portable/printw.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/printw.c'\"
else
echo shar: Extracting \"'portable/printw.c'\" \(2217 characters\)
sed "s/^X//" >'portable/printw.c' <<'END_OF_FILE'
X#include <stdarg.h>
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef printw
X
X#ifndef NDEBUG
Xchar *rcsid_printw = "$Header: c:/curses/portable/RCS/printw.c%v 2.0 1992/11/15 03:29:33 MH Rel $";
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X printw() - formatted write to a window
X
X X/Open Description:
X The printw routine adds a string to the default window
X starting at the current cursor position. This routine causes
X the string that would normally be output by printf to be
X output by addstr.
X
X The routine wprintw adds a string to the specified window
X starting at the current cursor position. This routine causes
X the string that would normally be output by printf to be
X output by waddstr.
X
X The routine mvprintw adds a string to the default window
X starting at the specified cursor position. This routine
X causes the string that would normally be output by printf to
X be output by addstr.
X
X The routine mvwprintw adds a string to the specified window
X starting at the specified cursor position. This routine
X causes the string that would normally be output by printf to
X be output by waddstr.
X
X All these routines are analogous to printf. It is advisable
X to use the field width options of printf to avoid leaving
X unwanted characters on the screen from earlier calls.
X
X PDCurses Description:
X The old Bjorn Larssen code for the 68K platform has been removed
X from this module.
X
X X/Open Return Value:
X The printw() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int printw( char *fmt, ... );
X X/Open Dec '88 int printw( char *fmt, ... );
X BSD Curses int printw( char *fmt, ... );
X SYS V Curses int printw( char *fmt, ... );
X
X**man-end**********************************************************************/
X
Xint printw(char *fmt,...)
X{
X int retval = ERR;
X va_list args;
X
X if (stdscr == (WINDOW *)NULL)
X return (retval);
X
X va_start(args, fmt);
X vsprintf(c_printscanbuf, fmt, args);
X va_end(args);
X if (waddstr(stdscr, c_printscanbuf) == ERR)
X return (retval);
X retval = (strlen(c_printscanbuf));
X return (retval);
X}
END_OF_FILE
if test 2217 -ne `wc -c <'portable/printw.c'`; then
echo shar: \"'portable/printw.c'\" unpacked with wrong size!
fi
# end of 'portable/printw.c'
fi
if test -f 'portable/resetty.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/resetty.c'\"
else
echo shar: Extracting \"'portable/resetty.c'\" \(2058 characters\)
sed "s/^X//" >'portable/resetty.c' <<'END_OF_FILE'
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef resetty
X
X#ifndef NDEBUG
Xchar *rcsid_resetty = "$Header: c:/curses/portable/RCS/resetty.c%v 2.0 1992/11/15 03:29:10 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X resetty() - save/restore terminal modes
X
X X/Open Description:
X These routines save and restore the state of the terminal modes.
X The savetty() function saves the current state in a buffer and
X resetty() restores the state to what it was at the last call to
X savetty().
X
X PDCurses Description:
X FYI: It is very unclear whether this is a duplication of the
X reset_prog_mode() and reset_shell_mode() functions or whether
X this is a backing store type of operation. At this time, they
X are implemented similar to the reset_*_mode() routines.
X
X X/Open Return Value:
X The resetty() function returns OK upon success otherwise ERR is
X returned.
X
X Portability:
X PDCurses int resetty( void );
X X/Open Dec '88 int resetty( void );
X SysV Curses int resetty( void );
X BSD Curses int resetty( void );
X
X**man-end**********************************************************************/
X
Xint resetty(void)
X{
X if (c_save_tty.been_set == TRUE)
X {
X#if defined(DOS) || defined(OS2)
X# if SMALL || MEDIUM
X movedata( FP_SEG(&c_save_tty.saved), FP_OFF(&c_save_tty.saved),
X FP_SEG(&_cursvar), FP_OFF(&_cursvar),
X sizeof(SCREEN) );
X# else
X memcpy(&_cursvar, &c_save_tty.saved, sizeof(SCREEN));
X# endif
X#endif
X
X mvcur(0, 0, c_save_tty.saved.cursrow, c_save_tty.saved.curscol);
X if (PDC_get_ctrl_break() != c_save_tty.saved.orgcbr)
X PDC_set_ctrl_break(c_save_tty.saved.orgcbr);
X if (c_save_tty.saved.raw_out)
X raw();
X if (c_save_tty.saved.visible_cursor)
X curson();
X _cursvar.font = PDC_get_font();
X PDC_set_font(c_save_tty.saved.font);
X if (!PDC_scrn_modes_equal (PDC_get_scrn_mode(), c_save_tty.saved.scrnmode))
X PDC_set_scrn_mode(c_save_tty.saved.scrnmode);
X
X PDC_set_rows(c_save_tty.saved.lines);
X }
X return( c_save_tty.been_set ? OK : ERR );
X}
END_OF_FILE
if test 2058 -ne `wc -c <'portable/resetty.c'`; then
echo shar: \"'portable/resetty.c'\" unpacked with wrong size!
fi
# end of 'portable/resetty.c'
fi
if test -f 'portable/scanw.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/scanw.c'\"
else
echo shar: Extracting \"'portable/scanw.c'\" \(2142 characters\)
sed "s/^X//" >'portable/scanw.c' <<'END_OF_FILE'
X#include <stdarg.h>
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef scanw
X
X#ifndef NDEBUG
Xchar *rcsid_scanw = "$Header: c:/curses/portable/RCS/scanw.c%v 2.0 1992/11/15 03:29:02 MH Rel $";
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X scanw() - read formatted from window
X
X X/Open Description:
X These routines correspond to scanf. The function scanw reads
X input from the default window. The function wscanw reads
X input from the specified window. The function mvscanw moves
X the cursor to the specified position and then reads input from
X the default window. The function mvwscanw moves the cursor to
X the specified position and then reads input from the specified
X window.
X
X For all the functions, the routine wgetstr is called to get a
X string from the window, and the resulting line is used as
X input for the scan. All character interpretation is carried
X out according to the scanf function rules.
X
X PDCurses Description:
X The old Bjorn Larssen code for the 68K platform has been removed
X from this module.
X
X X/Open Return Value:
X Upon successful completion, the scanw, mvscanw, mvwscanw and
X wscanw functions return the number of items successfully
X matched. On end-of-file, they return EOF. Otherwise they
X return ERR.
X
X PDCurses Errors:
X No errors.
X
X Portability:
X PDCurses int scanw( char *fmt, ...);
X X/Open Dec '88 int scanw( char *fmt, ...);
X BSD Curses int scanw( char *fmt, ...);
X SYS V Curses int scanw( char *fmt, ...);
X
X**man-end**********************************************************************/
X
Xint scanw(char *fmt, ...)
X{
X va_list args;
X int retval = ERR;
X
X#if !defined (HC)
X if (stdscr == (WINDOW *)NULL)
X return( retval );
X
X wrefresh(stdscr); /* set cursor position */
X
X /*
X * get string
X */
X c_printscanbuf[0] = '\0'; /* reset to empty string */
X if (wgetstr(stdscr, c_printscanbuf) == ERR)
X return( retval );
X va_start(args, fmt);
X#ifdef NO_VSSCANF
X retval = PDC_vsscanf(c_printscanbuf, fmt, args);
X#else
X retval = vsscanf(c_printscanbuf, fmt, args);
X#endif
X va_end(args);
X#endif
X return( retval );
X}
END_OF_FILE
if test 2142 -ne `wc -c <'portable/scanw.c'`; then
echo shar: \"'portable/scanw.c'\" unpacked with wrong size!
fi
# end of 'portable/scanw.c'
fi
if test -f 'portable/standend.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/standend.c'\"
else
echo shar: Extracting \"'portable/standend.c'\" \(2091 characters\)
sed "s/^X//" >'portable/standend.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef standend
X
X#ifndef NDEBUG
Xchar *rcsid_standend = "$Header: c:/curses/portable/RCS/standend.c%v 2.0 1992/11/15 03:29:16 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X standend() - attribute manipulation
X
X X/Open Description:
X These functions manipulate the current attributes of the named
X window. These attributes can be any combination of A_STANDOUT,
X A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
X
X These constants are defined in <curses.h> and can be combined
X with the bitwise-OR operator (|).
X
X The current attributes of a window are applied to all characters
X that are written into the window with waddch(). Attributes are
X a property of the character, and move with the character
X through any scrolling and insert/delete line/character operations.
X To the extent possible on the particular terminal, they will be
X displayed as the graphic rendition of characters put on the
X screen.
X
X The attrset() function sets the current attributes of the given
X window to attrs. The attroff() function turns off the named
X attributes without turning on or off any other attributes. The
X attron() function turs on the named attriutes without affecting
X any others. The standout function is the same as
X attron( A_STANDOUT ). The standend() function is the same as
X attrset( 0 ); that is it turns off all attributes.
X
X NOTE: attroff(), attron() and attrset() are macros.
X
X PDCurses Description:
X System V compatible color support is included.
X See <curses.h> for further details.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int standend( void );
X X/Open Dec '88 int standend( void );
X BSD Curses int standend( void );
X SYS V Curses int standend( void );
X
X**man-end**********************************************************************/
X
Xint standend(void)
X{
X return( wattrset( stdscr, A_NORMAL ) );
X}
END_OF_FILE
if test 2091 -ne `wc -c <'portable/standend.c'`; then
echo shar: \"'portable/standend.c'\" unpacked with wrong size!
fi
# end of 'portable/standend.c'
fi
if test -f 'portable/standout.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/standout.c'\"
else
echo shar: Extracting \"'portable/standout.c'\" \(2093 characters\)
sed "s/^X//" >'portable/standout.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef standout
X
X#ifndef NDEBUG
Xchar *rcsid_standout = "$Header: c:/curses/portable/RCS/standout.c%v 2.0 1992/11/15 03:29:16 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X standout() - attribute manipulation
X
X X/Open Description:
X These functions manipulate the current attributes of the named
X window. These attributes can be any combination of A_STANDOUT,
X A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
X
X These constants are defined in <curses.h> and can be combined
X with the bitwise-OR operator (|).
X
X The current attributes of a window are applied to all characters
X that are written into the window with waddch(). Attributes are
X a property of the character, and move with the character
X through any scrolling and insert/delete line/character operations.
X To the extent possible on the particular terminal, they will be
X displayed as the graphic rendition of characters put on the
X screen.
X
X The attrset() function sets the current attributes of the given
X window to attrs. The attroff() function turns off the named
X attributes without turning on or off any other attributes. The
X attron() function turs on the named attriutes without affecting
X any others. The standout function is the same as
X attron( A_STANDOUT ). The standend() function is the same as
X attrset( 0 ); that is it turns off all attributes.
X
X NOTE: attroff(), attron() and attrset() are macros.
X
X PDCurses Description:
X System V compatible color support is included.
X See <curses.h> for further details.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int standout( void );
X X/Open Dec '88 int standout( void );
X BSD Curses int standout( void );
X SYS V Curses int standout( void );
X
X**man-end**********************************************************************/
X
Xint standout(void)
X{
X return( wattrset( stdscr, A_STANDOUT ) );
X}
END_OF_FILE
if test 2093 -ne `wc -c <'portable/standout.c'`; then
echo shar: \"'portable/standout.c'\" unpacked with wrong size!
fi
# end of 'portable/standout.c'
fi
if test -f 'portable/typeahea.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/typeahea.c'\"
else
echo shar: Extracting \"'portable/typeahea.c'\" \(2127 characters\)
sed "s/^X//" >'portable/typeahea.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef typeahead
X
X#ifndef NDEBUG
Xchar *rcsid_typeahea = "$Header: c:/curses/portable/RCS/typeahea.c%v 2.0 1992/11/15 03:29:19 MH Rel $";
X#endif
X
Xextern short c_pindex; /* putter index */
Xextern short c_gindex; /* getter index */
Xextern short c_ungind; /* wungetch() push index */
Xextern chtype c_ungch[NUNGETCH]; /* array of ungotten chars */
Xextern WINDOW* _getch_win_;
X
X/*man-start*********************************************************************
X
X typeahead() - check for type-ahead
X
X X/Open Description:
X The curses package does the "line-breakout optimisation" by
X looking for type-ahead periodically while updating the screen.
X If input is found, the current update will be postponed until
X refresh() or doupdate() are called again. This allows faster
X response to commands typed in advance. Normally, the input FILE
X pointer passed to newterm(), or stdin in the case when initscr()
X was called, will be used to do this type-ahead checking. The
X typeahead() routine specified that the file descriptor fd is to
X be used to check for type-ahead instead. If fd is -1, then no
X type-ahead checking will be done.
X
X PDCurses Description:
X Some early versions of the library (1.5beta) may have had an
X improper interface declaration. e.g. bool typeahead( void );
X rather than the X/Open specified bool typeahead( FILE* fd );.
X
X FYI: Under PDCurses, the passed file handle fd is ignored.
X
X X/Open Return Value:
X The typeahead() routine returns TRUE if keyboard input is pending
X otherwise FALSE is returned.
X
X Portability:
X PDCurses bool typeahead( FILE* fd );
X SysV Curses
X BSD Curses
X X/Open Dec '88 bool typeahead( FILE* fd );
X
X**man-end**********************************************************************/
X
Xbool typeahead( FILE* fd )
X{
X#ifdef TC
X# pragma argsused
X#endif
X if (c_ungind)
X return (TRUE); /* ungotten char */
X if (c_pindex > c_gindex)
X return (TRUE); /* buffered char */
X if (_cursvar.raw_inp)
X return((bool)PDC_check_bios_key());/* raw mode test */
X
X return((bool)PDC_check_bios_key()); /* normal mode test */
X}
END_OF_FILE
if test 2127 -ne `wc -c <'portable/typeahea.c'`; then
echo shar: \"'portable/typeahea.c'\" unpacked with wrong size!
fi
# end of 'portable/typeahea.c'
fi
if test -f 'portable/wattroff.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wattroff.c'\"
else
echo shar: Extracting \"'portable/wattroff.c'\" \(2243 characters\)
sed "s/^X//" >'portable/wattroff.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wattroff
X
X#ifndef NDEBUG
Xchar *rcsid_wattroff = "$Header: c:/curses/portable/RCS/wattroff.c%v 2.0 1992/11/15 03:29:21 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wattroff() - attribute manipulation
X
X X/Open Description:
X These functions manipulate the current attributes of the named
X window. These attributes can be any combination of A_STANDOUT,
X A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
X
X These constants are defined in <curses.h> and can be combined
X with the bitwise-OR operator (|).
X
X The current attributes of a window are applied to all characters
X that are written into the window with waddch(). Attributes are
X a property of the character, and move with the character
X through any scrolling and insert/delete line/character operations.
X To the extent possible on the particular terminal, they will be
X displayed as the graphic rendition of characters put on the
X screen.
X
X The attrset() function sets the current attributes of the given
X window to attrs. The attroff() function turns off the named
X attributes without turning on or off any other attributes. The
X attron() function turs on the named attriutes without affecting
X any others. The standout function is the same as
X attron( A_STANDOUT ). The standend() function is the same as
X attrset( 0 ); that is it turns off all attributes.
X
X NOTE: attroff(), attron() and attrset() are macros.
X
X PDCurses Description:
X System V compatible color support is included.
X See <curses.h> for further details.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wattroff( WINDOW* win, int attrs );
X X/Open Dec '88 int wattroff( WINDOW* win, int attrs );
X BSD Curses int wattroff( WINDOW* win, int attrs );
X SYS V Curses int wattroff( WINDOW* win, int attrs );
X
X**man-end**********************************************************************/
X
Xint wattroff(WINDOW *win, int attrs)
X{
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X win->_attrs &= (~attrs & A_ATTRIBUTES);
X return( OK );
X}
END_OF_FILE
if test 2243 -ne `wc -c <'portable/wattroff.c'`; then
echo shar: \"'portable/wattroff.c'\" unpacked with wrong size!
fi
# end of 'portable/wattroff.c'
fi
if test -f 'portable/wattron.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wattron.c'\"
else
echo shar: Extracting \"'portable/wattron.c'\" \(2232 characters\)
sed "s/^X//" >'portable/wattron.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wattron
X
X#ifndef NDEBUG
Xchar *rcsid_wattron = "$Header: c:/curses/portable/RCS/wattron.c%v 2.0 1992/11/15 03:29:22 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wattron() - attribute manipulation
X
X X/Open Description:
X These functions manipulate the current attributes of the named
X window. These attributes can be any combination of A_STANDOUT,
X A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
X
X These constants are defined in <curses.h> and can be combined
X with the bitwise-OR operator (|).
X
X The current attributes of a window are applied to all characters
X that are written into the window with waddch(). Attributes are
X a property of the character, and move with the character
X through any scrolling and insert/delete line/character operations.
X To the extent possible on the particular terminal, they will be
X displayed as the graphic rendition of characters put on the
X screen.
X
X The attrset() function sets the current attributes of the given
X window to attrs. The attroff() function turns off the named
X attributes without turning on or off any other attributes. The
X attron() function turs on the named attriutes without affecting
X any others. The standout function is the same as
X attron( A_STANDOUT ). The standend() function is the same as
X attrset( 0 ); that is it turns off all attributes.
X
X NOTE: attroff(), attron() and attrset() are macros.
X
X PDCurses Description:
X System V compatible color support is included.
X See <curses.h> for further details.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wattron( WINDOW* win, int attrs );
X X/Open Dec '88 int wattron( WINDOW* win, int attrs );
X BSD Curses int wattron( WINDOW* win, int attrs );
X SYS V Curses int wattron( WINDOW* win, int attrs );
X
X**man-end**********************************************************************/
X
Xint wattron(WINDOW *win, int attrs)
X{
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X win->_attrs |= (attrs & A_ATTRIBUTES);
X return( OK );
X}
END_OF_FILE
if test 2232 -ne `wc -c <'portable/wattron.c'`; then
echo shar: \"'portable/wattron.c'\" unpacked with wrong size!
fi
# end of 'portable/wattron.c'
fi
if test -f 'portable/wattrset.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wattrset.c'\"
else
echo shar: Extracting \"'portable/wattrset.c'\" \(2238 characters\)
sed "s/^X//" >'portable/wattrset.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wattrset
X
X#ifndef NDEBUG
Xchar *rcsid_wattrset = "$Header: c:/curses/portable/RCS/wattrset.c%v 2.0 1992/11/15 03:29:23 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wattrset() - attribute manipulation
X
X X/Open Description:
X These functions manipulate the current attributes of the named
X window. These attributes can be any combination of A_STANDOUT,
X A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
X
X These constants are defined in <curses.h> and can be combined
X with the bitwise-OR operator (|).
X
X The current attributes of a window are applied to all characters
X that are written into the window with waddch(). Attributes are
X a property of the character, and move with the character
X through any scrolling and insert/delete line/character operations.
X To the extent possible on the particular terminal, they will be
X displayed as the graphic rendition of characters put on the
X screen.
X
X The attrset() function sets the current attributes of the given
X window to attrs. The attroff() function turns off the named
X attributes without turning on or off any other attributes. The
X attron() function turs on the named attriutes without affecting
X any others. The standout function is the same as
X attron( A_STANDOUT ). The standend() function is the same as
X attrset( 0 ); that is it turns off all attributes.
X
X NOTE: attroff(), attron() and attrset() are macros.
X
X PDCurses Description:
X System V compatible color support is included.
X See <curses.h> for further details.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wattrset( WINDOW* win, int attrs );
X X/Open Dec '88 int wattrset( WINDOW* win, int attrs );
X BSD Curses int wattrset( WINDOW* win, int attrs );
X SYS V Curses int wattrset( WINDOW* win, int attrs );
X
X**man-end**********************************************************************/
X
Xint wattrset(WINDOW *win, int attrs)
X{
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X win->_attrs = attrs & A_ATTRIBUTES;
X return( OK );
X}
END_OF_FILE
if test 2238 -ne `wc -c <'portable/wattrset.c'`; then
echo shar: \"'portable/wattrset.c'\" unpacked with wrong size!
fi
# end of 'portable/wattrset.c'
fi
if test -f 'portable/wdelch.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wdelch.c'\"
else
echo shar: Extracting \"'portable/wdelch.c'\" \(2110 characters\)
sed "s/^X//" >'portable/wdelch.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wdelch
X
X#ifndef NDEBUG
Xchar *rcsid_wdelch = "$Header: c:/curses/portable/RCS/wdelch.c%v 2.0 1992/11/15 03:29:23 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wdelch() - remove character from window
X
X X/Open Description:
X The character under the cursor in the window is deleted. All
X characters to the right on the same line are moved to the left
X one position and the last character on the line is filled with
X a blank. The cursor position does not change (after moving to
X y, x if coordinates are specified).
X
X NOTE: delch(), mvdelch(), and mvwdelch() are macros.
X
X PDCurses Description:
X Nothing additional.
X
X X/Open Return Value:
X The wdelch() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int wdelch( WINDOW* win );
X X/Open Dec '88 int wdelch( WINDOW* win );
X BSD Curses int wdelch( WINDOW* win );
X SYS V Curses int wdelch( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint wdelch(WINDOW *win)
X{
X int y;
X int x;
X int maxx;
X chtype* temp1;
Xregister chtype* dstp;
Xregister chtype* srcp;
X
X if (win == (WINDOW *)NULL)
X return (ERR);
X
X y = win->_cury;
X x = win->_curx;
X maxx = win->_maxx - 1;
X temp1 = &win->_y[y][x];
X
X#if defined(DOS) || defined(OS2)
X# if SMALL || MEDIUM
X/* srcp = temp1 + sizeof(chtype); */
X srcp = temp1 + 1;
X dstp = temp1;
X movedata(FP_SEG(srcp), FP_OFF(srcp),
X FP_SEG(dstp), FP_OFF(dstp),
X (maxx - x) * sizeof(chtype));
X# else
X /* Changed from memcpy to memmove. Should work with
X * TC and MSC.
X * -- MH 920605
X */
X/* memmove( temp1, temp1 + sizeof(chtype), (maxx - x) * sizeof(chtype) );*/
X memmove( temp1, temp1 + 1, (maxx - x) * sizeof(chtype) );
X# endif
X#endif
X
X win->_y[y][maxx] = win->_blank | win->_attrs;
X win->_lastch[y] = maxx;
X
X if ((win->_firstch[y] == _NO_CHANGE) ||
X (win->_firstch[y] > x))
X {
X win->_firstch[y] = x;
X }
X return (OK);
X}
END_OF_FILE
if test 2110 -ne `wc -c <'portable/wdelch.c'`; then
echo shar: \"'portable/wdelch.c'\" unpacked with wrong size!
fi
# end of 'portable/wdelch.c'
fi
if test -f 'portable/wprintw.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wprintw.c'\"
else
echo shar: Extracting \"'portable/wprintw.c'\" \(2286 characters\)
sed "s/^X//" >'portable/wprintw.c' <<'END_OF_FILE'
X#include <stdarg.h>
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wprintw
X
X#ifndef NDEBUG
Xchar *rcsid_wprintw = "$Header: c:/curses/portable/RCS/wprintw.c%v 2.0 1992/11/15 03:29:33 MH Rel $";
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X wprintw() - formatted write to a window
X
X X/Open Description:
X The printw routine adds a string to the default window
X starting at the current cursor position. This routine causes
X the string that would normally be output by printf to be
X output by addstr.
X
X The routine wprintw adds a string to the specified window
X starting at the current cursor position. This routine causes
X the string that would normally be output by printf to be
X output by waddstr.
X
X The routine mvprintw adds a string to the default window
X starting at the specified cursor position. This routine
X causes the string that would normally be output by printf to
X be output by addstr.
X
X The routine mvwprintw adds a string to the specified window
X starting at the specified cursor position. This routine
X causes the string that would normally be output by printf to
X be output by waddstr.
X
X All these routines are analogous to printf. It is advisable
X to use the field width options of printf to avoid leaving
X unwanted characters on the screen from earlier calls.
X
X PDCurses Description:
X The old Bjorn Larssen code for the 68K platform has been removed
X from this module.
X
X X/Open Return Value:
X The printw() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int wprintw( WINDOW* win, char *fmt, ... );
X X/Open Dec '88 int wprintw( WINDOW* win, char *fmt, ... );
X BSD Curses int wprintw( WINDOW* win, char *fmt, ... );
X SYS V Curses int wprintw( WINDOW* win, char *fmt, ... );
X
X**man-end**********************************************************************/
X
Xint wprintw(WINDOW * win, char *fmt,...)
X{
X int retval = ERR;
X va_list args;
X
X if (win == (WINDOW *)NULL)
X return (retval);
X
X va_start(args, fmt);
X vsprintf(c_printscanbuf, fmt, args);
X va_end(args);
X if (waddstr(win, c_printscanbuf) == ERR)
X return (retval);
X retval = (strlen(c_printscanbuf));
X return (retval);
X}
END_OF_FILE
if test 2286 -ne `wc -c <'portable/wprintw.c'`; then
echo shar: \"'portable/wprintw.c'\" unpacked with wrong size!
fi
# end of 'portable/wprintw.c'
fi
if test -f 'portable/wscanw.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wscanw.c'\"
else
echo shar: Extracting \"'portable/wscanw.c'\" \(2192 characters\)
sed "s/^X//" >'portable/wscanw.c' <<'END_OF_FILE'
X#include <stdarg.h>
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wscanw
X
X#ifndef NDEBUG
Xchar *rcsid_wscanw = "$Header: c:/curses/portable/RCS/wscanw.c%v 2.0 1992/11/15 03:29:09 MH Rel $";
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X wscanw() - read formatted from window
X
X X/Open Description:
X These routines correspond to scanf. The function scanw reads
X input from the default window. The function wscanw reads
X input from the specified window. The function mvscanw moves
X the cursor to the specified position and then reads input from
X the default window. The function mvwscanw moves the cursor to
X the specified position and then reads input from the specified
X window.
X
X For all the functions, the routine wgetstr is called to get a
X string from the window, and the resulting line is used as
X input for the scan. All character interpretation is carried
X out according to the scanf function rules.
X
X PDCurses Description:
X The old Bjorn Larssen code for the 68K platform has been removed
X from this module.
X
X X/Open Return Value:
X Upon successful completion, the scanw, mvscanw, mvwscanw and
X wscanw functions return the number of items successfully
X matched. On end-of-file, they return EOF. Otherwise they
X return ERR.
X
X PDCurses Errors:
X No errors.
X
X Portability:
X PDCurses int wscanw( WINDOW*, char *fmt, ...);
X X/Open Dec '88 int wscanw( WINDOW*, char *fmt, ...);
X BSD Curses int wscanw( WINDOW*, char *fmt, ...);
X SYS V Curses int wscanw( WINDOW*, char *fmt, ...);
X
X**man-end**********************************************************************/
X
Xint wscanw(WINDOW * win, char *fmt, ...)
X{
X va_list args;
X int retval = ERR;
X
X#if !defined (HC)
X if (win == (WINDOW *)NULL)
X return (retval);
X
X wrefresh(win); /* set cursor position */
X
X /*
X * get string
X */
X c_printscanbuf[0] = '\0'; /* reset to empty string */
X if (wgetstr(win, c_printscanbuf) == ERR)
X return( retval );
X va_start(args, fmt);
X#ifdef NO_VSSCANF
X retval = PDC_vsscanf(c_printscanbuf, fmt, args);
X#else
X retval = vsscanf(c_printscanbuf, fmt, args);
X#endif
X va_end(args);
X#endif
X return( retval );
X}
END_OF_FILE
if test 2192 -ne `wc -c <'portable/wscanw.c'`; then
echo shar: \"'portable/wscanw.c'\" unpacked with wrong size!
fi
# end of 'portable/wscanw.c'
fi
if test -f 'portable/wstanden.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wstanden.c'\"
else
echo shar: Extracting \"'portable/wstanden.c'\" \(2132 characters\)
sed "s/^X//" >'portable/wstanden.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wstandend
X
X#ifndef NDEBUG
Xchar *rcsid_wstanden = "$Header: c:/curses/portable/RCS/wstanden.c%v 2.0 1992/11/15 03:29:30 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wstandend() - attribute manipulation
X
X X/Open Description:
X These functions manipulate the current attributes of the named
X window. These attributes can be any combination of A_STANDOUT,
X A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
X
X These constants are defined in <curses.h> and can be combined
X with the bitwise-OR operator (|).
X
X The current attributes of a window are applied to all characters
X that are written into the window with waddch(). Attributes are
X a property of the character, and move with the character
X through any scrolling and insert/delete line/character operations.
X To the extent possible on the particular terminal, they will be
X displayed as the graphic rendition of characters put on the
X screen.
X
X The attrset() function sets the current attributes of the given
X window to attrs. The attroff() function turns off the named
X attributes without turning on or off any other attributes. The
X attron() function turs on the named attriutes without affecting
X any others. The standout function is the same as
X attron( A_STANDOUT ). The standend() function is the same as
X attrset( 0 ); that is it turns off all attributes.
X
X NOTE: attroff(), attron() and attrset() are macros.
X
X PDCurses Description:
X System V compatible color support is included.
X See <curses.h> for further details.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wstandend( WINDOW* win );
X X/Open Dec '88 int wstandend( WINDOW* win );
X BSD Curses int wstandend( WINDOW* win );
X SYS V Curses int wstandend( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint wstandend( WINDOW *win )
X{
X return( wattrset( win, A_NORMAL ) );
X}
END_OF_FILE
if test 2132 -ne `wc -c <'portable/wstanden.c'`; then
echo shar: \"'portable/wstanden.c'\" unpacked with wrong size!
fi
# end of 'portable/wstanden.c'
fi
if test -f 'portable/wstandou.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wstandou.c'\"
else
echo shar: Extracting \"'portable/wstandou.c'\" \(2134 characters\)
sed "s/^X//" >'portable/wstandou.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wstandout
X
X#ifndef NDEBUG
Xchar *rcsid_wstandou = "$Header: c:/curses/portable/RCS/wstandou.c%v 2.0 1992/11/15 03:29:30 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wstandout() - attribute manipulation
X
X X/Open Description:
X These functions manipulate the current attributes of the named
X window. These attributes can be any combination of A_STANDOUT,
X A_REVERSE, A_BOLD, A_DIM, A_BLINK, A_UNDERLINE.
X
X These constants are defined in <curses.h> and can be combined
X with the bitwise-OR operator (|).
X
X The current attributes of a window are applied to all characters
X that are written into the window with waddch(). Attributes are
X a property of the character, and move with the character
X through any scrolling and insert/delete line/character operations.
X To the extent possible on the particular terminal, they will be
X displayed as the graphic rendition of characters put on the
X screen.
X
X The attrset() function sets the current attributes of the given
X window to attrs. The attroff() function turns off the named
X attributes without turning on or off any other attributes. The
X attron() function turs on the named attriutes without affecting
X any others. The standout function is the same as
X attron( A_STANDOUT ). The standend() function is the same as
X attrset( 0 ); that is it turns off all attributes.
X
X NOTE: attroff(), attron() and attrset() are macros.
X
X PDCurses Description:
X System V compatible color support is included.
X See <curses.h> for further details.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wstandout( WINDOW* win );
X X/Open Dec '88 int wstandout( WINDOW* win );
X BSD Curses int wstandout( WINDOW* win );
X SYS V Curses int wstandout( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint wstandout( WINDOW *win )
X{
X return( wattrset( win, A_STANDOUT ) );
X}
END_OF_FILE
if test 2134 -ne `wc -c <'portable/wstandou.c'`; then
echo shar: \"'portable/wstandou.c'\" unpacked with wrong size!
fi
# end of 'portable/wstandou.c'
fi
if test -f 'private/_backchr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_backchr.c'\"
else
echo shar: Extracting \"'private/_backchr.c'\" \(2083 characters\)
sed "s/^X//" >'private/_backchr.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__backchr = "$Header: c:/curses/private/RCS/_backchr.c%v 2.0 1992/11/15 03:24:15 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_backchar() - Visually erase character in window
X
X PDCurses Description:
X This is a private PDCurses function
X
X This routine will visually erase a character. It is called by
X the PDCurses character I/O routines.
X
X PDCurses Return Value:
X This routine will return OK upon success and otherwise ERR will be
X returned.
X
X PDCurses Errors:
X It is an error to pass a NULL WINDOW pointer.
X
X Portability:
X PDCurses int PDC_backchar( WINDOW* w, char* ch, int* len );
X
X**man-end**********************************************************************/
X
Xint PDC_backchar(WINDOW *w, char *ch, int *len)
X{
X int nbs = 0;
X int x = w->_curx;
X int ts = w->_tabsize;
X chtype* s = &w->_y[w->_cury][x - 1];
X char* p = c_strbeg;
X bool save_raw_out = _cursvar.raw_out;
X
X
X if (w == (WINDOW *)NULL)
X return( ERR );
X
X (*len)--; /* Now we are zero relative */
X (*len)--; /* Now we are looking at the previous
X * character */
X nbs++;
X /*
X * Determine number of characters to erase...
X */
X if ((ch[*len] < ' ') || (*s == 0x7f)) /* ctrl-char has size 2 */
X {
X nbs++;
X (*len)--;
X }
X
X if (ch[*len] == '\t') /* tabs are very special */
X {
X for (; p < ch; p++)
X {
X if (*p == '\t')
X x = ((x / ts) + 1) * ts;
X else
X {
X if ((*p < ' ') || (*p == 0x7f))
X x += 2;
X else
X x++;
X }
X if (x >= w->_maxx) /* go to next line? */
X x = 0;
X }
X if (!(w->_curx))
X nbs = w->_maxx - x;
X else
X nbs = w->_curx - x;
X }
X /*
X * Erase the characters and update...
X */
X _cursvar.raw_out = FALSE; /* ensure backspace handled in xlat mode */
X while (nbs--)
X {
X if (w->_curx > 0)
X {
X waddstr(w, "\b \b");
X }
X else
X if (w->_cury)
X {
X mvwaddch(w, w->_cury - 1, w->_maxx - 1, ' ');
X wmove(w, w->_cury - 1, w->_maxx - 1);
X }
X }
X ch[*len] = '\0';
X _cursvar.raw_out = save_raw_out;
X wrefresh(w);
X return( OK );
X}
END_OF_FILE
if test 2083 -ne `wc -c <'private/_backchr.c'`; then
echo shar: \"'private/_backchr.c'\" unpacked with wrong size!
fi
# end of 'private/_backchr.c'
fi
if test -f 'private/_cattr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_cattr.c'\"
else
echo shar: Extracting \"'private/_cattr.c'\" \(2249 characters\)
sed "s/^X//" >'private/_cattr.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__cattr = "$Header: c:/curses/private/RCS/_cattr.c%v 2.0 1992/11/15 03:24:41 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_chg_attr_pair() - Writes character and attribute to physical screen
X
X PDCurses Description:
X This is a private PDCurses function.
X
X Writes a single character 'chr' with attribute 'attr' to the
X current cursor location.
X
X NOTE: Though passed as 16 bit quantities, only the lower 8 bits
X will be used to create a character/attribute pair.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function under DOS.
X
X An ERR may be returned under FLEXOS if s_copy() fails. See the
X Flexos Programmer's Reference Manual for details on the error.
X
X Portability:
X PDCurses int PDC_chg_attr_pair( chtype chr, chtype attr );
X
X**man-end**********************************************************************/
X
Xint PDC_chg_attr_pair(chtype chr, chtype attr)
X{
X extern unsigned char atrtab[MAX_ATRTAB];
X chtype phys_attr=chtype_attr(attr);
X
X#ifdef FLEXOS
X UBYTE c = (UBYTE) chr;
X UBYTE a = (UBYTE) phys_attr;
X
X drect.r_row = PDC_get_cur_row();
X drect.r_col = PDC_get_cur_col();
X drect.r_nrow = 1;
X drect.r_ncol = 1;
X
X sframe.fr_pl[0] = (UBYTE *) & c;
X sframe.fr_pl[1] = (UBYTE *) & a;
X sframe.fr_pl[2] = (UBYTE *) " ";
X sframe.fr_nrow = 1;
X sframe.fr_ncol = 1;
X sframe.fr_use = 0x00;
X
X srect.r_col = 0;
X srect.r_row = 0;
X srect.r_nrow = 1;
X srect.r_ncol = 1;
X
X retcode = s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect, (far unsigned short *) &sframe, (far unsigned short *) &srect);
X return( (retcode < 0L) ? ERR : OK );
X#endif
X#ifdef DOS
X regs.h.ah = 0x09;
X regs.h.al = chr & A_CHARTEXT;
X regs.h.bh = _cursvar.video_page;
X regs.h.bl = (phys_attr & A_ATTRIBUTES) >> 8;
X regs.x.cx = 0x01;
X int86(0x10, ®s, ®s);
X return( OK );
X#endif
X#ifdef OS2
X USHORT curCol, curRow, cell;
X
X /* find the current cursor position */
X VioGetCurPos((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
X cell = (chr & A_CHARTEXT) | (phys_attr & A_ATTRIBUTES);
X VioWrtNCell((PBYTE)&cell,1,curRow,curCol,0);
X return( OK );
X#endif
X}
END_OF_FILE
if test 2249 -ne `wc -c <'private/_cattr.c'`; then
echo shar: \"'private/_cattr.c'\" unpacked with wrong size!
fi
# end of 'private/_cattr.c'
fi
if test -f 'private/_sanity.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_sanity.c'\"
else
echo shar: Extracting \"'private/_sanity.c'\" \(2107 characters\)
sed "s/^X//" >'private/_sanity.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__sanity = "$Header: c:/curses/private/RCS/_sanity.c%v 2.0 1992/11/15 03:24:32 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_sanity_check() - A video adapter identification sanity check
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X This routine will force sane values for various control flags.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_sanity_check( int adapter );
X
X**man-end**********************************************************************/
X
Xint PDC_sanity_check(int adapter)
X{
X int fontsize = PDC_get_font();
X int rows = PDC_get_rows();
X
X switch (adapter)
X {
X case _EGACOLOR:
X case _EGAMONO:
X switch (rows)
X {
X case 25: break;
X case 43: break;
X default:
X _cursvar.bogus_adapter = TRUE;
X break;
X }
X
X switch (fontsize)
X {
X case _FONT8: break;
X case _FONT14: break;
X default:
X _cursvar.bogus_adapter = TRUE;
X break;
X }
X break;
X
X case _VGACOLOR:
X case _VGAMONO:
X
X/* */
X/* lets be reasonably flexible with VGAs - they could be Super VGAs */
X/* capable of displaying any number of lines. MH 10-Jun-92 */
X/* This also applies to font size. MH 16-Jun-92 */
X/*
X switch (rows)
X {
X case 25: break;
X case 43: break;
X case 50: break;
X default:
X _cursvar.bogus_adapter = TRUE;
X break;
X }
X
X switch (fontsize)
X {
X case _FONT8: break;
X case _FONT14: break;
X case _FONT16: break;
X default:
X _cursvar.bogus_adapter = TRUE;
X break;
X }
X*/
X break;
X
X case _CGA:
X case _MDA:
X case _MCGACOLOR:
X case _MCGAMONO:
X switch (rows)
X {
X case 25: break;
X default:
X _cursvar.bogus_adapter = TRUE;
X break;
X }
X break;
X
X default:
X _cursvar.bogus_adapter = TRUE;
X break;
X }
X if (_cursvar.bogus_adapter)
X {
X _cursvar.sizeable = FALSE;
X _cursvar.direct_video = FALSE;
X }
X return (adapter);
X}
END_OF_FILE
if test 2107 -ne `wc -c <'private/_sanity.c'`; then
echo shar: \"'private/_sanity.c'\" unpacked with wrong size!
fi
# end of 'private/_sanity.c'
fi
if test -f 'private/_scb.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_scb.c'\"
else
echo shar: Extracting \"'private/_scb.c'\" \(2142 characters\)
sed "s/^X//" >'private/_scb.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#define NEEDS_OS2 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__scb = "$Header: c:/curses/private/RCS/_scb.c%v 2.0 1992/11/15 03:24:16 MH Rel $";
X#endif
X
X#ifdef OS2
X# if defined (CURSES__32BIT__) || defined (CSET2)
X# include <signal.h>
X# else
X# define INCL_DOSSIGNALS
X# define INCL_NOCOMMON
X# include <bsedos.h>
X# endif
X#endif
X
X
X
X/*man-start*********************************************************************
X
X PDC_set_ctrl_break() - Enables/Disables the host OS BREAK key check.
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Enables/Disables the host OS BREAK key check. This function toggles
X the BREAK setting. If it was on, it turns itoff; if it was aff it turns
X it on.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_set_ctrl_break( bool setting );
X
X**man-end**********************************************************************/
X
Xint PDC_set_ctrl_break(bool setting)
X{
X#ifdef FLEXOS
X retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X if (retcode < 0L)
X return( ERR );
X
X vir.vc_kbmode = ((vir.vc_kbmode & ~0x01) & (setting) ? 0x01 : 0x00);
X
X retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X return( (retcode < 0L) ? ERR : OK );
X#endif
X#ifdef DOS
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( OK );
X#endif
X#ifdef OS2
X# if defined (CURSES__32BIT__) || defined (CSET2)
X if (setting) {
X signal (SIGINT, SIG_DFL);
X signal (SIGBREAK, SIG_DFL);
X } else {
X signal (SIGINT, SIG_IGN);
X signal (SIGBREAK, SIG_IGN);
X }
X return( OK );
X# else
X PFNSIGHANDLER oldHandler;
X USHORT oldAction, Action;
X
X /* turn off control C checking */
X if (setting)
X Action = SIGA_KILL;
X else
X Action = SIGA_IGNORE;
X DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction,
X Action, SIG_CTRLBREAK);
X DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction,
X Action, SIG_CTRLC);
X return( OK );
X# endif
X#endif
X}
END_OF_FILE
if test 2142 -ne `wc -c <'private/_scb.c'`; then
echo shar: \"'private/_scb.c'\" unpacked with wrong size!
fi
# end of 'private/_scb.c'
fi
if test -f 'tools/buildlrf.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tools/buildlrf.c'\"
else
echo shar: Extracting \"'tools/buildlrf.c'\" \(353 characters\)
sed "s/^X//" >'tools/buildlrf.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include <stdlib.h>
X
Xint main(int argc,char *argv[])
X{
X FILE *fp;
X
X if (argc < 3)
X {
X fprintf(stderr,"Invalid number of parameters\n");
X return(1);
X }
X if ((fp = fopen(argv[2],"a")) == NULL)
X {
X fprintf(stderr,"Error opening %s\n",argv[2]);
X return(1);
X }
X fprintf(fp,"%s &\n",argv[1]);
X fclose(fp);
X return(0);
X}
END_OF_FILE
if test 353 -ne `wc -c <'tools/buildlrf.c'`; then
echo shar: \"'tools/buildlrf.c'\" unpacked with wrong size!
fi
# end of 'tools/buildlrf.c'
fi
echo shar: End of archive 7 \(of 11\).
cp /dev/null ark7isdone
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: nonport/curson.c portable/curs_set.c portable/def_prog.c
# portable/delwin.c portable/noraw.c portable/raw.c
# portable/reset_pr.c portable/reset_sh.c portable/scroll.c
# portable/setscrrg.c portable/unctrl.c portable/wclrtobo.c
# portable/wclrtoeo.c portable/winch.c portable/wsetscrr.c
# private/_addwin.c private/_chgattr.c private/_fixcurs.c
# private/_getcbrk.c private/_rawgetc.c private/_setcrsr.c
# private/_sgetnl.c private/_sysgetc.c tools/manext.def
# Wrapped by kent@sparky on Wed Nov 18 21:44:09 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 8 (of 11)."'
if test -f 'nonport/curson.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/curson.c'\"
else
echo shar: Extracting \"'nonport/curson.c'\" \(1679 characters\)
sed "s/^X//" >'nonport/curson.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef curson
X
X#ifndef NDEBUG
Xchar *rcsid_curson = "$Header: c:/curses/nonport/RCS/curson.c%v 2.0 1992/11/15 03:18:26 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X curson() - Turns on the hardware cursor.
X
X PDCurses Description:
X Turns on the hardware curses, it does nothing if it is already on.
X
X PDCurses Return Value:
X Returns OK upon success, ERR upon failure.
X
X Portability:
X PDCurses int curson( void );
X
X**man-end**********************************************************************/
X
Xint curson(void)
X{
X if (!_cursvar.visible_cursor)
X {
X _cursvar.visible_cursor = TRUE;
X/* PDC_fix_cursor(_cursvar.orig_emulation);*/
X if (_cursvar.bogus_adapter)
X {
X PDC_set_cursor_mode((_cursvar.cursor & 0xff00) >> 8,
X (_cursvar.cursor & 0x00ff));
X }
X else
X {
X#ifdef OS2
X PDC_set_cursor_mode((_cursvar.cursor & 0xff00) >> 8,
X (_cursvar.cursor & 0x00ff));
X#else
X switch (_cursvar.adapter) {
X case _MDA:
X case _CGA:
X case _EGACOLOR:
X case _EGAMONO:
X case _VGACOLOR:
X case _VGAMONO:
X case _MDS_GENIUS:
X/* PDC_set_cursor_mode(_cursvar.font - 2, _cursvar.font - 1);*/
X PDC_set_cursor_mode((_cursvar.cursor & 0xff00) >> 8,
X (_cursvar.cursor & 0x00ff));
X break;
X case _MCGACOLOR:
X case _MCGAMONO:
X/* PDC_set_cursor_mode(_cursvar.font - 1, _cursvar.font - 2);*/
X PDC_set_cursor_mode((_cursvar.cursor & 0xff00) >> 8,
X (_cursvar.cursor & 0x00ff));
X break;
X case _FLEXOS:
X PDC_set_cursor_mode(_cursvar.visible_cursor, 0);
X break;
X default:
X break;
X }
X#endif
X }
X }
X return( OK );
X}
END_OF_FILE
if test 1679 -ne `wc -c <'nonport/curson.c'`; then
echo shar: \"'nonport/curson.c'\" unpacked with wrong size!
fi
# end of 'nonport/curson.c'
fi
if test -f 'portable/curs_set.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/curs_set.c'\"
else
echo shar: Extracting \"'portable/curs_set.c'\" \(1835 characters\)
sed "s/^X//" >'portable/curs_set.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef curs_set
X
X#ifndef NDEBUG
Xchar *rcsid_curs_set = "$Header: c:/curses/portable/RCS/curs_set.c%v 2.0 1992/11/15 03:29:14 MH Rel $";
X#endif
X
X
X/*man-start*********************************************************************
X
X curs_set() - set visibility of cursor.
X
X X/Open Description:
X This routine is used to set the visibility of the cursor. The cursor
X can be made invisible, normal or highly visible by setting the
X parameter to 0, 1 or 2 respectively. If an invalid value is passed
X the function will set the cursor to "normal".
X
X X/Open Return Value:
X No return value.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int curs_set( int visibility );
X SYS V Curses int curs_set( int visibility );
X
X**man-end**********************************************************************/
X
Xint curs_set(int visibility)
X{
X#ifdef OS2
X VIOCURSORINFO pvioCursorInfo;
X#endif
X int start,end,hidden=0;
X
X switch(visibility)
X {
X case 0: /* invisible */
X#ifdef OS2
X start = _cursvar.font / 4;
X end = _cursvar.font;
X#else
X start = 32;
X end = 33;
X#endif
X hidden = (-1);
X break;
X case 2: /* highly visible */
X start = _cursvar.font / 4; /* 3/4 high block */
X end = _cursvar.font;
X break;
X default: /* normal visibility */
X start = _cursvar.font - 2;
X end = _cursvar.font;
X break;
X }
X#ifdef OS2
X pvioCursorInfo.yStart = (USHORT)start;
X pvioCursorInfo.cEnd = (USHORT)end;
X pvioCursorInfo.cx = (USHORT)1;
X pvioCursorInfo.attr = hidden;
X VioSetCurType((PVIOCURSORINFO)&pvioCursorInfo,0);
X#endif
X#ifdef DOS
X regs.h.ah = 0x01;
X regs.h.al = (unsigned char)_cursvar.scrnmode; /* if not set, some BIOSes hang */
X regs.h.ch = (unsigned char)start;
X regs.h.cl = (unsigned char)end;
X int86(0x10, ®s, ®s);
X#endif
X return( OK );
X}
END_OF_FILE
if test 1835 -ne `wc -c <'portable/curs_set.c'`; then
echo shar: \"'portable/curs_set.c'\" unpacked with wrong size!
fi
# end of 'portable/curs_set.c'
fi
if test -f 'portable/def_prog.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/def_prog.c'\"
else
echo shar: Extracting \"'portable/def_prog.c'\" \(1615 characters\)
sed "s/^X//" >'portable/def_prog.c' <<'END_OF_FILE'
X#ifdef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef def_prog_mode
X
X#ifndef NDEBUG
Xchar *rcsid_def_prog = "$Header: c:/curses/portable/RCS/def_prog.c%v 2.0 1992/11/15 03:28:48 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X def_prog_mode() - Save terminal mode
X
X X/Open Description:
X Save the current terminal modes as the "program" (in CURSES) or
X "shell" (not in CURSES) state for use by the reset_prog_mode()
X and reset_shell_mode() functions. This is done automatically by
X initscr().
X
X PDCurses Description:
X PDCurses maintains a WINDOW* that contains the original user's
X screen upon startup. This might be useful for returning the
X user's environment to its (near) original state.
X
X This is unimplemented at this time.
X
X X/Open Return Value:
X The def_prog_mode() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int def_prog_mode( void );
X X/Open Dec '88 int def_prog_mode( void );
X BSD Curses
X SYS V Curses int def_prog_mode( void );
X
X**man-end**********************************************************************/
X
Xint def_prog_mode(void)
X{
X#ifdef FLEXOS
X _flexos_16bitmode();
X#endif
X c_pr_tty.been_set = TRUE;
X#if defined DOS || defined OS2
X# if SMALL || MEDIUM
X movedata( FP_SEG(&_cursvar), FP_OFF(&_cursvar),
X FP_SEG(&c_pr_tty.saved), FP_OFF(&c_pr_tty.saved),
X sizeof(SCREEN) );
X
X# else
X memcpy(&c_pr_tty.saved, &_cursvar, sizeof(SCREEN));
X# endif
X#endif
X
X return( OK );
X}
END_OF_FILE
if test 1615 -ne `wc -c <'portable/def_prog.c'`; then
echo shar: \"'portable/def_prog.c'\" unpacked with wrong size!
fi
# end of 'portable/def_prog.c'
fi
if test -f 'portable/delwin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/delwin.c'\"
else
echo shar: Extracting \"'portable/delwin.c'\" \(1639 characters\)
sed "s/^X//" >'portable/delwin.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef delwin
X
X#ifndef NDEBUG
Xchar *rcsid_delwin = "$Header: c:/curses/portable/RCS/delwin.c%v 2.0 1992/11/15 03:29:17 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X delwin() - delete window
X
X X/Open Description:
X Deletes the named window, freeing all memory associated with it.
X In the case of overlapping windows, subwindows should be deleted
X before the main window.
X
X PDCurses Description:
X This routine will also attempt to remove the passed window from
X the visible window's list. This is a list of windows that are
X "visible" and will always be refreshed at the next doupdate()
X call.
X
X X/Open Return Value:
X The delwin() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int delwin( WINDOW* win );
X X/Open Dec '88 int delwin( WINDOW* win );
X BSD Curses int delwin( WINDOW* win );
X SYS V Curses int delwin( WINDOW* win );
X**man-end**********************************************************************/
X
Xint delwin(WINDOW *win)
X{
Xextern void (*fre)( void* );
X int i;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X#ifdef REGISTERWINDOWS
X _rmwin(win); /* Remove from the visible windows list... */
X#endif
X
X /*
X * FYI: Subwindow's use 'parent's' lines
X */
X if (!(win->_flags & _SUBWIN))
X {
X for (i = 0; i < win->_pmaxy && win->_y[i]; i++)
X {
X if (win->_y[i] != NULL)
X (*fre)(win->_y[i]);
X }
X }
X (*fre)(win->_firstch);
X (*fre)(win->_lastch);
X (*fre)(win->_y);
X (*fre)(win);
X return( OK );
X}
END_OF_FILE
if test 1639 -ne `wc -c <'portable/delwin.c'`; then
echo shar: \"'portable/delwin.c'\" unpacked with wrong size!
fi
# end of 'portable/delwin.c'
fi
if test -f 'portable/noraw.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/noraw.c'\"
else
echo shar: Extracting \"'portable/noraw.c'\" \(1811 characters\)
sed "s/^X//" >'portable/noraw.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef noraw
X
X#ifndef NDEBUG
Xchar *rcsid_noraw = "$Header: c:/curses/portable/RCS/noraw.c%v 2.0 1992/11/15 03:29:06 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X noraw() - disable raw mode
X
X X/Open Description:
X The terminal in placed into or out of raw mode. Raw mode is
X similar to cbreak mode, in that characters typed are immediately
X passed through to the user program. The differences are that in
X raw mode, the INTR, QUIT, SUSP, and STOP characters are passed
X through without being interpreted, and without generating a
X signal. The behaviour of the BREAK key depends on other
X parameters of the terminal drive that are not set by curses.
X
X PDCurses Description:
X Raw mode in the traditional sense refers to input handling.
X Contrast noraw_output() which disables 8bit characters.
X
X FYI: PDCurses does NOT provide signal(3) support,
X this must be done by the application.
X
X X/Open Return Value:
X The noraw() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int noraw( void );
X X/Open Dec '88 int noraw( void );
X BSD Curses int noraw( void );
X SYS V Curses int noraw( void );
X
X**man-end**********************************************************************/
X
Xint noraw(void)
X{
X#ifdef OS2
X KBDINFO KbdInfo;
X
X KbdGetStatus(&KbdInfo,0);
X KbdInfo.fsMask |= KEYBOARD_ASCII_MODE;
X KbdInfo.fsMask &= ~KEYBOARD_BINARY_MODE;
X KbdSetStatus(&KbdInfo,0);
X#endif
X _cursvar.raw_inp = FALSE;
X PDC_set_ctrl_break(_cursvar.orgcbr); /* restore original ^BREAK status */
X return( OK );
X}
END_OF_FILE
if test 1811 -ne `wc -c <'portable/noraw.c'`; then
echo shar: \"'portable/noraw.c'\" unpacked with wrong size!
fi
# end of 'portable/noraw.c'
fi
if test -f 'portable/raw.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/raw.c'\"
else
echo shar: Extracting \"'portable/raw.c'\" \(1788 characters\)
sed "s/^X//" >'portable/raw.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef raw
X
X#ifndef NDEBUG
Xchar *rcsid_raw = "$Header: c:/curses/portable/RCS/raw.c%v 2.0 1992/11/15 03:29:25 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X raw() - enable raw mode
X
X X/Open Description:
X The terminal in placed into or out of raw mode. Raw mode is
X similar to cbreak mode, in that characters typed are immediately
X passed through to the user program. The differences are that in
X raw mode, the INTR, QUIT, SUSP, and STOP characters are passed
X through without being interpreted, and without generating a
X signal. The behaviour of the BREAK key depends on other
X parameters of the terminal drive that are not set by curses.
X
X PDCurses Description:
X Raw mode in the traditional sense refers to input handling.
X Contrast raw_output() which enables 8bit characters.
X
X FYI: PDCurses does NOT provide signal(3) support,
X this must be done by the application.
X
X X/Open Return Value:
X This function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int raw( void );
X X/Open Dec '88 int raw( void );
X BSD Curses int raw( void );
X SYS V Curses int raw( void );
X
X**man-end**********************************************************************/
X
Xint raw(void)
X{
X#ifdef OS2
X KBDINFO KbdInfo;
X
X KbdGetStatus(&KbdInfo,0);
X KbdInfo.fsMask |= KEYBOARD_BINARY_MODE;
X KbdInfo.fsMask &= ~KEYBOARD_ASCII_MODE;
X KbdSetStatus(&KbdInfo,0);
X#endif
X _cursvar.raw_inp = TRUE;
X PDC_set_ctrl_break(FALSE); /* disallow ^BREAK on disk I/O */
X/* flushinp(); */
X return( OK );
X}
END_OF_FILE
if test 1788 -ne `wc -c <'portable/raw.c'`; then
echo shar: \"'portable/raw.c'\" unpacked with wrong size!
fi
# end of 'portable/raw.c'
fi
if test -f 'portable/reset_pr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/reset_pr.c'\"
else
echo shar: Extracting \"'portable/reset_pr.c'\" \(1980 characters\)
sed "s/^X//" >'portable/reset_pr.c' <<'END_OF_FILE'
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef reset_prog_mode
X
X#ifndef NDEBUG
Xchar *rcsid_reset_pr = "$Header: c:/curses/portable/RCS/reset_pr.c%v 2.0 1992/11/15 03:29:11 MH Rel $";
X#endif
X
X/*man-start*********************************************************************
X
X reset_prog_mode() - restore terminal mode
X
X X/Open Description:
X Restore the terminal to "program" (in curses) or "shell" (out
X of curses) state. These are done automatically by endwin()
X and doupdate() after an endwin(), so they would normally not
X be called before these functions.
X
X PDCurses Description:
X Under the Flexos platform, PDCurses operates in 16-bit mode.
X Normally, the Flexos shell operates in 8-bit mode.
X
X X/Open Return Value:
X The reset_prog_mode() routine returns OK on success otherwise ERR
X is returned.
X
X Portability:
X PDCurses int reset_prog_mode( void );
X X/Open Dec '88 int reset_prog_mode( void );
X SysV Curses int reset_prog_mode( void );
X BSD Curses int reset_prog_mode( void );
X
X**man-end**********************************************************************/
X
Xint reset_prog_mode(void)
X{
X if (c_pr_tty.been_set == TRUE)
X {
X#if defined(DOS) || defined(OS2)
X# if SMALL || MEDIUM
X movedata( FP_SEG(&c_pr_tty.saved), FP_OFF(&c_pr_tty.saved),
X FP_SEG(&_cursvar), FP_OFF(&_cursvar),
X sizeof(SCREEN) );
X# else
X memcpy(&_cursvar, &c_pr_tty.saved, sizeof(SCREEN));
X# endif
X#endif
X mvcur(0, 0, c_pr_tty.saved.cursrow, c_pr_tty.saved.curscol);
X if (PDC_get_ctrl_break() != c_pr_tty.saved.orgcbr)
X PDC_set_ctrl_break(c_pr_tty.saved.orgcbr);
X if (c_pr_tty.saved.raw_out)
X raw();
X if (c_pr_tty.saved.visible_cursor)
X curson();
X _cursvar.font = PDC_get_font();
X PDC_set_font(c_pr_tty.saved.font);
X if (!PDC_scrn_modes_equal (PDC_get_scrn_mode(), c_pr_tty.saved.scrnmode))
X PDC_set_scrn_mode(c_pr_tty.saved.scrnmode);
X
X PDC_set_rows(c_pr_tty.saved.lines);
X }
X#ifdef FLEXOS
X _flexos_16bitmode();
X#endif
X return( OK );
X}
END_OF_FILE
if test 1980 -ne `wc -c <'portable/reset_pr.c'`; then
echo shar: \"'portable/reset_pr.c'\" unpacked with wrong size!
fi
# end of 'portable/reset_pr.c'
fi
if test -f 'portable/reset_sh.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/reset_sh.c'\"
else
echo shar: Extracting \"'portable/reset_sh.c'\" \(1989 characters\)
sed "s/^X//" >'portable/reset_sh.c' <<'END_OF_FILE'
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef reset_shell_mode
X
X#ifndef NDEBUG
Xchar *rcsid_reset_sh = "$Header: c:/curses/portable/RCS/reset_sh.c%v 2.0 1992/11/15 03:29:12 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X reset_shell_mode() - restore terminal mode
X
X X/Open Description:
X Restore the terminal to "program" (in curses) or "shell" (out
X of curses) state. These are done automatically by endwin()
X and doupdate() after an endwin(), so they would normally not
X be called before these functions.
X
X PDCurses Description:
X Under the Flexos platform, PDCurses operates in 16-bit mode.
X Normally, the Flexos shell operates in 8-bit mode.
X
X X/Open Return Value:
X The reset_shell_mode() routine returns OK on success otherwise ERR
X is returned.
X
X Portability:
X PDCurses int reset_shell_mode( void );
X X/Open Dec '88 int reset_shell_mode( void );
X SysV Curses int reset_shell_mode( void );
X BSD Curses int reset_shell_mode( void );
X
X**man-end**********************************************************************/
X
Xint reset_shell_mode(void)
X{
X if (c_sh_tty.been_set == TRUE)
X {
X#if defined(DOS) || defined(OS2)
X# if SMALL || MEDIUM
X movedata( FP_SEG(&c_sh_tty.saved), FP_OFF(&c_sh_tty.saved),
X FP_SEG(&_cursvar), FP_OFF(&_cursvar),
X sizeof(SCREEN) );
X# else
X memcpy(&_cursvar, &c_sh_tty.saved, sizeof(SCREEN));
X# endif
X#endif
X mvcur(0, 0, c_sh_tty.saved.cursrow, c_sh_tty.saved.curscol);
X if (PDC_get_ctrl_break() != c_sh_tty.saved.orgcbr)
X PDC_set_ctrl_break(c_sh_tty.saved.orgcbr);
X if (c_sh_tty.saved.raw_out)
X raw();
X if (c_sh_tty.saved.visible_cursor)
X curson();
X _cursvar.font = PDC_get_font();
X PDC_set_font(c_sh_tty.saved.font);
X if (!PDC_scrn_modes_equal (PDC_get_scrn_mode(), c_sh_tty.saved.scrnmode))
X PDC_set_scrn_mode(c_sh_tty.saved.scrnmode);
X PDC_set_rows(c_sh_tty.saved.lines);
X }
X#ifdef FLEXOS
X _flexos_8bitmode();
X#endif
X return( OK );
X}
END_OF_FILE
if test 1989 -ne `wc -c <'portable/reset_sh.c'`; then
echo shar: \"'portable/reset_sh.c'\" unpacked with wrong size!
fi
# end of 'portable/reset_sh.c'
fi
if test -f 'portable/scroll.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/scroll.c'\"
else
echo shar: Extracting \"'portable/scroll.c'\" \(1959 characters\)
sed "s/^X//" >'portable/scroll.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef scroll
X
X#ifndef NDEBUG
Xchar *rcsid_scroll = "$Header: c:/curses/portable/RCS/scroll.c%v 2.0 1992/11/15 03:28:49 MH Rel $";
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X scroll() - scroll window
X
X X/Open Description:
X The window is scrolled up one line. THis involves moving the
X lines in the window data strcture.
X
X PDCurses Description:
X No additional functionality at this time. Thought it might be
X be nice to provide reverse scrolling, or scrolling 'n' lines
X in a positive (down) or negative (up) direction in a future
X release for the PC platform.
X
X X/Open Return Value:
X The scroll() function returns OK on succes and ERR on error.
X
X PDCurses Errors:
X It is an error to pass a NULL* window.
X
X Portability:
X PDCurses int scroll( WINDOW* win );
X X/Open Dec '88 int scroll( WINDOW* win );
X SysV Curses int scroll( WINDOW* win );
X BSD Curses int scroll( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint scroll(WINDOW *win)
X{
X int i;
X chtype* ptr;
X chtype* temp;
Xstatic chtype blank;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X blank = win->_blank | win->_attrs;
X
X /*
X * Check if window scrolls and cursor in region.
X */
X if ((!win->_scroll) ||
X (win->_cury < win->_tmarg) ||
X (win->_cury > win->_bmarg))
X {
X return( ERR );
X }
X
X temp = win->_y[win->_tmarg];
X for (i = win->_tmarg; (i < win->_bmarg); i++)
X {
X win->_y[i] = win->_y[i + 1]; /* re-arrange line
X * pointers */
X win->_firstch[i] = 0;
X win->_lastch[i] = win->_maxx - 1;
X }
X
X for (ptr = temp; (ptr - temp < win->_maxx); ptr++)
X *ptr = blank; /* make a blank line */
X
X win->_y[win->_bmarg] = temp;
X if (win->_cury > win->_tmarg) /* if not on top line */
X win->_cury--; /* cursor scrolls too */
X
X win->_firstch[win->_bmarg] = 0;
X win->_lastch[win->_bmarg] = win->_maxx - 1;
X return( OK );
X}
END_OF_FILE
if test 1959 -ne `wc -c <'portable/scroll.c'`; then
echo shar: \"'portable/scroll.c'\" unpacked with wrong size!
fi
# end of 'portable/scroll.c'
fi
if test -f 'portable/setscrrg.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/setscrrg.c'\"
else
echo shar: Extracting \"'portable/setscrrg.c'\" \(1860 characters\)
sed "s/^X//" >'portable/setscrrg.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef setscrreg
X
X#ifndef NDEBUG
Xchar *rcsid_setscrrg = "$Header: c:/curses/portable/RCS/setscrrg.c%v 2.0 1992/11/15 03:29:15 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X setscrreg() - set scrolling region
X
X X/Open Description: setscrreg(), wsetscrreg()
X These functions allow the suer to set a software scrolling region
X in a window. The parameters 'top' and 'bot' are the line numbers
X of the top and bottom margin of the scrolling region. (Line 0 is
X the top line of the window.) If this option and scrollok() are
X enabled, an attempt to move off the bottom margin will cause all
X lines in the scrolling region to scroll up one line. Only the
X text of the window is scrolled.
X
X PDCurses Description:
X PDCurses implements the standard OK and ERR return values.
X
X FYI: setscrreg() is also defined as a macro.
X
X X/Open Return Value:
X No return values are defined for these functions.
X
X PDCurses Errors:
X It is an error to pass a NULL WINDOW pointer.
X The top and bottom coordinates must be inside the passed window
X and must bound the window's cursor position. e.g. The cursor
X cannot be above or below the top or bottom margins.
X
X Portability:
X PDCurses int setscrreg( int top, int bottom );
X X/Open Dec '88 int setscrreg( int top, int bottom );
X SysV Curses int setscrreg( int top, int bottom );
X BSD Curses int setscrreg( int top, int bottom );
X
X**man-end**********************************************************************/
X
Xint setscrreg(int top, int bottom)
X{
X if (stdscr == (WINDOW *)NULL)
X return (ERR);
X
X if ((0 <= top) &&
X (top <= stdscr->_cury) &&
X (stdscr->_cury <= bottom) &&
X (bottom < LINES))
X {
X stdscr->_tmarg = top;
X stdscr->_bmarg = bottom;
X return (OK);
X }
X else
X {
X return (ERR);
X }
X}
END_OF_FILE
if test 1860 -ne `wc -c <'portable/setscrrg.c'`; then
echo shar: \"'portable/setscrrg.c'\" unpacked with wrong size!
fi
# end of 'portable/setscrrg.c'
fi
if test -f 'portable/unctrl.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/unctrl.c'\"
else
echo shar: Extracting \"'portable/unctrl.c'\" \(1843 characters\)
sed "s/^X//" >'portable/unctrl.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef unctrl
X
X#ifndef NDEBUG
Xchar *rcsid_unctrl = "$Header: c:/curses/portable/RCS/unctrl.c%v 2.0 1992/11/15 03:29:19 MH Rel $";
X#endif
X
X
X
X
Xstatic char strbuf[3] = {0, 0, 0};
X
X/*man-start*********************************************************************
X
X unctrl() - convert character to printable form
X
X X/Open Description:
X The unctrl routine expands the character c into a character
X string which is a printable representation of the character.
X
X Control characters are displayed in the ^X notation. Printing
X characters are displayed normally.
X
X PDCurses Description:
X The conversion from a control character to a two-character
X sequence is done by the unctrl() function. In the BSD version
X of curses it is done by a macro, which uses a publicly
X available translation table. Some ill-behaved application
X programs use the table directly, and since it does not exist
X in this curses version such application will link with an
X error message complainting about undefined symbols.
X
X X/Open Return Value:
X The unctrl() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses char* unctrl( chtype c );
X X/Open Dec '88 char* unctrl( chtype c );
X BSD Curses char* unctrl( chtype c );
X SYS V Curses char* unctrl( chtype c );
X
X**man-end**********************************************************************/
X
Xchar* unctrl(chtype c)
X{
X chtype ic = c;
X
X ic &= A_CHARTEXT;
X if (ic >= 0x20 && ic != 0x7f) /* normal characters */
X {
X strbuf[0] = (char) ic;
X strbuf[1] = '\0';
X return( strbuf );
X }
X strbuf[0] = '^'; /* '^' prefix */
X if (c == 0x7f)
X {
X /*
X * 0x7f == DEL
X */
X strbuf[1] = '?';
X }
X else
X {
X /*
X * other control
X */
X strbuf[1] = (char)(ic + '@');
X }
X return( strbuf );
X}
END_OF_FILE
if test 1843 -ne `wc -c <'portable/unctrl.c'`; then
echo shar: \"'portable/unctrl.c'\" unpacked with wrong size!
fi
# end of 'portable/unctrl.c'
fi
if test -f 'portable/wclrtobo.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wclrtobo.c'\"
else
echo shar: Extracting \"'portable/wclrtobo.c'\" \(1876 characters\)
sed "s/^X//" >'portable/wclrtobo.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wclrtobot
X
X#ifndef NDEBUG
Xchar *rcsid_wclrtobo = "$Header: c:/curses/portable/RCS/wclrtobo.c%v 2.0 1992/11/15 03:28:56 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wclrtobot() - erase window
X
X X/Open Description:
X All lines below the cursor in this window are erased. The current
X line to the right of the cursor, inclusive, is also erased.
X
X NOTE: clrtobot() is a macro.
X
X PDCurses Description:
X There is no additional PDCurses functionality.
X
X X/Open Return Value:
X The wclrtobot() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wclrtobot( WINDOW* win );
X X/Open Dec '88 int wclrtobot( WINDOW* win );
X BSD Curses int wclrtobot( WINDOW* win );
X SYS V Curses int wclrtobot( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint wclrtobot(WINDOW *win)
X{
X int y;
X int minx;
Xstatic int startx;
Xstatic chtype blank;
Xstatic chtype* ptr;
Xstatic chtype* end;
Xstatic chtype* maxx;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X blank = win->_blank | win->_attrs;
X startx = win->_curx;
X
X for (y = win->_cury; y <= win->_bmarg; y++)
X {
X minx = _NO_CHANGE;
X end = &win->_y[y][win->_maxx - 1];
X for (ptr = &win->_y[y][startx]; ptr <= end; ptr++)
X {
X if (*ptr != blank)
X {
X maxx = ptr;
X if (minx == _NO_CHANGE)
X {
X minx = (int) (ptr - win->_y[y]);
X }
X *ptr = blank;
X }
X }
X if (minx != _NO_CHANGE)
X {
X if ((win->_firstch[y] > minx) ||
X (win->_firstch[y] == _NO_CHANGE))
X {
X win->_firstch[y] = minx;
X if (win->_lastch[y] < maxx - win->_y[y])
X {
X win->_lastch[y] = (int) (maxx - win->_y[y]);
X }
X }
X }
X startx = 0;
X }
X return( OK );
X}
END_OF_FILE
if test 1876 -ne `wc -c <'portable/wclrtobo.c'`; then
echo shar: \"'portable/wclrtobo.c'\" unpacked with wrong size!
fi
# end of 'portable/wclrtobo.c'
fi
if test -f 'portable/wclrtoeo.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wclrtoeo.c'\"
else
echo shar: Extracting \"'portable/wclrtoeo.c'\" \(1838 characters\)
sed "s/^X//" >'portable/wclrtoeo.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wclrtoeol
X
X#ifndef NDEBUG
Xchar *rcsid_wclrtoeo = "$Header: c:/curses/portable/RCS/wclrtoeo.c%v 2.0 1992/11/15 03:29:03 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wclrtoeol() - erase line to right of cursor in window
X
X X/Open Description:
X The current line to the right of the cursor, inclusive, is erased.
X
X NOTE: clrtoeol() is a macro.
X
X PDCurses Description:
X In addition to the X/Open specification, there also exist
X mv[w]clrtoeol() versions which first position the cursor
X then perform the [w]clrtoeol call.
X
X X/Open Return Value:
X The wclrtoeol() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wclrtoeol( WINDOW* win );
X X/Open Dec '88 int wclrtoeol( WINDOW* win );
X BSD Curses int wclrtoeol( WINDOW* win );
X SYS V Curses int wclrtoeol( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint wclrtoeol(WINDOW *win)
X{
X int y;
X int x;
X int minx;
X chtype blank;
X chtype* maxx;
X chtype* ptr;
X chtype* end;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X y = win->_cury;
X x = win->_curx;
X blank = win->_blank | win->_attrs;
X end = &win->_y[y][win->_maxx - 1];
X minx = _NO_CHANGE;
X maxx = &win->_y[y][x];
X
X for (ptr = maxx; ptr <= end; ptr++)
X {
X if (*ptr != blank)
X {
X maxx = ptr;
X if (minx == _NO_CHANGE)
X {
X minx = (int) (ptr - win->_y[y]);
X }
X *ptr = blank;
X }
X }
X
X if (minx != _NO_CHANGE)
X {
X if ((win->_firstch[y] > minx) ||
X (win->_firstch[y] == _NO_CHANGE))
X {
X win->_firstch[y] = minx;
X }
X if (win->_lastch[y] < maxx - win->_y[y])
X {
X win->_lastch[y] = (int) (maxx - win->_y[y]);
X }
X }
X return( OK );
X}
END_OF_FILE
if test 1838 -ne `wc -c <'portable/wclrtoeo.c'`; then
echo shar: \"'portable/wclrtoeo.c'\" unpacked with wrong size!
fi
# end of 'portable/wclrtoeo.c'
fi
if test -f 'portable/winch.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/winch.c'\"
else
echo shar: Extracting \"'portable/winch.c'\" \(1677 characters\)
sed "s/^X//" >'portable/winch.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef winch
X
X#ifndef NDEBUG
Xchar *rcsid_winch = "$Header: c:/curses/portable/RCS/winch.c%v 2.0 1992/11/15 03:29:08 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X winch() - return character from window
X
X X/Open Description:
X The character at the current position in the named window is
X returned. If any attributes are set for that position, their
X values will be bitwise-OR'ed into the value returned. The
X pre-defined constants A_CHARTEXT and A_ATTRIBUTES, defined in
X <curses.h>, can be used with the & (bitwise-AND) operator to
X extract the character or attribute alone.
X
X NOTE: inch(), winch(), mvinch() and mvwinch() are macros.
X
X PDCurses Description:
X There is no additional PDCurses functionality. This routine
X is here as a documentation placeholder. No code will be
X executed in this module, unless the user #undefs winch.
X
X X/Open Return Value:
X Upon successfull completion, the inch(), mvinch(), mvwinch(),
X and winch() functions return the character at the selected
X position. Otherwise, the mvinch() and mvwinch() functions
X return ERR.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X It is also an error to address a position that is outside the
X bounds of the specified window.
X
X Portability:
X PDCurses chtype winch( WINDOW* win );
X X/Open Dec '88 chtype winch( WINDOW* win );
X BSD Curses
X SYS V Curses int winch( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xchtype winch(WINDOW *win)
X{
X return( win->_y[win->_cury][win->_curx] );
X}
END_OF_FILE
if test 1677 -ne `wc -c <'portable/winch.c'`; then
echo shar: \"'portable/winch.c'\" unpacked with wrong size!
fi
# end of 'portable/winch.c'
fi
if test -f 'portable/wsetscrr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wsetscrr.c'\"
else
echo shar: Extracting \"'portable/wsetscrr.c'\" \(1922 characters\)
sed "s/^X//" >'portable/wsetscrr.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wsetscrreg
X
X#ifndef NDEBUG
Xchar *rcsid_wsetscrr = "$Header: c:/curses/portable/RCS/wsetscrr.c%v 2.0 1992/11/15 03:29:29 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wsetscrreg() - set scrolling region
X
X X/Open Description: setscrreg(), wsetscrreg()
X These functions allow the suer to set a software scrolling region
X in a window. The parameters 'top' and 'bot' are the line numbers
X of the top and bottom margin of the scrolling region. (Line 0 is
X the top line of the window.) If this option and scrollok() are
X enabled, an attempt to move off the bottom margin will cause all
X lines in the scrolling region to scroll up one line. Only the
X text of the window is scrolled.
X
X PDCurses Description:
X PDCurses implements the standard OK and ERR return values.
X
X FYI: setscrreg() is also defined as a macro.
X
X X/Open Return Value:
X No return values are defined for these functions.
X
X PDCurses Errors:
X It is an error to pass a NULL WINDOW pointer.
X The top and bottom coordinates must be inside the passed window
X and must bound the window's cursor position. e.g. The cursor
X cannot be above or below the top or bottom margins.
X
X Portability:
X PDCurses int wsetscrreg( WINDOW* win, int top, int bottom );
X X/Open Dec '88 int wsetscrreg( WINDOW* win, int top, int bottom );
X SysV Curses int wsetscrreg( WINDOW* win, int top, int bottom );
X BSD Curses int wsetscrreg( WINDOW* win, int top, int bottom );
X
X**man-end**********************************************************************/
X
Xint wsetscrreg(WINDOW *win, int top, int bottom)
X{
X if (win == (WINDOW *)NULL)
X return (ERR);
X
X if ((0 <= top) &&
X (top <= win->_cury) &&
X (win->_cury <= bottom) &&
X (bottom < win->_maxy))
X {
X win->_tmarg = top;
X win->_bmarg = bottom;
X return (OK);
X }
X else
X {
X return (ERR);
X }
X}
END_OF_FILE
if test 1922 -ne `wc -c <'portable/wsetscrr.c'`; then
echo shar: \"'portable/wsetscrr.c'\" unpacked with wrong size!
fi
# end of 'portable/wsetscrr.c'
fi
if test -f 'private/_addwin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_addwin.c'\"
else
echo shar: Extracting \"'private/_addwin.c'\" \(2004 characters\)
sed "s/^X//" >'private/_addwin.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifdef REGISTERWINDOWS
X#ifndef NDEBUG
Xchar *rcsid__addwin = "$Header: c:/curses/private/RCS/_addwin.c%v 2.0 1992/11/15 03:24:18 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_addwin() - adds window
X
X PDCurses Description:
X This routine adds the passed window pointer after the specified
X window. If the specified window is NULL, then the passed
X window pointer is inserted first in the list.
X
X If the 'after' window is not on the visible list, then 'win'
X will be added to the end of the list.
X
X PDCurses Return Value:
X This routine will return OK upon success and otherwise ERR will be
X returned.
X
X PDCurses Errors:
X An error will occur if we are unable to allocate a new WINDS
X structure.
X
X Portability:
X PDCurses int PDC_addwin( WINDOW* win, WINDOW* after );
X
X**man-end**********************************************************************/
X
Xint _addwin(WINDOW *win, WINDOW *after)
X{
Xextern void* (*mallc)( size_t );
Xextern void* (*callc)( size_t, size_t );
Xextern void (*fre)( void* );
X
X WINDS *root = _cursvar.visible;
X WINDS *wlst = PDC_findwin(after);
X WINDS *new = (*mallc)(sizeof(WINDS));
X
X if (new == (WINDOW *)NULL)
X return( ERR );
X
X PDC_rmwin(win);
X memset(new, 0, sizeof(WINDS));
X new->w = win;
X if (wlst == (WINDS *)NULL)
X {
X if (root == (WINDS *)NULL)
X _cursvar.visible = new;
X else
X {
X root->tail->next = new;
X new->prev = root->tail;
X root->tail = new;
X }
X }
X else
X {
X if (root->next == NULL)
X {
X root->next = new;
X new->prev = root;
X }
X else
X if (wlst == root->tail)
X {
X root->tail->next = new;
X new->prev = root->tail;
X root->tail = new;
X }
X else
X {
X new->prev = wlst;
X new->next = wlst->next;
X if (wlst->next == NULL)
X {
X wlst->next = new;
X root->tail = new;
X }
X else
X {
X wlst->next->prev = new;
X wlst->next = new;
X }
X }
X }
X return( OK );
X}
X#endif
END_OF_FILE
if test 2004 -ne `wc -c <'private/_addwin.c'`; then
echo shar: \"'private/_addwin.c'\" unpacked with wrong size!
fi
# end of 'private/_addwin.c'
fi
if test -f 'private/_chgattr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_chgattr.c'\"
else
echo shar: Extracting \"'private/_chgattr.c'\" \(1656 characters\)
sed "s/^X//" >'private/_chgattr.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__chgattr = "$Header: c:/curses/private/RCS/_chgattr.c%v 2.0 1992/11/15 03:24:20 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_chg_attrs() - Change attributes in a rectangle
X
X PDCurses Description:
X This routine will change the attribute(s) from a starting (y,x)
X position to an ending (y,x) position to the specified attribute.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X It is also an error to pass rectangular coordinates that lay
X outside of window.
X
X Portability:
X PDCurses int PDC_chg_attrs( WINDOW* w, chtype attr,
X int sy, int sx,
X int ey, int ex );
X
X**man-end**********************************************************************/
X
Xint PDC_chg_attrs(WINDOW *w, chtype attr, int sy, int sx, int ey, int ex)
X{
X chtype oldattr = w->_attrs;
X int c;
X int l;
X
X if (w == (WINDOW *)NULL) return( ERR );
X if (sy > w->_maxy) return( ERR );
X if (sx > w->_maxx) return( ERR );
X if (ey >= w->_maxy) ey = w->_maxy - 1;
X if (ex >= w->_maxx) ex = w->_maxx - 1;
X
X wattrset(w, attr);
X for (l = sy; l <= ey; l++)
X {
X for (c = sx; c <= ex; c++)
X w->_y[l][c] = (w->_y[l][c] & A_CHARTEXT) | attr;
X
X if (w->_firstch[l] == _NO_CHANGE)
X {
X w->_firstch[l] = sx;
X w->_lastch[l] = ex;
X }
X else
X if (w->_firstch[l] != _NO_CHANGE)
X {
X if (sx < w->_firstch[l])
X w->_firstch[l] = sx;
X if (ex > w->_lastch[l])
X w->_lastch[l] = ex;
X }
X }
X w->_attrs = oldattr;
X return( OK );
X}
END_OF_FILE
if test 1656 -ne `wc -c <'private/_chgattr.c'`; then
echo shar: \"'private/_chgattr.c'\" unpacked with wrong size!
fi
# end of 'private/_chgattr.c'
fi
if test -f 'private/_fixcurs.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_fixcurs.c'\"
else
echo shar: Extracting \"'private/_fixcurs.c'\" \(1915 characters\)
sed "s/^X//" >'private/_fixcurs.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__fixcurs = "$Header: c:/curses/private/RCS/_fixcurs.c%v 2.0 1992/11/15 03:24:21 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_fix_cursor() - Fix the cursor start and stop scan lines (if necessary)
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X This routine will fix the cursor shape for certain video adapters.
X Normally, the values used are correct, but some adapters choke.
X The most noticable choke is on a monochrome adapter. The "correct"
X scan lines will result in the cursor being set in the middle of the
X character cell, rather than at the bottom.
X
X The passed flag indicates whether the cursor is visible or not.
X
X This only applies to the DOS platform.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_fix_cursor( int flag );
X
X**man-end**********************************************************************/
X
Xint PDC_fix_cursor(int flag)
X{
X#ifdef FLEXOS
X return( OK );
X#endif
X#ifdef DOS
X char far* INFO = (char far *) 0x0487L;
X
X if (_cursvar.bogus_adapter)
X return( OK );
X
X switch (_cursvar.adapter)
X {
X case _EGACOLOR:
X case _EGAMONO:
X case _MDS_GENIUS: /* Some clones look like a Genius;-) */
X if (flag & 0x01)
X *INFO |= 0x01; /* Enable emnulation */
X else
X *INFO &= (*INFO & ~0x01); /* Disable emnulation */
X break;
X
X case _VGACOLOR:
X case _VGAMONO:
X if (flag & 0x01)
X regs.x.ax = 0x1200; /* Enable emulation */
X else
X regs.x.ax = 0x1201; /* Disable emulation */
X regs.h.bl = 0x34;
X int86(0x10, ®s, ®s);
X
X break;
X
X case _MCGACOLOR:
X case _MCGAMONO:
X case _MDA:
X case _CGA:
X case _NONE:
X default:
X break;
X }
X return( OK );
X#endif
X#ifdef OS2
X return( OK );
X#endif
X}
END_OF_FILE
if test 1915 -ne `wc -c <'private/_fixcurs.c'`; then
echo shar: \"'private/_fixcurs.c'\" unpacked with wrong size!
fi
# end of 'private/_fixcurs.c'
fi
if test -f 'private/_getcbrk.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_getcbrk.c'\"
else
echo shar: Extracting \"'private/_getcbrk.c'\" \(1949 characters\)
sed "s/^X//" >'private/_getcbrk.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#define NEEDS_OS2 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__getcbrk = "$Header: c:/curses/private/RCS/_getcbrk.c%v 2.0 1992/11/15 03:24:20 MH Rel $";
X#endif
X
X#ifdef OS2
X# if defined(CURSES__32BIT__) || defined (CSET2)
X# include <signal.h>
X# else
X# define INCL_DOSSIGNALS
X# define INCL_NOCOMMON
X# include <bsedos.h>
X# endif
X#endif
X
X
X/*man-start*********************************************************************
X
X PDC_get_ctrl_break() - return OS control break state
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Returns the current OS Control Break Check state.
X
X PDCurses Return Value:
X DOS:
X This function returns TRUE on if the Control Break
X Check is enabled otherwise FALSE is returned.
X
X FLEXOS:
X This function returns TRUE on if the Keyboard Mode
X allows a break to bre reported otherwise FALSE is returned.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses bool PDC_get_ctrl_break( void );
X
X**man-end**********************************************************************/
X
Xbool PDC_get_ctrl_break(void)
X{
X#ifdef FLEXOS
X return ((kbmode & 0x01) ? TRUE : FALSE);
X#endif
X#ifdef DOS
X regs.h.ah = 0x33;
X regs.h.al = 0x00;
X int86(0x21, ®s, ®s);
X return ((bool) regs.h.dl);
X#endif
X#ifdef OS2
X# if defined(CURSES__32BIT__) || defined(CSET2)
X void (*oldAction) (int);
X oldAction = signal (SIGINT, SIG_DFL);
X if (oldAction == SIG_ERR) return FALSE;
X else signal (SIGINT, oldAction);
X return (oldAction != SIG_IGN);
X# else
X PFNSIGHANDLER oldHandler, oldHandler1;
X USHORT oldAction, oldAction1;
X /* get the current state, and set to ignore */
X DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction,
X SIGA_IGNORE, SIG_CTRLBREAK);
X /* restore the previous state */
X DosSetSigHandler(oldHandler, &oldHandler1, &oldAction1,
X oldAction, SIG_CTRLBREAK);
X return(oldAction != SIGA_IGNORE);
X# endif
X#endif
X}
END_OF_FILE
if test 1949 -ne `wc -c <'private/_getcbrk.c'`; then
echo shar: \"'private/_getcbrk.c'\" unpacked with wrong size!
fi
# end of 'private/_getcbrk.c'
fi
if test -f 'private/_rawgetc.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_rawgetc.c'\"
else
echo shar: Extracting \"'private/_rawgetc.c'\" \(1992 characters\)
sed "s/^X//" >'private/_rawgetc.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__rawgetc = "$Header: c:/curses/private/RCS/_rawgetc.c%v 2.0 1992/11/15 03:24:31 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_rawgetch() - Returns the next uninterpreted character (if available).
X
X PDCurses Description:
X Gets a character without any interpretation at all and returns
X it. If keypad mode is active for the designated window,
X function key translation will be performed. Otherwise,
X function keys are ignored. If nodelay mode is active in the
X window, then PDC_rawgetch() returns -1 if no character is
X available.
X
X WARNING: It is unknown whether the FUNCTION key translation
X is performed at this level. --Frotz 911130 BUG
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_rawgetch( void );
X
X**man-end**********************************************************************/
X
Xint PDC_rawgetch(void)
X{
Xextern int c_pindex; /* putter index */
Xextern int c_gindex; /* getter index */
Xextern int c_ungind; /* wungetch() push index */
Xextern chtype c_ungch[NUNGETCH]; /* array of ungotten chars */
Xextern WINDOW* _getch_win_;
X/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */
X /* is the same window - all references to w changed*/
X /* to _getch_win_ - marked with @@ */
X
X signed c;
X signed oldc;
X
X if (_getch_win_ == (WINDOW *)NULL) /* @@ */
X return( -1 );
X
X if (_getch_win_->_nodelay && !typeahead(stdin)) /* @@ */
X return( -1 );
X
X while (1) /* loop to get valid char */
X {
X c = PDC_get_bios_key();
X oldc = c;
X /*
X * Return the key if it is not a special key.
X */
X if ((c = PDC_validchar(c)) >= 0)
X { /* get & check next char */
X return( c );
X }
X if (_getch_win_->_use_keypad)
X return( oldc );
X }
X}
END_OF_FILE
if test 1992 -ne `wc -c <'private/_rawgetc.c'`; then
echo shar: \"'private/_rawgetc.c'\" unpacked with wrong size!
fi
# end of 'private/_rawgetc.c'
fi
if test -f 'private/_setcrsr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_setcrsr.c'\"
else
echo shar: Extracting \"'private/_setcrsr.c'\" \(1880 characters\)
sed "s/^X//" >'private/_setcrsr.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__setcrsr = "$Header: c:/curses/private/RCS/_setcrsr.c%v 2.0 1992/11/15 03:24:36 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_set_cursor_mode() - Set the cursor start and stop scan lines.
X
X PDCurses Description:
X Sets the cursor type to begin in scan line startrow and end in
X scan line endrow. Both values should be 0-31.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_set_cursor_mode( int startrow, int endrow );
X
X**man-end**********************************************************************/
X
Xint PDC_set_cursor_mode( int startrow, int endrow )
X{
X#ifdef FLEXOS
X /*
X * Under FLEXOS, this routine translates the input parameters in the
X * following way:
X *
X * startrow --> visible_cursor endrow --> cursor type:
X * underline = 0; block = 1;
X *
X * VCWM_CURSOR 0x0100 bit - 8 Cursor off VCWM_BLOCK
X * 0x0200 bit - 9 Block Cursor
X *
X */
X unsigned short mybuff = 0;
X
X retcode = s_getfield(T_VIRCON, VC_MODE, 1L, (void far *) &mybuff, 2L);
X if (retcode < 0L)
X return( ERR );
X if (startrow)
X mybuff &= ~VCWM_CURSOR;
X else
X mybuff |= VCWM_CURSOR;
X
X if (endrow)
X mybuff |= VCWM_BLOCK;
X else
X mybuff &= ~VCWM_BLOCK;
X
X retcode = s_setfield(T_VIRCON, VC_MODE, 1L, (void far *) &mybuff, 2L);
X return( (retcode < 0L) ? ERR : OK );
X#endif
X#ifdef DOS
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( OK );
X#endif
X#ifdef OS2
X VIOCURSORINFO cursorInfo;
X
X cursorInfo.yStart = startrow;
X cursorInfo.cEnd = endrow;
X cursorInfo.cx = 1;
X cursorInfo.attr = 0;
X return (VioSetCurType (&cursorInfo, 0) == 0);
X#endif
X}
END_OF_FILE
if test 1880 -ne `wc -c <'private/_setcrsr.c'`; then
echo shar: \"'private/_setcrsr.c'\" unpacked with wrong size!
fi
# end of 'private/_setcrsr.c'
fi
if test -f 'private/_sgetnl.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_sgetnl.c'\"
else
echo shar: Extracting \"'private/_sgetnl.c'\" \(1950 characters\)
sed "s/^X//" >'private/_sgetnl.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#if BUG68K
X#ifndef NDEBUG
Xchar *rcsid__sgetnl = "$Header: c:/curses/private/RCS/_sgetnl.c%v 2.0 1992/11/15 03:24:38 MH Rel $";
X#endif
X
Xvoid c_setnl( char* ); /* conv nl -> CTRL-\ */
Xvoid c_getnl( char* ); /* conv CTRL-\ -> nl */
X/*man-start*********************************************************************
X
X _setnl() - BUG68K: set newline for 68000 C compiler
X
X PDCurses Description:
X This is a private PDCurses function.
X
X This function circumvents a problem in the 68000 C library: If
X the standard sprintf is used, it will ignore any newlines in
X the format string. Therefore this routine changes the newlines
X to CTRL-\ characters, to be restored later by the getnl()
X function.
X
X PDCurses Return Value:
X This function does not return a value.
X
X PDCurses Errors:
X There are no defined errors for this routine.
X
X Portability:
X PDCurses void c_setnl( char* fmt ); /* BUG68K only */
X
X**man-end**********************************************************************/
X
Xvoid _setnl(char *fmt)
X{
X while (*fmt)
X {
X if (*fmt == '\n')
X *fmt = 0x1c;
X fmt++;
X }
X}
X
X
X
X
X/*----------------------------------------------------------------------
X$ _getnl() - BUG68K: get newline for 68000 C compiler
X$
X$ PDCurses Description:
X$ This is a private PDCurses function.
X$
X$ This function circumvents a problem in the 68000 C library: If
X$ the standard sprintf is used, it will ignore any newlines in
X$ the format string. Therefore this routine changes CTRL-\
X$ characters (already set by setnl()) back to newlines.
X$
X$ PDCurses Return Value:
X$ This function does not return a value.
X$
X$ PDCurses Errors:
X$ There are no defined errors for this routine.
X$
X$ Portability:
X$ PDCurses void c_getnl( char* fmt ); /* BUG68K only */
X$
X$----------------------------------------------------------------------
X*/
Xvoid _getnl(fmt)
Xchar* fmt;
X{
X while (*fmt)
X {
X if (*fmt == 0x1c)
X *fmt = '\n';
X }
X}
X#endif
END_OF_FILE
if test 1950 -ne `wc -c <'private/_sgetnl.c'`; then
echo shar: \"'private/_sgetnl.c'\" unpacked with wrong size!
fi
# end of 'private/_sgetnl.c'
fi
if test -f 'private/_sysgetc.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_sysgetc.c'\"
else
echo shar: Extracting \"'private/_sysgetc.c'\" \(1701 characters\)
sed "s/^X//" >'private/_sysgetc.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__sysgetc = "$Header: c:/curses/private/RCS/_sysgetc.c%v 2.0 1992/11/15 03:24:39 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_sysgetch() - Return a character using default system routines.
X
X PDCurses Description:
X This is a private PDCurses function.
X
X Gets a character without normal ^S, ^Q, ^P and ^C interpretation
X and returns it. If keypad mode is active for the designated
X window, function key translation will be performed. Otherwise,
X function keys are ignored. If nodelay mode is active in the
X window, then sysgetch() returns -1 if no character is
X available.
X
X PDCurses Return Value:
X This function returns OK upon success otherwise ERR is returned.
X
X PDCurses Errors:
X No errors are defined for this routine.
X
X Portability:
X PDCurses int PDC_sysgetch( void );
X
X**man-end**********************************************************************/
X
Xint PDC_sysgetch(void)
X{
Xextern WINDOW* _getch_win_;
X/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */
X /* is the same window - all references to w changed*/
X /* to _getch_win_ - marked with @@ */
X
X signed c;
X
X if (_getch_win_ == (WINDOW *)NULL) /* @@ */
X return (-1);
X
X if (_getch_win_->_nodelay && !typeahead(stdin))
X return (-1);
X
X while (1)
X {
X c = PDC_get_bios_key();
X#if defined (DOS) || defined (OS2)
X /*
X * Return the key if it is not a special key.
X */
X if (c & A_CHARTEXT)
X return (c & A_CHARTEXT);
X#endif
X if ((c = PDC_validchar(c)) >= 0)
X {
X return (c); /* get & check next char */
X }
X }
X}
END_OF_FILE
if test 1701 -ne `wc -c <'private/_sysgetc.c'`; then
echo shar: \"'private/_sysgetc.c'\" unpacked with wrong size!
fi
# end of 'private/_sysgetc.c'
fi
if test -f 'tools/manext.def' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tools/manext.def'\"
else
echo shar: Extracting \"'tools/manext.def'\" \(72 characters\)
sed "s/^X//" >'tools/manext.def' <<'END_OF_FILE'
XNAME manext windowcompat
X
XDESCRIPTION 'test'
X
XPROTMODE
X
XSTACKSIZE 32767
END_OF_FILE
if test 72 -ne `wc -c <'tools/manext.def'`; then
echo shar: \"'tools/manext.def'\" unpacked with wrong size!
fi
# end of 'tools/manext.def'
fi
echo shar: End of archive 8 \(of 11\).
cp /dev/null ark8isdone
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: portable/colorcon.c portable/def_shel.c portable/flash.c
# portable/idlok.c portable/intrflus.c portable/keypad.c
# portable/leaveok.c portable/paircont.c portable/savetty.c
# portable/set_term.c portable/touchwin.c portable/waddstr.c
# portable/wdeletel.c portable/winsertl.c portable/wmove.c
# portable/wrefresh.c private/_getcols.c private/_getcrsr.c
# private/_getfont.c private/_gotoxy.c private/_print.c
# private/_putc.c private/_putctty.c private/_scrclos.c
# private/_set8025.c private/_setscrn.c private/_splitpl.c
# Wrapped by kent@sparky on Wed Nov 18 21:44:09 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 9 (of 11)."'
if test -f 'portable/colorcon.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/colorcon.c'\"
else
echo shar: Extracting \"'portable/colorcon.c'\" \(1404 characters\)
sed "s/^X//" >'portable/colorcon.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef color_content
X
X#ifndef NDEBUG
Xchar *rcsid_colorcon = "$Header: c:/curses/portable/RCS/colorcon.c%v 2.0 1992/11/15 03:28:48 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X color_content() - Obtain color content information.
X
X PDCurses Description:
X
X This routine obtains the current color-content information of a given
X color.
X The routine uses four arguments: the color number, which must
X be a value between 0 and COLORS-1, and the addresses of three
X short integers for storing the obtained information of the color
X components red, green and blue. The function stores the current
X values at these adresses passed.
X
X ***** This function doesn't do anything yet *****
X
X PDCurses Return Value:
X This function returns ERR if the color is out of range otherwise
X it returns OK.
X
X PDCurses Errors:
X N/A
X
X Portability:
X PDCurses int color_content( int color, short *red, short *green, short *blue);
X SYS V curses int color_content( int color, short *red, short *green, short *blue);
X
X**man-end**********************************************************************/
X
X
Xint color_content(int color, short *red, short *green, short *blue)
X{
X extern int COLORS;
X
X if (color >= COLORS -1 || color < 1)
X return(ERR);
X/*
X * This function doesn't do anything yet...
X */
X return(ERR);
X}
END_OF_FILE
if test 1404 -ne `wc -c <'portable/colorcon.c'`; then
echo shar: \"'portable/colorcon.c'\" unpacked with wrong size!
fi
# end of 'portable/colorcon.c'
fi
if test -f 'portable/def_shel.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/def_shel.c'\"
else
echo shar: Extracting \"'portable/def_shel.c'\" \(1612 characters\)
sed "s/^X//" >'portable/def_shel.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef def_shell_mode
X
X#ifndef NDEBUG
Xchar *rcsid_def_shel = "$Header: c:/curses/portable/RCS/def_shel.c%v 2.0 1992/11/15 03:28:49 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X def_shell_mode() - Save terminal mode
X
X X/Open Description:
X Save the current terminal modes as the "program" (in CURSES) or
X "shell" (not in CURSES) state for use by the reset_prog_mode()
X and reset_shell_mode() functions. This is done automatically by
X initscr().
X
X PDCurses Description:
X PDCurses maintains a WINDOW* that contains the original user's
X screen upon startup. This might be useful for returning the
X user's environment to its (near) original state.
X
X This is unimplemented at this time.
X
X X/Open Return Value:
X The def_shell_mode() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int def_shell_mode( void );
X X/Open Dec '88 int def_shell_mode( void );
X BSD Curses
X SYS V Curses int def_shell_mode( void );
X
X**man-end**********************************************************************/
X
Xint def_shell_mode(void)
X{
X#ifdef FLEXOS
X _flexos_8bitmode();
X#endif
X c_sh_tty.been_set = TRUE;
X#if defined(DOS) || defined(OS2)
X# if SMALL || MEDIUM
X movedata( FP_SEG(&_cursvar), FP_OFF(&_cursvar),
X FP_SEG(&c_sh_tty.saved), FP_OFF(&c_sh_tty.saved),
X sizeof(SCREEN) );
X# else
X memcpy(&c_sh_tty.saved, &_cursvar, sizeof(SCREEN));
X# endif
X#endif
X return( OK );
X}
END_OF_FILE
if test 1612 -ne `wc -c <'portable/def_shel.c'`; then
echo shar: \"'portable/def_shel.c'\" unpacked with wrong size!
fi
# end of 'portable/def_shel.c'
fi
if test -f 'portable/flash.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/flash.c'\"
else
echo shar: Extracting \"'portable/flash.c'\" \(1447 characters\)
sed "s/^X//" >'portable/flash.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef flash
X
X#ifndef NDEBUG
Xchar *rcsid_flash = "$Header: c:/curses/portable/RCS/flash.c%v 2.0 1992/11/15 03:28:52 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X flash() - generate audio-visual alarm
X
X X/Open Description:
X This routine is used to signal the terminal user. The beep()
X function will sound the audible bell on the terminal, if possible
X and if not, will flash the screen (visible bell), if possible.
X The flash() function will flash the screen, and if that is not
X possible, will sound the audible signal. If neither signal is
X possible, nothing will happen. Nearly all terminals have an
X audible signal (bell or beep), but only some can flash the screen.
X
X X/Open Return Value:
X The beep() and flash() functions return OK on success and ERR on
X error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int flash( void );
X X/Open Dec '88 int flash( void );
X BSD Curses int flash( void );
X SYS V Curses int flash( void );
X
X**man-end**********************************************************************/
X
Xint flash(void)
X{
X extern unsigned char atrtab[MAX_ATRTAB];
X int i;
X
X PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, (chtype)(atrtab[264] << 8));
X delay_output( 50 );
X PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, (chtype)(atrtab[265] << 8));
X wrefresh(curscr);
X return( OK );
X}
END_OF_FILE
if test 1447 -ne `wc -c <'portable/flash.c'`; then
echo shar: \"'portable/flash.c'\" unpacked with wrong size!
fi
# end of 'portable/flash.c'
fi
if test -f 'portable/idlok.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/idlok.c'\"
else
echo shar: Extracting \"'portable/idlok.c'\" \(1550 characters\)
sed "s/^X//" >'portable/idlok.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef idlok
X
X#ifndef NDEBUG
Xchar *rcsid_idlok = "$Header: c:/curses/portable/RCS/idlok.c%v 2.0 1992/11/15 03:28:55 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X idlok() - Enable use of Insert/Delete Line
X
X X/Open Description:
X If enabeld (bf is TRUE), curses will use the insert/delete line
X feature of terminals so equipped. If disabled, curses will not
X use this feature. (The insert/delete character feature is always
X used.) This option should be enabled only if the application
X needs insert/delete line; for example, for a screen editor. It
X is disabled by default because insert/delete line tends to be
X visually annoying when used in applications where it isn't really
X needed. If insert/delete line cannot be used, curses will redraw
X the changed portions of all lines.
X
X PDCurses Description:
X This is provided for portability. This may have some value for
X the FLEXOS platform, but there is no code in PDCurses at this
X time (910725) that takes advantage of this.
X
X X/Open Return Value:
X The idlok() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int idlok( WINDOW* win, bool bf );
X X/Open Dec '88 int idlok( WINDOW* win, bool bf );
X BSD Curses
X SYS V Curses
X
X**man-end**********************************************************************/
X
Xint idlok( WINDOW *win, bool bf )
X{
X win->_use_idl = bf;
X return( OK );
X}
END_OF_FILE
if test 1550 -ne `wc -c <'portable/idlok.c'`; then
echo shar: \"'portable/idlok.c'\" unpacked with wrong size!
fi
# end of 'portable/idlok.c'
fi
if test -f 'portable/intrflus.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/intrflus.c'\"
else
echo shar: Extracting \"'portable/intrflus.c'\" \(1488 characters\)
sed "s/^X//" >'portable/intrflus.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef intrflush
X
X#ifndef NDEBUG
Xchar *rcsid_intrflus = "$Header: c:/curses/portable/RCS/intrflus.c%v 2.0 1992/11/15 03:28:57 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X intrflush() - enable flush on interrupt
X
X X/Open Description:
X If this option is enabled (bf is TRUE), and an interrupt is
X pressed on the keyboard (INTR, BREAK, or QUIT) all output in
X the terminal driver queue will be flushed, giving the effect
X of faster response to the interrupt but causing curses to have
X the wrong idea of what is on the screen. Disabling the option
X prevents the flush. The default for the option is inherited
X from the terminal driver settings. The window argument is
X ignored.
X
X PDCurses Description:
X No additional functionality.
X
X X/Open Return Value:
X The intrflush() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int intrflush( WINDOW* win, bool bf );
X X/Open Dec '88 int intrflush( WINDOW* win, bool bf );
X BSD Curses
X SYS V Curses
X
X**man-end**********************************************************************/
X
Xint intrflush( WINDOW *win, bool bf )
X{
X#ifdef TC
X# pragma argsused
X#endif
X int y;
X int maxy;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X maxy = win->_maxy - 1;
X
X for (y = 0; y <= maxy; y++)
X {
X win->_firstch[y] = _NO_CHANGE;
X }
X return( OK );
X}
END_OF_FILE
if test 1488 -ne `wc -c <'portable/intrflus.c'`; then
echo shar: \"'portable/intrflus.c'\" unpacked with wrong size!
fi
# end of 'portable/intrflus.c'
fi
if test -f 'portable/keypad.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/keypad.c'\"
else
echo shar: Extracting \"'portable/keypad.c'\" \(1551 characters\)
sed "s/^X//" >'portable/keypad.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef keypad
X
X#ifndef NDEBUG
Xchar *rcsid_keypad = "$Header: c:/curses/portable/RCS/keypad.c%v 2.0 1992/11/15 03:28:58 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X keypad() - enable keypad
X
X X/Open Description:
X This function changes the keypad option of the user's terminal.
X If enabled (bf is TRUE), the user can press a function key (such
X as the left arrow key) and getch() will return a single value
X that represents the KEY_LEFT function key. (See Section 11.3.3,
X Input Values.) If disabled, curses will not treat function keys
X as special keys and the program has to interpret the escape
X sequences itself. If the keypad is enabled, the terminal keypad
X is turned on before input begins.
X
X PDCurses Description:
X In the above text, substitute the following string:
X "escape sequences" -> "scan codes"
X "Section 11.3.3" -> "curses.h" or "intro.man"
X
X This routine is also provided as a macro.
X
X X/Open Return Value:
X The keypad() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int keypad( WINDOW* win, bool bf );
X X/Open Dec '88 int keypad( WINDOW* win, bool bf );
X BSD Curses int keypad( WINDOW* win, bool bf );
X SYS V Curses int keypad( WINDOW* win, bool bf );
X
X**man-end**********************************************************************/
X
Xint keypad( WINDOW *win, bool bf )
X{
X win->_use_keypad = bf;
X return( OK );
X}
END_OF_FILE
if test 1551 -ne `wc -c <'portable/keypad.c'`; then
echo shar: \"'portable/keypad.c'\" unpacked with wrong size!
fi
# end of 'portable/keypad.c'
fi
if test -f 'portable/leaveok.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/leaveok.c'\"
else
echo shar: Extracting \"'portable/leaveok.c'\" \(1429 characters\)
sed "s/^X//" >'portable/leaveok.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef leaveok
X
X#ifndef NDEBUG
Xchar *rcsid_leaveok = "$Header: c:/curses/portable/RCS/leaveok.c%v 2.0 1992/11/15 03:28:59 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X leaveok() - enable non-tracking cursor
X
X X/Open Description:
X Normally, the hardware cursor is left at the location of the
X window being refreshed. This option allows the cursor to be
X left whereever the update happens to leave it. It is useful
X for applications where the cursor is not used, since it reduces
X the need for cursor motions. If possible, the cursor is made
X invisible when this option is enabled.
X
X PDCurses Description:
X Though not explicitly stated, the cursor will be made visible
X again, if leaveok() is passed a FALSE value.
X (Frotz:911226 Comments?)
X
X X/Open Return Value:
X The leaveok() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int leaveok( WINDOW* win, bool bf );
X X/Open Dec '88 int leaveok( WINDOW* win, bool bf );
X BSD Curses int leaveok( WINDOW* win, bool bf );
X SYS V Curses int leaveok( WINDOW* win, bool bf );
X
X**man-end**********************************************************************/
X
Xint leaveok( WINDOW *win, bool bf )
X{
X if ((win->_leave = bf) != 0) cursoff();
X else curson();
X return( OK );
X}
END_OF_FILE
if test 1429 -ne `wc -c <'portable/leaveok.c'`; then
echo shar: \"'portable/leaveok.c'\" unpacked with wrong size!
fi
# end of 'portable/leaveok.c'
fi
if test -f 'portable/paircont.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/paircont.c'\"
else
echo shar: Extracting \"'portable/paircont.c'\" \(1566 characters\)
sed "s/^X//" >'portable/paircont.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef pair_content
X
X#ifndef NDEBUG
Xchar *rcsid_paircont = "$Header: c:/curses/portable/RCS/paircont.c%v 2.0 1992/11/15 03:29:07 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X pair_content() - Obtain color-pair information.
X
X PDCurses Description:
X
X This routine is used to determine what the colors of a given color-pair
X consist of.
X
X The routine uses three arguments: the colorpair number which
X must be a value between 1 and COLOR_PAIRS-1 and the adresses of
X two shorts for storing the obtained color components of foreground
X and background. The function will store the current values at these
X addresses passed. The values will be between 0 and COLORS-1.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a colorpair outside of the
X range specified above.
X
X Portability:
X PDCurses int pair_content( int colorpair, short *foreground, short *background);
X SYS V Curses int pair_content( int colorpair, short *foreground, short *background);
X
X**man-end**********************************************************************/
X
X
Xint pair_content(int colorpair,short *foreground,short *background)
X{
X extern int COLOR_PAIRS;
X extern unsigned char atrtab[MAX_ATRTAB];
X
X if (colorpair >= COLOR_PAIRS || colorpair < 1)
X return(ERR);
X
X *foreground = (short)(atrtab[colorpair] & 0x0F);
X *background = (short)((atrtab[colorpair] & 0xF0)>>4);
X return(OK);
X}
END_OF_FILE
if test 1566 -ne `wc -c <'portable/paircont.c'`; then
echo shar: \"'portable/paircont.c'\" unpacked with wrong size!
fi
# end of 'portable/paircont.c'
fi
if test -f 'portable/savetty.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/savetty.c'\"
else
echo shar: Extracting \"'portable/savetty.c'\" \(1540 characters\)
sed "s/^X//" >'portable/savetty.c' <<'END_OF_FILE'
X#ifndef NO_MEMORY_H
X#include <memory.h>
X#endif
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef savetty
X
X#ifndef NDEBUG
Xchar *rcsid_savetty = "$Header: c:/curses/portable/RCS/savetty.c%v 2.0 1992/11/15 03:29:13 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X savetty() - save/restore terminal modes
X
X X/Open Description:
X These routines save and restore the state of the terminal modes.
X The savetty() function saves the current state in a buffer and
X resetty() restores the state to what it was at the last call to
X savetty().
X
X PDCurses Description:
X FYI: It is very unclear whether this is a duplication of the
X reset_prog_mode() and reset_shell_mode() functions or whether
X this is a backing store type of operation. At this time, they
X are implemented similar to the reset_*_mode() routines.
X
X X/Open Return Value:
X The savetty() function returns OK upon success otherwise ERR is
X returned.
X
X Portability:
X PDCurses int savetty( void );
X X/Open Dec '88 int savetty( void );
X SysV Curses int savetty( void );
X BSD Curses int savetty( void );
X
X**man-end**********************************************************************/
X
Xint savetty(void)
X{
X c_save_tty.been_set = TRUE;
X#if defined(DOS) || defined(OS2)
X# if SMALL || MEDIUM
X movedata( FP_SEG(&_cursvar), FP_OFF(&_cursvar),
X FP_SEG(&c_save_tty.saved), FP_OFF(&c_save_tty.saved),
X sizeof(SCREEN) );
X# else
X memcpy(&c_save_tty.saved, &_cursvar, sizeof(SCREEN));
X# endif
X#endif
X return( OK );
X}
END_OF_FILE
if test 1540 -ne `wc -c <'portable/savetty.c'`; then
echo shar: \"'portable/savetty.c'\" unpacked with wrong size!
fi
# end of 'portable/savetty.c'
fi
if test -f 'portable/set_term.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/set_term.c'\"
else
echo shar: Extracting \"'portable/set_term.c'\" \(1600 characters\)
sed "s/^X//" >'portable/set_term.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef set_term
X
X#ifndef NDEBUG
Xchar *rcsid_set_term = "$Header: c:/curses/portable/RCS/set_term.c%v 2.0 1992/11/15 03:29:15 MH Rel $";
X#endif
X
X#if EMALLOC
Xvoid* emalloc( size_t );
Xvoid* ecalloc( size_t, size_t );
Xvoid efree( void* );
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X set_term() - switch between terminals
X
X X/Open Description:
X This function is used to switch between different terminals.
X The screen reference 'new' becomes the new current terminal.
X The previous terminal is returned by the routine. This is the
X only routine which manipulates SCREEN pointers; all other routines
X affect only the current terminal.
X
X PDCurses Description:
X FYI: Dual monitor support is not quite complete. Nothing will
X happen if you try to call this routine.
X
X X/Open Return Value:
X The set_term() function returns a pointer to the previous
X SCREEN structure on success otherwise a NULL pointer is
X returned.
X
X X/Open Errors:
X No errors are defined for this function.
X
X PDCurses Errors:
X It is an error to call this routine at this time.
X It is an error to pass a NULL SCREEN pointer.
X
X Portability:
X PDCurses SCREEN* set_term( SCREEN* new );
X X/Open Dec '88 SCREEN* set_term( SCREEN* new );
X BSD Curses
X SYS V Curses SCREEN* set_term( SCREEN* new );
X
X**man-end**********************************************************************/
X
XSCREEN* set_term( SCREEN *new )
X{
X#ifdef TC
X# pragma argsused
X#endif
X return( &_cursvar ); /* We only have one screen supported right now */
X}
END_OF_FILE
if test 1600 -ne `wc -c <'portable/set_term.c'`; then
echo shar: \"'portable/set_term.c'\" unpacked with wrong size!
fi
# end of 'portable/set_term.c'
fi
if test -f 'portable/touchwin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/touchwin.c'\"
else
echo shar: Extracting \"'portable/touchwin.c'\" \(1458 characters\)
sed "s/^X//" >'portable/touchwin.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef touchwin
X
X#ifndef NDEBUG
Xchar *rcsid_touchwin = "$Header: c:/curses/portable/RCS/touchwin.c%v 2.0 1992/11/15 03:29:18 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X touchwin() - touch window
X
X X/Open Description:
X Throw away all optimisation information about which parts of the
X window have been touched, by pretending that the entire window has
X been drawn on. This is sometimes necessary when using overlapping
X windows, since a change to one window will affect the other window,
X but the records of which lines have been changed in the other
X window will not reflect the change.
X
X PDCurses Description:
X No additional functionality in the PDCurses library.
X
X X/Open Return Value:
X The touchwin() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to pass a NULL window.
X
X Portability:
X PDCurses int touchwin( WINDOW* win );
X SysV Curses int touchwin( WINDOW* win );
X BSD Curses int touchwin( WINDOW* win );
X X/Open Dec '88 int touchwin( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint touchwin(WINDOW *win)
X{
X int y;
X int maxy;
X int maxx;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X maxy = win->_maxy - 1;
X maxx = win->_maxx - 1;
X
X for (y = 0; y <= maxy; y++)
X {
X win->_firstch[y] = 0;
X win->_lastch[y] = maxx;
X }
X return( OK );
X}
END_OF_FILE
if test 1458 -ne `wc -c <'portable/touchwin.c'`; then
echo shar: \"'portable/touchwin.c'\" unpacked with wrong size!
fi
# end of 'portable/touchwin.c'
fi
if test -f 'portable/waddstr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/waddstr.c'\"
else
echo shar: Extracting \"'portable/waddstr.c'\" \(1517 characters\)
sed "s/^X//" >'portable/waddstr.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef waddstr
X
X#ifndef NDEBUG
Xchar *rcsid_waddstr = "$Header: c:/curses/portable/RCS/waddstr.c%v 2.0 1992/11/15 03:29:21 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X waddstr() - add string to window
X
X X/Open Description:
X These routines write all the characters of the null-terminated
X string str on the given window. The functionality is equivalent
X to calling waddch() once for each character in the string.
X
X NOTE: addstr(), mvaddstr(), and mvwaddstr() are macros.
X
X PDCurses Description:
X The *raw*() routines output 8 bit values. These contrast to their
X normal counterparts which output 7 bit values and convert control
X character to the ^X notation.
X
X str is a standard 8 bit character string WITHOUT embedded attributes.
X
X X/Open Return Value:
X The waddstr() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int waddstr( WINDOW* win, char* str );
X X/Open Dec '88 int waddstr( WINDOW* win, char* str );
X BSD Curses int waddstr( WINDOW* win, char* str );
X SYS V Curses int waddstr( WINDOW* win, char* str );
X
X**man-end**********************************************************************/
X
Xint waddstr(WINDOW *win, char *str)
X{
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X while (*str)
X {
X if (waddch(win, *str++) == ERR)
X {
X return( ERR );
X }
X }
X return( OK );
X}
END_OF_FILE
if test 1517 -ne `wc -c <'portable/waddstr.c'`; then
echo shar: \"'portable/waddstr.c'\" unpacked with wrong size!
fi
# end of 'portable/waddstr.c'
fi
if test -f 'portable/wdeletel.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wdeletel.c'\"
else
echo shar: Extracting \"'portable/wdeletel.c'\" \(1601 characters\)
sed "s/^X//" >'portable/wdeletel.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wdeleteln
X
X#ifndef NDEBUG
Xchar *rcsid_wdeletel = "$Header: c:/curses/portable/RCS/wdeletel.c%v 2.0 1992/11/15 03:29:06 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wdeleteln() - remove line from window
X
X X/Open Description:
X The line under the cursor in the window is deleted. All
X lines below the current line are moved up one line. The
X bottom line of the window is cleared. The cursor position
X does not change.
X
X NOTE: deleteln() is a macro.
X
X PDCurses Description:
X No additional functionality.
X
X X/Open Return Value:
X The wdeleteln() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to pass a NULL window pointer to this routine.
X
X Portability:
X PDCurses int wdeleteln( WINDOW* win );
X X/Open Dec '88 int wdeleteln( WINDOW* win );
X BSD Curses int wdeleteln( WINDOW* win );
X SYS V Curses int wdeleteln( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint wdeleteln(WINDOW *win)
X{
Xstatic chtype blank;
X chtype* end;
X chtype* temp;
X int y;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X blank = win->_blank | win->_attrs;
X temp = win->_y[win->_cury];
X
X for (y = win->_cury; y < win->_bmarg; y++)
X {
X win->_y[y] = win->_y[y + 1];
X win->_firstch[y] = 0;
X win->_lastch[y] = win->_maxx - 1;
X }
X
X win->_firstch[y] = 0;
X win->_lastch[y] = win->_maxx - 1;
X win->_y[win->_bmarg] = temp;
X
X for (end = &(temp[win->_maxx - 1]); temp <= end;)
X {
X *temp++ = blank;
X }
X return( OK );
X}
END_OF_FILE
if test 1601 -ne `wc -c <'portable/wdeletel.c'`; then
echo shar: \"'portable/wdeletel.c'\" unpacked with wrong size!
fi
# end of 'portable/wdeletel.c'
fi
if test -f 'portable/winsertl.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/winsertl.c'\"
else
echo shar: Extracting \"'portable/winsertl.c'\" \(1554 characters\)
sed "s/^X//" >'portable/winsertl.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef winsert
X
X#ifndef NDEBUG
Xchar *rcsid_winsertl = "$Header: c:/curses/portable/RCS/winsertl.c%v 2.0 1992/11/15 03:29:09 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X winsert() - Insert line
X
X X/Open Description:
X A blank line is inserted above the current line and the bottom
X line is lost.
X
X NOTE: insertln() is a macro.
X
X PDCurses Description:
X The mv[w]insertln() routines have been added to the X/Open
X interface specification as a convienience.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int winsertln( WINDOW* win );
X X/Open Dec '88 int winsertln( WINDOW* win );
X BSD Curses int winsertln( WINDOW* win );
X SYS V Curses int winsertln( WINDOW* win );
X
X
X**man-end**********************************************************************/
X
Xint winsertln(WINDOW *win)
X{
X chtype blank;
X chtype* temp;
X chtype* end;
X short y;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X blank = win->_blank | win->_attrs;
X temp = win->_y[win->_bmarg];
X
X for (y = win->_bmarg; y > win->_cury; y--)
X {
X win->_y[y] = win->_y[y - 1];
X win->_firstch[y] = 0;
X win->_lastch[y] = win->_maxx - 1;
X }
X
X win->_y[win->_cury] = temp;
X
X for (end = &temp[win->_maxx - 1]; temp <= end; temp++)
X {
X *temp = blank;
X }
X
X win->_firstch[win->_cury] = 0;
X win->_lastch[win->_cury] = win->_maxx - 1;
X
X return( OK );
X}
END_OF_FILE
if test 1554 -ne `wc -c <'portable/winsertl.c'`; then
echo shar: \"'portable/winsertl.c'\" unpacked with wrong size!
fi
# end of 'portable/winsertl.c'
fi
if test -f 'portable/wmove.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wmove.c'\"
else
echo shar: Extracting \"'portable/wmove.c'\" \(1553 characters\)
sed "s/^X//" >'portable/wmove.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wmove
X
X#ifndef NDEBUG
Xchar *rcsid_wmove = "$Header: c:/curses/portable/RCS/wmove.c%v 2.0 1992/11/15 03:29:27 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wmove() - Move cursor in window
X
X X/Open Description:
X The cursor associated with the window is moved to the given
X location. This does not move the physical cursor of the
X terminal until refresh() is called. The position specified is
X relative to the upper left corner of the window, which is (0,0).
X
X NOTE: move() is a macro.
X
X PDCurses Description:
X There may be additional [window oriented] move routines associated
X with other sections of the curses library. See those sections for
X details.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wmove( WINDOW* win, int y, int x );
X X/Open Dec '88 int wmove( WINDOW* win, int y, int x );
X BSD Curses int wmove( WINDOW* win, int y, int x );
X SYS V Curses int wmove( WINDOW* win, int y, int x );
X
X**man-end**********************************************************************/
X
Xint wmove(WINDOW *win, int y, int x)
X{
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X if ((x < 0) ||
X (y < 0) ||
X (x >= win->_maxx) ||
X (y >= win->_maxy) ||
X (y < win->_tmarg) ||
X (y > win->_bmarg))
X {
X return( ERR );
X }
X win->_curx = x;
X win->_cury = y;
X return( OK );
X}
END_OF_FILE
if test 1553 -ne `wc -c <'portable/wmove.c'`; then
echo shar: \"'portable/wmove.c'\" unpacked with wrong size!
fi
# end of 'portable/wmove.c'
fi
if test -f 'portable/wrefresh.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wrefresh.c'\"
else
echo shar: Extracting \"'portable/wrefresh.c'\" \(1445 characters\)
sed "s/^X//" >'portable/wrefresh.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wrefresh
X
X#ifndef NDEBUG
Xchar *rcsid_wrefresh = "$Header: c:/curses/portable/RCS/wrefresh.c%v 2.0 1992/11/15 03:29:28 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wrefresh() - refresh window
X
X X/Open Description:
X The routine wrefresh copies the named window to the physical
X terminal screen, taking into account what is already there in
X order to optimize cursor movement.
X
X The routine refresh does the same, using stdscr as a default
X screen.
X
X These routines must be called to get any output on the
X terminal, as other routines only manipulate data structures.
X
X Unless leaveok has been enabled, the physical cursor of the
X terminal is left at the location of the window's cursor.
X
X X/Open Return Value:
X The wrefresh() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int wrefresh( WINDOW* win );
X X/Open Dec '88 int wrefresh( WINDOW* win );
X BSD Curses int wrefresh( WINDOW* win );
X SYS V Curses int wrefresh( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint wrefresh(WINDOW *win)
X{
X if (win == (WINDOW *)NULL) return( ERR );
X if (win->_flags & _PAD) return( ERR );
X
X if (win == curscr)
X curscr->_clear = TRUE;
X else
X wnoutrefresh(win);
X doupdate();
X return( OK );
X}
END_OF_FILE
if test 1445 -ne `wc -c <'portable/wrefresh.c'`; then
echo shar: \"'portable/wrefresh.c'\" unpacked with wrong size!
fi
# end of 'portable/wrefresh.c'
fi
if test -f 'private/_getcols.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_getcols.c'\"
else
echo shar: Extracting \"'private/_getcols.c'\" \(1587 characters\)
sed "s/^X//" >'private/_getcols.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__getcols = "$Header: c:/curses/private/RCS/_getcols.c%v 2.0 1992/11/15 03:24:24 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_get_columns() - return width of screen/viewport.
X
X PDCurses Description:
X This is a private PDCurses function
X
X This function will return the width of the current screen.
X
X PDCurses Return Value:
X This routine will return OK upon success and otherwise ERR will be
X returned.
X
X PDCurses Errors:
X There are no defined errors for this routine.
X
X Portability:
X PDCurses int PDC_get_columns( void );
X
X**man-end**********************************************************************/
X
Xint PDC_get_columns(void)
X{
X#ifdef FLEXOS
X return( vir.vc_size.rs_ncols );
X#endif
X#ifdef DOS
X/* short far* CRT_COLS;*/
X int cols;
X char *env_cols;
X
X/* CRT_COLS = (short far *) 0x044aL;*/
X/* cols = *CRT_COLS;*/
X
X/* use the value from COLS environment variable, if set. MH 10-Jun-92 */
X/* and use the minimum of COLS and return from int10h MH 18-Jun-92 */
X regs.h.ah = 0x0f;
X int86(0x10, ®s, ®s);
X cols = (int)regs.h.ah;
X env_cols = (char *)getenv("COLS");
X if (env_cols != (char *)NULL)
X {
X cols = min(atoi(env_cols),cols);
X }
X return(cols);
X#endif
X#ifdef OS2
X VIOMODEINFO modeInfo;
X int cols;
X char *env_cols;
X
X modeInfo.cb = sizeof(modeInfo);
X VioGetMode(&modeInfo, 0);
X cols = modeInfo.col;
X env_cols = (char *)getenv("COLS");
X if (env_cols != (char *)NULL)
X {
X cols = min(atoi(env_cols),cols);
X }
X return(cols);
X#endif
X}
END_OF_FILE
if test 1587 -ne `wc -c <'private/_getcols.c'`; then
echo shar: \"'private/_getcols.c'\" unpacked with wrong size!
fi
# end of 'private/_getcols.c'
fi
if test -f 'private/_getcrsr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_getcrsr.c'\"
else
echo shar: Extracting \"'private/_getcrsr.c'\" \(1407 characters\)
sed "s/^X//" >'private/_getcrsr.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__getcrsr = "$Header: c:/curses/private/RCS/_getcrsr.c%v 2.0 1992/11/15 03:24:25 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_get_cursor_mode() - Get the cursor start and stop scan lines.
X
X PDCurses Description:
X Gets the cursor type to begin in scan line startrow and end in
X scan line endrow. Both values should be 0-31.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_get_cursor_mode( void );
X
X**man-end**********************************************************************/
X
Xint PDC_get_cursor_mode(void)
X{
X#ifdef FLEXOS
X /*
X * Under FLEXOS, this routine returns 1 if the cursor is on and 0 if
X * the cursor is off...
X */
X s_getfield(T_VIRCON, VC_MODE, STDOUT, (far BYTE *) & vir,
X sizeof(vir.vc_mode));
X
X if (vir.vc_mode & VCWM_CURSOR)
X return (TRUE);
X else
X return (FALSE);
X#endif
X#ifdef DOS
X short far* CURSOR_MODE;
X short cmode;
X
X CURSOR_MODE = (short far *) 0x0460L;
X cmode = *CURSOR_MODE;
X return (cmode);
X#endif
X#ifdef OS2
X VIOCURSORINFO cursorInfo;
X short cmode;
X
X VioGetCurType (&cursorInfo, 0);
X/* I am not sure about this JGB */
X cmode = ((cursorInfo.yStart << 8) | (cursorInfo.cEnd));
X return(cmode);
X#endif
X}
END_OF_FILE
if test 1407 -ne `wc -c <'private/_getcrsr.c'`; then
echo shar: \"'private/_getcrsr.c'\" unpacked with wrong size!
fi
# end of 'private/_getcrsr.c'
fi
if test -f 'private/_getfont.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_getfont.c'\"
else
echo shar: Extracting \"'private/_getfont.c'\" \(1621 characters\)
sed "s/^X//" >'private/_getfont.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__getfont = "$Header: c:/curses/private/RCS/_getfont.c%v 2.0 1992/11/15 03:24:25 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_get_font() - Get the current font size
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X This function returns the current font size. This function only
X works if the #define FAST_VIDEO is true.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X An ERR will be returned if FAST_VIDEO is not true.
X
X Portability:
X PDCurses int PDC_get_font( void );
X
X**man-end**********************************************************************/
X
Xint PDC_get_font(void)
X{
X#if defined (DOS) && defined (FAST_VIDEO)
X int retval;
X short far *POINTS;
X
X POINTS = (short far *) 0x0485L;
X retval = *POINTS;
X if ((retval == 0) && (_cursvar.adapter == _MDS_GENIUS))
X {
X retval = _FONT15; /* Assume the MDS Genius is in 66 line mode. */
X }
X switch (_cursvar.adapter)
X {
X case _EGACOLOR:
X case _EGAMONO:
X switch (retval)
X {
X case _FONT8:
X case _FONT14:
X break;
X default:
X retval = _FONT14;
X }
X break;
X
X case _VGACOLOR:
X case _VGAMONO:
X switch (retval)
X {
X case _FONT8:
X case _FONT14:
X case _FONT16:
X break;
X default:
X break;
X }
X break;
X default:
X break;
X }
X return( retval );
X#endif
X#ifdef OS2
X VIOMODEINFO modeInfo;
X modeInfo.cb = sizeof(modeInfo);
X /* set most parameters of modeInfo */
X VioGetMode(&modeInfo, 0);
X return ( modeInfo.vres / modeInfo.row);
X#endif
X}
END_OF_FILE
if test 1621 -ne `wc -c <'private/_getfont.c'`; then
echo shar: \"'private/_getfont.c'\" unpacked with wrong size!
fi
# end of 'private/_getfont.c'
fi
if test -f 'private/_gotoxy.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_gotoxy.c'\"
else
echo shar: Extracting \"'private/_gotoxy.c'\" \(1459 characters\)
sed "s/^X//" >'private/_gotoxy.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__gotoxy = "$Header: c:/curses/private/RCS/_gotoxy.c%v 2.0 1992/11/15 03:24:27 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_gotoxy() - position hardware cursor at (x, y)
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Moves the physical cursor to the desired address on the
X screen. We don't optimize here -- on a PC, it takes more time
X to optimize than to do things directly.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_gotoxy( int row, int col );
X
X**man-end**********************************************************************/
X
Xint PDC_gotoxy(int row, int col)
X{
X if ((_cursvar.cursrow == row) && (_cursvar.curscol == col))
X return( OK );
X
X#ifdef FLEXOS
X retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X if (retcode < 0L)
X return( ERR );
X vir.vc_cursor.pos_row = row;
X vir.vc_cursor.pos_col = col;
X retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X return( (retcode < 0L) ? ERR : OK );
X#endif
X#ifdef DOS
X regs.h.ah = 0x02;
X regs.h.bh = _cursvar.video_page;
X regs.h.dh = (unsigned char) row;
X regs.h.dl = (unsigned char) col;
X int86(0x10, ®s, ®s);
X return( OK );
X#endif
X#ifdef OS2
X VioSetCurPos (row, col, 0);
X#endif
X}
END_OF_FILE
if test 1459 -ne `wc -c <'private/_gotoxy.c'`; then
echo shar: \"'private/_gotoxy.c'\" unpacked with wrong size!
fi
# end of 'private/_gotoxy.c'
fi
if test -f 'private/_print.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_print.c'\"
else
echo shar: Extracting \"'private/_print.c'\" \(1628 characters\)
sed "s/^X//" >'private/_print.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#define NEEDS_OS2 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__print = "$Header: c:/curses/private/RCS/_print.c%v 2.0 1992/11/15 03:24:33 MH Rel $";
X#endif
X
X#ifdef OS2
X# if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(MSC)
X#define INCL_DOS
X#include <bsedos.h>
X#endif
Xchar Printer[]="LPT1:";
X#endif
X
X
X/*man-start*********************************************************************
X
X PDC_print() - Provides primitive access to the BIOS printer functions
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Implements write/init/read printer services at the BIOS level.
X
X This provides the basic support that PDCurses needs to dump the
X contents of windows or pads to the printer attached to the BIOS
X printer port.
X
X PDCurses Return Value:
X See the BIOS INT 0x17 specifications.
X
X PDCurses Errors:
X See the BIOS INT 0x17 specifications.
X
X Portability:
X PDCurses int PDC_print( int cmd, int byte, int port );
X
X**man-end**********************************************************************/
X
Xint PDC_print(int cmd, int byte, int port)
X{
X#ifdef FLEXOS
X return( OK );
X#endif
X#ifdef DOS
X int status = 0;
X
X regs.h.ah = (unsigned char)cmd;
X regs.h.al = (unsigned char)byte;
X regs.x.dx = (unsigned int)port;
X int86(0x17, ®s, ®s);
X status = regs.h.ah;
X return (status);
X#endif
X#ifdef OS2
X# if !defined (CURSES__32BIT__) && !defined(CSET2)
X HFILE Lpt;
X USHORT Action;
X USHORT NoWritten;
X if (DosOpen((PSZ)Printer, &Lpt, &Action, 0,0,0,0,0) != 0)
X return(ERR);
X DosWrite(Lpt,&byte,1,&NoWritten);
X DosClose(Lpt);
X return(NoWritten == 1);
X# endif
X#endif
X}
END_OF_FILE
if test 1628 -ne `wc -c <'private/_print.c'`; then
echo shar: \"'private/_print.c'\" unpacked with wrong size!
fi
# end of 'private/_print.c'
fi
if test -f 'private/_putc.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_putc.c'\"
else
echo shar: Extracting \"'private/_putc.c'\" \(1528 characters\)
sed "s/^X//" >'private/_putc.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__putc = "$Header: c:/curses/private/RCS/_putc.c%v 2.0 1992/11/15 03:24:30 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_putc() - Output a character in the current attribute.
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Outputs character 'chr' to screen in tty fashion. If a colour
X mode is active, the character is written with colour 'colour'.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_putc( chtype character, chtype color );
X
X**man-end**********************************************************************/
X
Xint PDC_putc( chtype character, chtype color )
X{
X#ifdef FLEXOS
X int x = color;
X retcode = s_write(0x00, 0x01L, (_far char *) &character, 1L, 0);
X return( (retcode < 0L) ? ERR : OK );
X#endif
X#ifdef DOS
X regs.h.ah = 0x0a; /* Avoid screen wrap. Don't advance cursor. */
X regs.h.al = (unsigned char) (character & A_CHARTEXT);
X regs.h.bh = _cursvar.video_page;
X regs.h.bl = (unsigned char) ((color & A_ATTRIBUTES) >> 8);
X regs.x.cx = 0;
X int86(0x10, ®s, ®s);
X return( OK );
X#endif
X#ifdef OS2
X int curRow = PDC_get_cur_row ();
X int curCol = PDC_get_cur_col ();
X
X VioWrtTTY ((PCH)&character, 1, 0);
X VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0);
X PDC_gotoxy (curRow, curCol);
X return( OK );
X#endif
X}
END_OF_FILE
if test 1528 -ne `wc -c <'private/_putc.c'`; then
echo shar: \"'private/_putc.c'\" unpacked with wrong size!
fi
# end of 'private/_putc.c'
fi
if test -f 'private/_putctty.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_putctty.c'\"
else
echo shar: Extracting \"'private/_putctty.c'\" \(1596 characters\)
sed "s/^X//" >'private/_putctty.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__putctty = "$Header: c:/curses/private/RCS/_putctty.c%v 2.0 1992/11/15 03:24:30 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_putctty() - Output a character and attribute in TTY fashion.
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Outputs character 'chr' to screen in tty fashion. If a colour
X mode is active, the character is written with colour 'colour'.
X
X This function moves the physical cursor after writing so the
X screen will scroll if necessary.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_putctty( chtype character, chtype color );
X
X**man-end**********************************************************************/
X
Xint PDC_putctty( chtype character, chtype color )
X{
X#ifdef FLEXOS
X int x = color;
X retcode = s_write(0x00, 0x01L, (_far char *) &character, 1L, 0);
X return( (retcode < 0L) ? ERR : OK );
X#endif
X#ifdef DOS
X regs.h.ah = 0x0e; /* Write in TTY fashion, advance cursor. */
X regs.h.al = (unsigned char) (character & A_CHARTEXT);
X regs.h.bh = _cursvar.video_page;
X regs.h.bl = (unsigned char) ((color & A_ATTRIBUTES) >> 8);
X int86(0x10, ®s, ®s);
X return( OK );
X#endif
X#ifdef OS2
X int curRow = PDC_get_cur_row ();
X int curCol = PDC_get_cur_col ();
X
X VioWrtTTY ((PCH)&character, 1, 0);
X VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0);
X return( OK );
X#endif
X}
END_OF_FILE
if test 1596 -ne `wc -c <'private/_putctty.c'`; then
echo shar: \"'private/_putctty.c'\" unpacked with wrong size!
fi
# end of 'private/_putctty.c'
fi
if test -f 'private/_scrclos.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_scrclos.c'\"
else
echo shar: Extracting \"'private/_scrclos.c'\" \(1414 characters\)
sed "s/^X//" >'private/_scrclos.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__scrclos = "$Header: c:/curses/private/RCS/_scrclos.c%v 2.0 1992/11/15 03:24:33 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_scr_close() - Internal low-level binding to close the physical screen
X
X PDCurses Description:
X This function provides a low-level binding for the Flexos
X platform which must close the screen before writing to it.
X This is a nop for the DOS platform.
X
X This function is provided in order to reset the FlexOS 16 bit
X character set for input rather than the limited input
X character set associated with the VT52.
X
X PDCurses Return Value:
X This function returns OK on success, otherwise an ERR is returned.
X
X PDCurses Errors:
X The DOS platform will never fail. The Flexos platform may fail
X depending on the ability to close the current virtual console in
X 8 (as opposed to 16) bit mode.
X
X Portability:
X PDCurses int PDC_scr_close( void );
X
X**man-end**********************************************************************/
X
Xint PDC_scr_close(void)
X{
X#ifdef FLEXOS
X _flexos_8bitmode();
X vir.vc_kbmode = kbmode;
X vir.vc_smode = smode;
X vir.vc_mode = cmode;
X retcode = s_set(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir));
X if (retcode < 0L)
X return( ERR );
X return( OK );
X#endif
X#if defined (DOS) || defined (OS2)
X return( OK );
X#endif
X}
END_OF_FILE
if test 1414 -ne `wc -c <'private/_scrclos.c'`; then
echo shar: \"'private/_scrclos.c'\" unpacked with wrong size!
fi
# end of 'private/_scrclos.c'
fi
if test -f 'private/_set8025.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_set8025.c'\"
else
echo shar: Extracting \"'private/_set8025.c'\" \(1469 characters\)
sed "s/^X//" >'private/_set8025.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__set8025 = "$Header: c:/curses/private/RCS/_set8025.c%v 2.0 1992/11/15 03:24:35 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_set_80x25() - force a known screen state: 80x25 text mode.
X
X PDCurses Description:
X This is a private PDCurses function.
X
X Forces the appropriate 80x25 alpha mode given the display adapter.
X
X Since we currently do not support changing the virtual console size,
X this routine is a NOP under Flexos.
X
X PDCurses Return Value:
X This function returns OK upon success otherwise ERR is returned.
X
X PDCurses Errors:
X No errors are defined for this routine.
X
X Portability:
X PDCurses int PDC_set_80x25( void );
X
X**man-end**********************************************************************/
X
Xint PDC_set_80x25(void)
X{
X#ifdef FLEXOS
X return( OK );
X#endif
X#ifdef DOS
X switch (_cursvar.adapter)
X {
X case _CGA:
X case _EGACOLOR:
X case _EGAMONO:
X case _VGACOLOR:
X case _VGAMONO:
X case _MCGACOLOR:
X case _MCGAMONO:
X regs.h.ah = 0x00;
X regs.h.al = 0x03;
X int86(0x10, ®s, ®s);
X break;
X case _MDA:
X regs.h.ah = 0x00;
X regs.h.al = 0x07;
X int86(0x10, ®s, ®s);
X default:
X break;
X }
X return( OK );
X#endif
X#ifdef OS2
X VIOMODEINFO modeInfo;
X
X modeInfo.cb = sizeof(modeInfo);
X /* set most parameters of modeInfo */
X VioGetMode(&modeInfo, 0);
X modeInfo.fbType = 1;
X VioSetMode(&modeInfo, 0);
X#endif
X}
END_OF_FILE
if test 1469 -ne `wc -c <'private/_set8025.c'`; then
echo shar: \"'private/_set8025.c'\" unpacked with wrong size!
fi
# end of 'private/_set8025.c'
fi
if test -f 'private/_setscrn.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_setscrn.c'\"
else
echo shar: Extracting \"'private/_setscrn.c'\" \(1444 characters\)
sed "s/^X//" >'private/_setscrn.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__setscrn = "$Header: c:/curses/private/RCS/_setscrn.c%v 2.0 1992/11/15 03:24:37 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_set_scrn_mode() - Set BIOS Video Mode
X
X PDCurses Description:
X Sets the BIOS Video Mode Number ONLY if it is different from
X the current video mode. This routine is for DOS systems only.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_set_scrn_mode( int new_mode );
X
X**man-end**********************************************************************/
X
X#ifdef OS2
Xint PDC_set_scrn_mode(VIOMODEINFO new_mode)
X#else
Xint PDC_set_scrn_mode(int new_mode)
X#endif
X{
X#ifdef FLEXOS
X return( OK );
X#endif
X#ifdef DOS
X int cur;
X
X cur = (int) PDC_get_scrn_mode();
X if (cur != new_mode)
X {
X regs.h.ah = 0x00;
X regs.h.al = (char) new_mode;
X int86(0x10, ®s, ®s);
X }
X _cursvar.font = PDC_get_font();
X _cursvar.scrnmode = new_mode;
X LINES = PDC_get_rows();
X COLS = PDC_get_columns();
X return( OK );
X#endif
X#ifdef OS2
X if (VioSetMode (&new_mode, 0) != 0)
X {
X _cursvar.font = PDC_get_font();
X _cursvar.scrnmode = new_mode;
X LINES = PDC_get_rows();
X COLS = PDC_get_columns();
X return( OK );
X }
X else
X return (ERR);
X#endif
X}
END_OF_FILE
if test 1444 -ne `wc -c <'private/_setscrn.c'`; then
echo shar: \"'private/_setscrn.c'\" unpacked with wrong size!
fi
# end of 'private/_setscrn.c'
fi
if test -f 'private/_splitpl.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_splitpl.c'\"
else
echo shar: Extracting \"'private/_splitpl.c'\" \(1546 characters\)
sed "s/^X//" >'private/_splitpl.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__splitpl = "$Header: c:/curses/private/RCS/_splitpl.c%v 2.0 1992/11/15 03:24:41 MH Rel $";
X#endif
X
X
X
X#ifdef FLEXOS
X/*man-start*********************************************************************
X
X _flexos_split_plane() - splits a char/attr plane into separate planes
X
X PDCurses Description:
X This is a private PDCurses function.
X
X This routine is used only be the Flexos platform.
X
X This routine will separate the character/attributes plane into
X a separate character and attribute plane.
X
X PDCurses Return Value:
X This function returns OK upon success otherwise ERR is returned.
X
X PDCurses Errors:
X It is an error to pass a NULL WINDOW pointer.
X It is also an error if the starting x or y coordinate exceeds the
X passed window boundaries.
X
X Portability:
X PDCurses int _flexos_split_plane( WINDOW* w,
X char* chr, char* attr,
X int sy, int sx,
X int ey, int ex );
X
X**man-end**********************************************************************/
X
Xint _flexos_split_plane(WINDOW* w,char* chr,char* attr,int sy,int sx,int ey,int ex)
X{
X int l;
X int c;
X
X if (w == (WINDOW *)NULL) return( ERR );
X if (sy > w->_maxy) return( ERR );
X if (sx > w->_maxx) return( ERR );
X if (ey > w->_maxy) ey = w->_maxy - 1;
X if (ex > w->_maxx) ex = w->_maxx - 1;
X
X for (l = sy; l <= ey; l++)
X {
X for (c = sx; c <= ex; c++)
X {
X *chr = (char)(w->_y[l][c] & CHR_MSK);
X *attr = (char)(w->_y[l][c] & ATR_MSK) >> 8;
X chr++;
X attr++;
X }
X }
X return( OK );
X}
X#endif
END_OF_FILE
if test 1546 -ne `wc -c <'private/_splitpl.c'`; then
echo shar: \"'private/_splitpl.c'\" unpacked with wrong size!
fi
# end of 'private/_splitpl.c'
fi
echo shar: End of archive 9 \(of 11\).
cp /dev/null ark9isdone
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: flexos/_16bitmo.c flexos/_8bitmod.c nonport/wborder.c
# pdcurses.cfg portable/baudrate.c portable/beep.c portable/box.c
# portable/cbreak.c portable/delay_ou.c portable/getyx.c
# portable/has_ic.c portable/initcolo.c portable/meta.c
# portable/mvcur.c portable/mvwin.c portable/nl.c
# portable/nocbreak.c portable/refresh.c portable/scrollok.c
# portable/startcol.c portable/touchlin.c portable/wclear.c
# portable/werase.c portable/winsch.c private/_addtail.c
# private/_ckbiosk.c private/_gcrspos.c private/_gcurcol.c
# private/_gcurrow.c private/_getattr.c private/_scrnmod.c
# Wrapped by kent@sparky on Wed Nov 18 21:44:10 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 10 (of 11)."'
if test -f 'flexos/_16bitmo.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'flexos/_16bitmo.c'\"
else
echo shar: Extracting \"'flexos/_16bitmo.c'\" \(1370 characters\)
sed "s/^X//" >'flexos/_16bitmo.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__16bitmo = "$Header: c:/curses/flexos/RCS/_16bitmod.c%v 2.0 1992/11/15 02:42:04 mh Rel $";
X#endif
X
X
X
X
X#ifdef FLEXOS
X/*man-start*********************************************************************
X
X _flexos_16bitmode() - Puts console 16 bit mode.
X
X PDCurses Description:
X This routine sets 16 bit mode (8 bit character +
X 8 bit attribute) for Flexos.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X Under FLEXOS, an ERR will be returned if the s_get() call
X fails, or if the s_set() call fails. You are referred to
X the Flexos Programmer's Reference Guide for details on the
X actual error.
X
X Portability:
X PDCurses int _flexos_16bitmode( void );
X
X**man-end**********************************************************************/
X
Xint _flexos_16bitmode(void)
X{
Xextern VIRCON vir; /* Allocate a Virtual Console Structure */
X
X retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X if (retcode < 0L)
X return( ERR );
X
X vir.vc_kbmode = vir.vc_kbmode | (VCKM_NABORT | VCKM_NSTOP |
X VCKM_NXLAT | VCKM_NESC |
X VCKM_16BIT | VCKM_NECHO |
X VCKM_NEOF);
X
X vir.vc_smode = vir.vc_smode | VCSM_16BIT;
X
X retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X return( (retcode < 0L) ? ERR : OK );
X}
X#endif
END_OF_FILE
if test 1370 -ne `wc -c <'flexos/_16bitmo.c'`; then
echo shar: \"'flexos/_16bitmo.c'\" unpacked with wrong size!
fi
# end of 'flexos/_16bitmo.c'
fi
if test -f 'flexos/_8bitmod.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'flexos/_8bitmod.c'\"
else
echo shar: Extracting \"'flexos/_8bitmod.c'\" \(1254 characters\)
sed "s/^X//" >'flexos/_8bitmod.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__8bitmod = "$Header: c:/curses/flexos/RCS/_8bitmod.c%v 2.0 1992/11/15 02:42:10 mh Rel $";
X#endif
X
X
X
X
X#ifdef FLEXOS
X/*man-start*********************************************************************
X
X _flexos_8bitmode() - Puts console into 8 bit mode.
X
X PDCurses Description:
X This routine sets 8 bit mode (no 8 bit attribute) for Flexos.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X Under FLEXOS, an ERR will be returned if the s_get() call
X fails, or if the s_set() call fails. You are referred to
X the Flexos Programmer's Reference Guide for details on the
X actual error.
X
X Portability:
X PDCurses int _flexos_16bitmode( void );
X
X**man-end**********************************************************************/
X
Xint _flexos_8bitmode(void)
X{
Xextern VIRCON vir; /* Allocate a Virtual Console Structure */
X
X retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X if (retcode < 0L)
X return( ERR );
X
X vir.vc_kbmode = vir.vc_kbmode & ~VCKM_16BIT;
X vir.vc_smode = vir.vc_smode & ~VCKM_16BIT;
X
X retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X return( (retcode < 0L) ? ERR : OK );
X}
X#endif
END_OF_FILE
if test 1254 -ne `wc -c <'flexos/_8bitmod.c'`; then
echo shar: \"'flexos/_8bitmod.c'\" unpacked with wrong size!
fi
# end of 'flexos/_8bitmod.c'
fi
if test -f 'nonport/wborder.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/wborder.c'\"
else
echo shar: Extracting \"'nonport/wborder.c'\" \(1193 characters\)
sed "s/^X//" >'nonport/wborder.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wborder
X
X#ifndef NDEBUG
Xchar *rcsid_wborder = "$Header: c:/curses/nonport/RCS/wborder.c%v 2.0 1992/11/15 03:18:29 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wborder() - sets the border characters in the passed window.
X
X PDCurses Description:
X This routine sets the border characters for the passed window.
X
X PDCurses Return Value:
X This function returns OK upon success otherwise ERR is returned.
X
X PDCurses Errors:
X It is an error for stdscr to be a NULL pointer.
X
X Portability:
X PDCurses int wborder( chtype l, chtype r, chtype t, chtype b,
X chtype tl, chtype tr chtype bl, chtype br );
X
X**man-end**********************************************************************/
X
Xint wborder(WINDOW *win,chtype l,chtype r,chtype t,chtype b,chtype tl,chtype tr,chtype bl,chtype br)
X{
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X win->_borderchars[0] = l;
X win->_borderchars[1] = r;
X win->_borderchars[2] = t;
X win->_borderchars[3] = b;
X win->_borderchars[4] = tl;
X win->_borderchars[5] = tr;
X win->_borderchars[6] = bl;
X win->_borderchars[7] = br;
X return( OK );
X}
END_OF_FILE
if test 1193 -ne `wc -c <'nonport/wborder.c'`; then
echo shar: \"'nonport/wborder.c'\" unpacked with wrong size!
fi
# end of 'nonport/wborder.c'
fi
if test -f 'pdcurses.cfg' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pdcurses.cfg'\"
else
echo shar: Extracting \"'pdcurses.cfg'\" \(43 characters\)
sed "s/^X//" >'pdcurses.cfg' <<'END_OF_FILE'
X-1-
X-2-
X-K
X-G
X-rd
X-d
X-V
X-w-eff
X-j0
X-c
X-P-
END_OF_FILE
if test 43 -ne `wc -c <'pdcurses.cfg'`; then
echo shar: \"'pdcurses.cfg'\" unpacked with wrong size!
fi
# end of 'pdcurses.cfg'
fi
if test -f 'portable/baudrate.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/baudrate.c'\"
else
echo shar: Extracting \"'portable/baudrate.c'\" \(1358 characters\)
sed "s/^X//" >'portable/baudrate.c' <<'END_OF_FILE'
X#include <limits.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef baudrate
X
X#ifndef NDEBUG
Xchar *rcsid_baudrate = "$Header: c:/curses/portable/RCS/baudrate.c%v 2.0 1992/11/15 03:28:45 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X baudrate() - Return terminal baud rate
X
X X/Open Description:
X Returns the output speed of the terminal. The number returned
X is bits per second, for example 9600, and is an integer.
X
X PDCurses Description:
X If FAST_VIDEO is true, then this is the largest possible
X (portable) int value (INT_MAX from limits.h) IF direct
X video is possible, OR the approximate guess at BIOS speeds,
X 19200.
X
X If FAST_VIDEO is false, this is an approximate guess at BIOS
X speeds, 19200.
X
X X/Open Return Value:
X The baudrate() function returns a pointer to a verbose description
X of the current terminal on success and the null pointer on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int baudrate( void );
X X/Open Dec '88 int baudrate( void );
X BSD Curses
X SYS V Curses
X
X**man-end**********************************************************************/
X
Xint baudrate(void)
X{
X#ifdef FAST_VIDEO
X return (_cursvar.direct_video ? INT_MAX : 19200 );
X#else
X return (19200); /* Approx. guess at BIOS speeds.*/
X#endif
X}
END_OF_FILE
if test 1358 -ne `wc -c <'portable/baudrate.c'`; then
echo shar: \"'portable/baudrate.c'\" unpacked with wrong size!
fi
# end of 'portable/baudrate.c'
fi
if test -f 'portable/beep.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/beep.c'\"
else
echo shar: Extracting \"'portable/beep.c'\" \(1324 characters\)
sed "s/^X//" >'portable/beep.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef beep
X
X#ifndef NDEBUG
Xchar *rcsid_beep = "$Header: c:/curses/portable/RCS/beep.c%v 2.0 1992/11/15 03:29:34 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X beep() - generate audio-visual alarm.
X
X X/Open Description:
X This routine is used to signal the terminal user. The beep()
X function will sound the audible bell on the terminal, if possible
X and if not, will flash the screen (visible bell), if possible.
X The flash() function will flash the screen, and if that is not
X possible, will sound the audible signal. If neither signal is
X possible, nothing will happen. Nearly all terminals have an
X audible signal (bell or beep), but only some can flash the screen.
X
X X/Open Return Value:
X The beep() and flash() functions return OK on success and ERR on
X error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int beep( void );
X X/Open Dec '88 int beep( void );
X BSD Curses int beep( void );
X SYS V Curses int beep( void );
X
X**man-end**********************************************************************/
X
Xint beep(void)
X{
X if (!_cursvar.audible)
X {
X flash();
X return( ERR ); /* We try to flash instead...*/
X }
X PDC_putctty( '\007', 0 );
X return( OK );
X}
END_OF_FILE
if test 1324 -ne `wc -c <'portable/beep.c'`; then
echo shar: \"'portable/beep.c'\" unpacked with wrong size!
fi
# end of 'portable/beep.c'
fi
if test -f 'portable/box.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/box.c'\"
else
echo shar: Extracting \"'portable/box.c'\" \(1359 characters\)
sed "s/^X//" >'portable/box.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef box
X
X#ifndef NDEBUG
Xchar *rcsid_box = "$Header: c:/curses/portable/RCS/box.c%v 2.0 1992/11/15 03:28:51 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X box() - draw box
X
X X/Open Description:
X A box is drawn around the edge of the window. The characters
X vert and hor are the characters used to draw the box. If vert or
X hor are zero, then appropriate default characters will be used.
X
X PDCurses Description:
X See border() for additional control over the sides and corners
X of the box drawn.
X
X X/Open Return Value:
X The box() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for these functions.
X
X Portability:
X PDCurses int box( WINDOW* win, chtype vert, chtype hor );
X X/Open Dec '88 int box( WINDOW* win, chtype vert, chtype hor );
X BSD Curses int box( WINDOW* win, chtype vert, chtype hor );
X SYS V Curses int box( WINDOW* win, chtype vert, chtype hor );
X
X**man-end**********************************************************************/
X
Xint box( WINDOW *win, chtype vert, chtype hor )
X{
X if (!vert || !hor) /*
X { * SYSV Fix Courtesy of Augustine Cano
X vert= ACS_VLINE;* a...@shibaya.lonestar.org
X hor = ACS_HLINE;* 19920520
X } */
X return( wbox( win, 0, 0, 0, 0, vert, hor ) );
X}
END_OF_FILE
if test 1359 -ne `wc -c <'portable/box.c'`; then
echo shar: \"'portable/box.c'\" unpacked with wrong size!
fi
# end of 'portable/box.c'
fi
if test -f 'portable/cbreak.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/cbreak.c'\"
else
echo shar: Extracting \"'portable/cbreak.c'\" \(1345 characters\)
sed "s/^X//" >'portable/cbreak.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef cbreak
X
X#ifndef NDEBUG
Xchar *rcsid_cbreak = "$Header: c:/curses/portable/RCS/cbreak.c%v 2.0 1992/11/15 03:28:47 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X cbreak() - set/clear cbreak mode
X
X X/Open Description: cbreak() and nocbreak()
X These two routines put the terminal into and out of cbreak mode.
X In cbreak mode, characters typed by the user are immediately
X available to the program and erase/kill character processing is
X not performed. When out of cbreak mode, the terminal driver
X will buffer characters typed until a newline or carriage return
X is typed. Interrupt and flow control characters are unaffected
X by this mode. Initially the terminal may or may not need be
X in cbreak mode.
X
X PDCurses Description:
X There is no additional PDCurses functionality.
X
X X/Open Return Value:
X The cbreak() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for these functions.
X
X Portability:
X PDCurses int cbreak( void );
X X/Open Dec '88 int cbreak( void );
X BSD Curses int cbreak( void );
X SYS V Curses int cbreak( void );
X
X**man-end**********************************************************************/
X
Xint cbreak(void)
X{
X _cursvar.cbreak = TRUE;
X return( OK );
X}
END_OF_FILE
if test 1345 -ne `wc -c <'portable/cbreak.c'`; then
echo shar: \"'portable/cbreak.c'\" unpacked with wrong size!
fi
# end of 'portable/cbreak.c'
fi
if test -f 'portable/delay_ou.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/delay_ou.c'\"
else
echo shar: Extracting \"'portable/delay_ou.c'\" \(1328 characters\)
sed "s/^X//" >'portable/delay_ou.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X/*#define NEEDS_OS2 1*/
X#include <curses.h>
X#undef delay_output
X
X#if defined(DOS) && defined(MSC)
X#include <time.h>
X#endif
X
X#ifndef NDEBUG
Xchar *rcsid_delay_ou = "$Header: c:/curses/portable/RCS/delay_ou.c%v 2.0 1992/11/15 03:28:46 MH Rel $";
X#endif
X
X#ifdef OS2
X APIRET APIENTRY DosSleep(ULONG ulTime);
X#endif
X
X
X/*man-start*********************************************************************
X
X delay_output() - cause short delay
X
X X/Open Description:
X Insert ms millisecond pause in output. On some systems, this
X has no effect.
X
X PDCurses Description:
X This routine relies on the compiler's delay() routine and
X provides this x millisecond granularity to the application.
X
X X/Open Return Value:
X The delay_output() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X If this function is a nop, then an ERR is returned.
X
X Portability:
X PDCurses int delay_output( int ms );
X X/Open Dec '88 int delay_output( int ms );
X BSD Curses
X SYS V Curses
X
X**man-end**********************************************************************/
X
Xint delay_output( int ms )
X{
X#if defined(TC) && defined(DOS)
X delay( ms );
X return( OK );
X#endif
X#if defined(OS2)
X DosSleep(ms);
X return( OK );
X#endif
X#if defined(DOS) && defined(MSC)
X PDC_usleep((clock_t)ms);
X return( OK );
X#endif
X}
END_OF_FILE
if test 1328 -ne `wc -c <'portable/delay_ou.c'`; then
echo shar: \"'portable/delay_ou.c'\" unpacked with wrong size!
fi
# end of 'portable/delay_ou.c'
fi
if test -f 'portable/getyx.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/getyx.c'\"
else
echo shar: Extracting \"'portable/getyx.c'\" \(1326 characters\)
sed "s/^X//" >'portable/getyx.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef getyx
X
X#ifndef NDEBUG
Xchar *rcsid_getyx = "$Header: c:/curses/portable/RCS/getyx.c%v 2.0 1992/11/15 03:28:53 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X getyx() - get cursor position
X
X X/Open Description:
X The cursor position of the window is placed in the two integer
X variables y and x. This is implemented as a macro, so no & is
X necessary before the variables.
X
X NOTE: getyx() is a macro.
X
X PDCurses Description:
X This routine is here to as a documentation place holder. The
X code in this module will never be executed unless you #undef
X getyx(), in which case, you will need the & operator.
X
X X/Open Return Value:
X This function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int getyx( WINDOW* win, int* y, int* x );
X or int getyx( WINDOW* win, int y, int x );
X X/Open Dec '88 int getyx( WINDOW* win, int y, int x );
X BSD Curses int getyx( WINDOW* win, int y, int x );
X SYS V Curses int getyx( WINDOW* win, int y, int x );
X
X**man-end**********************************************************************/
X
Xint getyx( WINDOW *win, int *y, int *x )
X{
X *y = win->_cury;
X *x = win->_curx;
X return( OK );
X}
END_OF_FILE
if test 1326 -ne `wc -c <'portable/getyx.c'`; then
echo shar: \"'portable/getyx.c'\" unpacked with wrong size!
fi
# end of 'portable/getyx.c'
fi
if test -f 'portable/has_ic.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/has_ic.c'\"
else
echo shar: Extracting \"'portable/has_ic.c'\" \(1205 characters\)
sed "s/^X//" >'portable/has_ic.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef has_ic
X
X#ifndef NDEBUG
Xchar *rcsid_has_ic = "$Header: c:/curses/portable/RCS/has_ic.c%v 2.0 1992/11/15 03:28:54 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X has_ic() - determine whether insert/delete character available
X
X X/Open Description:
X This function will return TRUE if the terminal has insert character
X and delete character capabilities.
X
X PDCurses Description:
X For DOS, this is irrelevant (and ALWAYS TRUE), as the speed of
X the DIRECT VIDEO or even BIOS writes is quicker than on a
X serial terminal.
X
X For FLEXOS, this value has meaning and depends on the terminal,
X though at this time, it is a constant TRUE.
X
X X/Open Return Value:
X The has_ic() function returns TRUE if the terminal has insert
X character and delete character capabilities, otherwise it returns
X FALSE.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses bool has_ic(void);
X X/Open Dec '88 bool has_ic(void);
X BSD Curses
X SYS V Curses
X
X**man-end**********************************************************************/
X
Xbool has_ic(void)
X{
X return( TRUE );
X}
END_OF_FILE
if test 1205 -ne `wc -c <'portable/has_ic.c'`; then
echo shar: \"'portable/has_ic.c'\" unpacked with wrong size!
fi
# end of 'portable/has_ic.c'
fi
if test -f 'portable/initcolo.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/initcolo.c'\"
else
echo shar: Extracting \"'portable/initcolo.c'\" \(1319 characters\)
sed "s/^X//" >'portable/initcolo.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid_initcolo = "$Header: c:/curses/portable/RCS/initcolo.c%v 2.0 1992/11/15 03:28:55 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X init_color() - Change the definition of a color.
X
X PDCurses Description:
X
X This routine is used to change the definition of a color.
X The routine takes four arguments: the number of the color to be
X redefined, and the new values of the red, green and blue
X components of the color.
X
X The value of color must be between 0 and COLORS-1.
X The values of red, green and blue must each fall between 0 and
X 1000;
X
X ***** This function doesn't do anything yet *****
X
X PDCurses Return Value:
X This function returns OK if the color change was possible or
X ERR on error.
X
X PDCurses Errors:
X N/A
X
X Portability:
X PDCurses int init_color( int color, short red, short green, short blue);
X SYS V curses int init_color( int color, short red, short green, short blue);
X
X**man-end**********************************************************************/
X
X
Xint init_color(int color, short red, short green, short blue)
X{
X extern int COLORS;
X
X if (color >= COLORS -1 || color < 1)
X return(ERR);
X/*
X * This function doesn't do anything yet...
X */
X return(ERR);
X}
END_OF_FILE
if test 1319 -ne `wc -c <'portable/initcolo.c'`; then
echo shar: \"'portable/initcolo.c'\" unpacked with wrong size!
fi
# end of 'portable/initcolo.c'
fi
if test -f 'portable/meta.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/meta.c'\"
else
echo shar: Extracting \"'portable/meta.c'\" \(1302 characters\)
sed "s/^X//" >'portable/meta.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef meta
X
X#ifndef NDEBUG
Xchar *rcsid_meta = "$Header: c:/curses/portable/RCS/meta.c%v 2.0 1992/11/15 03:29:00 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X meta() - Force the number of significant bits on input.
X
X Ultrix 4.1 Description:
X This function forces the user's terminal to return 7 or 8
X significant bits on input. To force 8 bits to be returned,
X invoke meta() with bf as TRUE. To force 7 bits to be returned,
X invoke meta() with bf as FALSE.
X
X The window argument is always ignored, but it must still be a
X valid window to avoid compiler errors.
X
X PDCurses Description:
X This function is provided for portability. By default, 8 bits
X are returned.
X
X FYI: The Ultrix DOC needs confirmation...
X
X PDCurses Return Value:
X The meta() function returns OK.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int meta( WINDOW* win, bool bf );
X BSD Curses int meta( WINDOW* win, bool bf );
X SYS V Curses int meta( WINDOW* win, bool bf );
X
X**man-end**********************************************************************/
X
Xint meta( WINDOW *win, bool bf )
X{
X#ifdef TC
X# pragma argsused;
X#endif
X _cursvar.raw_inp = bf;
X return( OK );
X}
END_OF_FILE
if test 1302 -ne `wc -c <'portable/meta.c'`; then
echo shar: \"'portable/meta.c'\" unpacked with wrong size!
fi
# end of 'portable/meta.c'
fi
if test -f 'portable/mvcur.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/mvcur.c'\"
else
echo shar: Extracting \"'portable/mvcur.c'\" \(1382 characters\)
sed "s/^X//" >'portable/mvcur.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef mvcur
X
X#ifndef NDEBUG
Xchar *rcsid_mvcur = "$Header: c:/curses/portable/RCS/mvcur.c%v 2.0 1992/11/15 03:29:00 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X mvcur() - low-level cursor movement
X
X Ultrix 4.1 Description:
X This function controls low-level cursor motion with optimization.
X
X PDCurses Description:
X There is no optimization here since the PC has memory mapped
X video and we support, under certain compilation options, direct
X video writes.
X
X PDCurses Return Value:
X The mvcur() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X If the new cursor position is outside the physical screen size,
X an error occurs.
X
X Portability:
X PDCurses int mvcur(int oldrow,int oldcol,int newrow,int newcol);
X BSD Curses int mvcur(int oldrow,int oldcol,int newrow,int newcol);
X SYS V Curses int mvcur(int oldrow,int oldcol,int newrow,int newcol);
X
X**man-end**********************************************************************/
X
Xint mvcur(int oldrow, int oldcol, int newrow, int newcol)
X{
X#ifdef TC
X# pragma argsused
X#endif
X if ((newrow >= LINES) ||
X (newcol >= COLS) ||
X (newrow < 0) ||
X (newcol < 0))
X {
X return( ERR );
X }
X PDC_gotoxy( newrow, newcol );
X _cursvar.cursrow = newrow;
X _cursvar.curscol = newcol;
X return( OK );
X}
END_OF_FILE
if test 1382 -ne `wc -c <'portable/mvcur.c'`; then
echo shar: \"'portable/mvcur.c'\" unpacked with wrong size!
fi
# end of 'portable/mvcur.c'
fi
if test -f 'portable/mvwin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/mvwin.c'\"
else
echo shar: Extracting \"'portable/mvwin.c'\" \(1253 characters\)
sed "s/^X//" >'portable/mvwin.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef mvwin
X
X#ifndef NDEBUG
Xchar *rcsid_mvwin = "$Header: c:/curses/portable/RCS/mvwin.c%v 2.0 1992/11/15 03:29:01 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X mvwin() - move window
X
X X/Open Description:
X
X
X PDCurses Description:
X There is no additional PDCurses functionality.
X
X X/Open Return Value:
X The mvwin() routine returns OK on success and otherwise ERR
X is returned.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X It is also an error to address a position that is outside the
X bounds of the specified window.
X
X Portability:
X PDCurses int mvwin( WINDOW* win, int y, int x );
X X/Open Dec '88 int mvwin( WINDOW* win, int y, int x );
X BSD Curses int mvwin( WINDOW* win, int y, int x );
X SYS V Curses int mvwin( WINDOW* win, int y, int x );
X
X**man-end**********************************************************************/
X
Xint mvwin(WINDOW *win, int y, int x)
X{
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X if (win->_begy + win->_maxy > LINES)
X return( ERR );
X
X if (win->_begx + win->_maxx > COLS)
X return( ERR );
X
X win->_begy = y;
X win->_begx = x;
X touchwin(win);
X return( OK );
X}
END_OF_FILE
if test 1253 -ne `wc -c <'portable/mvwin.c'`; then
echo shar: \"'portable/mvwin.c'\" unpacked with wrong size!
fi
# end of 'portable/mvwin.c'
fi
if test -f 'portable/nl.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/nl.c'\"
else
echo shar: Extracting \"'portable/nl.c'\" \(1437 characters\)
sed "s/^X//" >'portable/nl.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef nl
X
X#ifndef NDEBUG
Xchar *rcsid_nl = "$Header: c:/curses/portable/RCS/nl.c%v 2.0 1992/11/15 03:29:04 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X nl() - enable/disable newline control
X
X X/Open Description: nl(), nonl()
X These functions control whether a newline is translated into a
X carriage return and a line-feed on output, and wether a return
X is translated into a newline on input. Initially, the translations
X do occur. By disabling these translations, curses is able to
X make better use of the line-feed capability, resulting in faster
X cursor motion.
X
X NOTE: nl() and nonl() are macros.
X
X PDCurses Description:
X This module is not an executable, it is merely a documentation
X place holder. This module will only execute code if the user
X #undefs nl.
X
X X/Open Return Value:
X The nl() and nonl() functions return OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int mvprintw( int y, int x, char* fmt, ... );
X X/Open Dec '88 int mvprintw( int y, int x, char* fmt, ... );
X BSD Curses int mvprintw( int y, int x, char* fmt, ... );
X SYS V Curses int mvprintw( int y, int x, char* fmt, ... );
X
X**man-end**********************************************************************/
X
Xint nl(void)
X{
X _cursvar.autocr = TRUE;
X return( OK );
X}
END_OF_FILE
if test 1437 -ne `wc -c <'portable/nl.c'`; then
echo shar: \"'portable/nl.c'\" unpacked with wrong size!
fi
# end of 'portable/nl.c'
fi
if test -f 'portable/nocbreak.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/nocbreak.c'\"
else
echo shar: Extracting \"'portable/nocbreak.c'\" \(1366 characters\)
sed "s/^X//" >'portable/nocbreak.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef nocbreak
X
X#ifndef NDEBUG
Xchar *rcsid_nocbreak = "$Header: c:/curses/portable/RCS/nocbreak.c%v 2.0 1992/11/15 03:29:04 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X nocbreak() - set/clear cbreak mode
X
X X/Open Description: cbreak() and nocbreak()
X These two routines put the terminal into and out of cbreak mode.
X In cbreak mode, characters typed by the user are immediately
X available to the program and erase/kill character processing is
X not performed. When out of cbreak mode, the terminal driver
X will buffer characters typed until a newline or carriage return
X is typed. Interrupt and flow control characters are unaffected
X by this mode. Initially the terminal may or may not need be
X in cbreak mode.
X
X PDCurses Description:
X There is no additional PDCurses functionality.
X
X X/Open Return Value:
X The nocbreak() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for these functions.
X
X Portability:
X PDCurses int nocbreak( void );
X X/Open Dec '88 int nocbreak( void );
X BSD Curses int nocbreak( void );
X SYS V Curses int nocbreak( void );
X
X**man-end**********************************************************************/
X
Xint nocbreak(void)
X{
X _cursvar.cbreak = FALSE;
X return( OK );
X}
END_OF_FILE
if test 1366 -ne `wc -c <'portable/nocbreak.c'`; then
echo shar: \"'portable/nocbreak.c'\" unpacked with wrong size!
fi
# end of 'portable/nocbreak.c'
fi
if test -f 'portable/refresh.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/refresh.c'\"
else
echo shar: Extracting \"'portable/refresh.c'\" \(1246 characters\)
sed "s/^X//" >'portable/refresh.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef refresh
X
X#ifndef NDEBUG
Xchar *rcsid_refresh = "$Header: c:/curses/portable/RCS/refresh.c%v 2.0 1992/11/15 03:29:10 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X refresh() - refresh window
X
X X/Open Description:
X The routine wrefresh copies the named window to the physical
X terminal screen, taking into account what is already there in
X order to optimize cursor movement.
X
X The routine refresh does the same, using stdscr as a default
X screen.
X
X These routines must be called to get any output on the
X terminal, as other routines only manipulate data structures.
X
X Unless leaveok has been enabled, the physical cursor of the
X terminal is left at the location of the window's cursor.
X
X X/Open Return Value:
X The refresh() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int refresh( void );
X X/Open Dec '88 int refresh( void );
X BSD Curses int refresh( void );
X SYS V Curses int refresh( void );
X
X**man-end**********************************************************************/
X
Xint refresh( void )
X{
X return( wrefresh(stdscr) );
X}
END_OF_FILE
if test 1246 -ne `wc -c <'portable/refresh.c'`; then
echo shar: \"'portable/refresh.c'\" unpacked with wrong size!
fi
# end of 'portable/refresh.c'
fi
if test -f 'portable/scrollok.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/scrollok.c'\"
else
echo shar: Extracting \"'portable/scrollok.c'\" \(1341 characters\)
sed "s/^X//" >'portable/scrollok.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef scrollok
X
X#ifndef NDEBUG
Xchar *rcsid_scrollok = "$Header: c:/curses/portable/RCS/scrollok.c%v 2.0 1992/11/15 03:29:31 MH Rel $";
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X scrollok() - scrollok window
X
X X/Open Description:
X This function controls what happens when the cursor of a window
X is moved off the edge of the window or scrolling region, either
X from a newline on the bottom line or by typing the last character
X of the last line. If the option is disabled, the cursor is left
X on the bottom line. If enabled, the window is scrolled up one
X line and then refreshed.
X
X PDCurses Description:
X This is also implemented as a macro.
X
X X/Open Return Value:
X The scrollok() function returns OK on success otherwise ERR
X is returned.
X
X PDCurses Errors:
X It is an error to pass a NULL* window.
X
X Portability:
X PDCurses int scrollok( WINDOW* win, bool bf );
X X/Open Dec '88 int scrollok( WINDOW* win, bool bf );
X SysV Curses int scrollok( WINDOW* win, bool bf );
X BSD Curses int scrollok( WINDOW* win, bool bf );
X
X**man-end**********************************************************************/
X
Xint scrollok(WINDOW *win, bool bf)
X{
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X win->_scroll = bf;
X return( OK );
X}
END_OF_FILE
if test 1341 -ne `wc -c <'portable/scrollok.c'`; then
echo shar: \"'portable/scrollok.c'\" unpacked with wrong size!
fi
# end of 'portable/scrollok.c'
fi
if test -f 'portable/startcol.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/startcol.c'\"
else
echo shar: Extracting \"'portable/startcol.c'\" \(1377 characters\)
sed "s/^X//" >'portable/startcol.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef start_color
X
X#ifndef NDEBUG
Xchar *rcsid_startcol = "$Header: c:/curses/portable/RCS/startcol.c%v 2.0 1992/11/15 03:29:17 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X start_color() - Initialize and set up curses for color mode.
X
X PDCurses Description:
X This routine sets up curses to enable color support.
X
X Eight basic color are initialized: black, blue, green, cyan, red,
X magenta, yellow and white. Two global variables - COLORS and
X COLOR_PAIRS, as defined in <curses.h> header file - are also
X initialized. The se variables define the maximum number of colors
X and the maximum number of color-pairs supported.
X
X This routine must be called before any other curses routine which
X manipulates or uses colors. A good place to call it is immediately
X after initscr().
X
X PDCurses Return Value:
X This function returns ERR if the monitor does not support color.
X Otherwise OK is returned.
X
X PDCurses Errors:
X N/A
X
X Portability:
X PDCurses int start_color(void);
X SYS V curses int start_color(void);
X
X**man-end**********************************************************************/
X
Xint COLORS=0,COLOR_PAIRS=0;
X
Xint start_color(void)
X{
X if (_cursvar.mono)
X return(ERR);
X COLORS = 8;
X COLOR_PAIRS = 33; /* actually only allows 32 */
X return(OK);
X}
END_OF_FILE
if test 1377 -ne `wc -c <'portable/startcol.c'`; then
echo shar: \"'portable/startcol.c'\" unpacked with wrong size!
fi
# end of 'portable/startcol.c'
fi
if test -f 'portable/touchlin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/touchlin.c'\"
else
echo shar: Extracting \"'portable/touchlin.c'\" \(1277 characters\)
sed "s/^X//" >'portable/touchlin.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef touchline
X
X#ifndef NDEBUG
Xchar *rcsid_touchlin = "$Header: c:/curses/portable/RCS/touchlin.c%v 2.0 1992/11/15 03:29:18 MH Rel $";
X#endif
X
X
X
X
X
X/*man-start*********************************************************************
X
X touchline() - touch line in window
X
X PDCurses Description:
X Similar to touchwin(), but less drastic.
X
X Throw away all optimisation information about which parts of the
X window (well, lines) have been touched, by pretending that the
X entire line(s) has been drawn on.
X
X PDCurses Errors:
X The touchline() function returns OK on success and ERR on error.
X
X It is an error to pass a NULL window.
X
X It is also an error to specify a line outside the boundaries of
X the passed window or if the start line plus the number of lines
X exceeds the boundary of the window.
X
X Portability:
X PDCurses
X SysV Curses
X BSD Curses
X
X**man-end**********************************************************************/
X
Xint touchline(WINDOW *w, int start,int num)
X{
X register int i;
X
X if (w == (WINDOW *)NULL)
X return( ERR );
X
X if (start > w->_maxy || start + num > w->_maxy)
X return( ERR );
X for(i=start;i<start+num;i++)
X {
X w->_firstch[i] = 0;
X w->_lastch[i] = w->_maxx - 1;
X }
X return( OK );
X}
END_OF_FILE
if test 1277 -ne `wc -c <'portable/touchlin.c'`; then
echo shar: \"'portable/touchlin.c'\" unpacked with wrong size!
fi
# end of 'portable/touchlin.c'
fi
if test -f 'portable/wclear.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/wclear.c'\"
else
echo shar: Extracting \"'portable/wclear.c'\" \(1309 characters\)
sed "s/^X//" >'portable/wclear.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wclear
X
X#ifndef NDEBUG
Xchar *rcsid_wclear = "$Header: c:/curses/portable/RCS/wclear.c%v 2.0 1992/11/15 03:29:23 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wclear() - Clear window
X
X X/Open Description: clear() and wclear()
X These functions are like erase(), but they also call clearok(),
X arranging that the screen will be cleared completely on the
X next call to wrefresh() for that window and repainted.
X
X NOTE: clear() is a macro.
X
X PDCurses Description:
X There is no additional PDCurses functionality. This module is
X a documentation place holder. No code will execute in this module
X unless the user #undefs wclear.
X
X X/Open Return Value:
X The wclear() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int wclear( WINDOW* win );
X X/Open Dec '88 int wclear( WINDOW* win );
X BSD Curses int wclear( WINDOW* win );
X SYS V Curses int wclear( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint wclear( WINDOW *win )
X{
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X clearok( win, TRUE );
X return( werase( win ) );
X}
END_OF_FILE
if test 1309 -ne `wc -c <'portable/wclear.c'`; then
echo shar: \"'portable/wclear.c'\" unpacked with wrong size!
fi
# end of 'portable/wclear.c'
fi
if test -f 'portable/werase.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/werase.c'\"
else
echo shar: Extracting \"'portable/werase.c'\" \(1405 characters\)
sed "s/^X//" >'portable/werase.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef werase
X
X#ifndef NDEBUG
Xchar *rcsid_werase = "$Header: c:/curses/portable/RCS/werase.c%v 2.0 1992/11/15 03:29:07 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X werase() - copy blanks into window
X
X X/Open Description:
X These functions copy blanks to every position in the window.
X
X NOTE: erase() is a macro.
X
X PDCurses Description:
X There is no additional PDCurses functionality.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int werase( WINDOW* win );
X X/Open Dec '88 int werase( WINDOW* win );
X BSD Curses int werase( WINDOW* win );
X SYS V Curses int werase( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint werase(WINDOW *win)
X{
X chtype* end;
X chtype* start;
X int y;
Xstatic chtype blank;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X blank = win->_blank | win->_attrs;
X
X for (y = win->_tmarg; y <= win->_bmarg; y++)
X {
X start = win->_y[y];
X end = &start[win->_maxx - 1];
X/* changed JGB 6/92 < to <= */
X while (start <= end)
X {
X *start++ = blank;
X }
X win->_firstch[y] = 0;
X win->_lastch[y] = win->_maxx - 1;
X }
X win->_cury = win->_tmarg;
X win->_curx = 0;
X return( OK );
X}
X
END_OF_FILE
if test 1405 -ne `wc -c <'portable/werase.c'`; then
echo shar: \"'portable/werase.c'\" unpacked with wrong size!
fi
# end of 'portable/werase.c'
fi
if test -f 'portable/winsch.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/winsch.c'\"
else
echo shar: Extracting \"'portable/winsch.c'\" \(1339 characters\)
sed "s/^X//" >'portable/winsch.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef winsch
X
X#ifndef NDEBUG
Xchar *rcsid_winsch = "$Header: c:/curses/portable/RCS/winsch.c%v 2.0 1992/11/15 03:29:26 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X winsch() - Insert character
X
X X/Open Description:
X The character ch is inserted before the character under the
X cursor. All characters to the right are moved one space to the
X right, possibly losing the rightmost character on the line.
X The cursor position does not change (after moving to y,x if
X specified).
X
X NOTE: insch(), mvinsch(), mvwinsch() are macros.
X
X PDCurses Description:
X See the call ctrl( bool bf ); for information regarding the
X replacement of all former 1.4 and prior "raw" PDCurses
X routines.
X
X X/Open Return Value:
X These functions return OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int winsch( WINDOW* win, chtype ch );
X X/Open Dec '88 int winsch( WINDOW* win, chtype ch );
X BSD Curses int winsch( WINDOW* win, chtype ch );
X SYS V Curses int winsch( WINDOW* win, chtype ch );
X
X**man-end**********************************************************************/
X
Xint winsch( WINDOW *win, chtype ch )
X{
X return( PDC_chins( win, ch, !(_cursvar.raw_out) ) );
X}
END_OF_FILE
if test 1339 -ne `wc -c <'portable/winsch.c'`; then
echo shar: \"'portable/winsch.c'\" unpacked with wrong size!
fi
# end of 'portable/winsch.c'
fi
if test -f 'private/_addtail.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_addtail.c'\"
else
echo shar: Extracting \"'private/_addtail.c'\" \(1281 characters\)
sed "s/^X//" >'private/_addtail.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifdef REGISTERWINDOWS
X#ifndef NDEBUG
Xchar *rcsid__addtail = "$Header: c:/curses/private/RCS/_addtail.c%v 2.0 1992/11/15 03:24:17 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_addtail() - add window to the visible window list
X
X PDCurses Description:
X This is a private PDCurses function.
X
X This routine adds the passed window pointer to the end fo the
X visible window list. All windows on this list will automatically
X be refreshed if _cursvar.refreshall is true.
X
X PDCurses Return Value:
X This function returns OK upon success otherwise ERR is returned.
X
X PDCurses Errors:
X It is an error to pass a NULL window pointer.
X
X Portability:
X PDCurses int PDC_addtail( WINDOW* tail );
X
X**man-end**********************************************************************/
X
Xint PDC_addtail(WINDOW *tail)
X{
X WINDS *next = _cursvar.visible;
X
X if (tail == (WINDOW *)NULL)
X return( ERR );
X
X while (next != (WINDS *)NULL)
X {
X if (next->next == NULL)
X break;
X next = next->next;
X }
X if (next == NULL)
X PDC_inswin(tail, (WINDOW *)NULL);
X else
X {
X if (next->w == NULL)
X PDC_inswin(tail, (WINDOW *)NULL);
X else
X PDC_addwin(tail, next->w);
X }
X return( OK );
X}
X#endif
END_OF_FILE
if test 1281 -ne `wc -c <'private/_addtail.c'`; then
echo shar: \"'private/_addtail.c'\" unpacked with wrong size!
fi
# end of 'private/_addtail.c'
fi
if test -f 'private/_ckbiosk.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_ckbiosk.c'\"
else
echo shar: Extracting \"'private/_ckbiosk.c'\" \(1229 characters\)
sed "s/^X//" >'private/_ckbiosk.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#define NEEDS_OS2 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__ckbiosk = "$Header: c:/curses/private/RCS/_ckbiosk.c%v 2.0 1992/11/15 03:24:29 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_check_bios_key() - Check BIOS key data area for input
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X This routine will check the BIOS for any indication that
X keystrokes are pending.
X
X PDCurses Return Value:
X Returns 1 if a keyboard character is available, 0 otherwise.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses bool PDC_check_bios_key( void );
X
X**man-end**********************************************************************/
X
Xbool PDC_check_bios_key(void)
X{
X#ifdef FLEXOS
X retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X return( (retcode < 0L) ? ERR : vir.vc_tahead );
X#endif
X#if defined (DOS)
X return(kbhit());
X#endif
X#if OS2
X#if !defined(MSC)
X KBDKEYINFO keyInfo;
X
X/* KbdCharIn(&keyInfo, IO_NOWAIT, 0);*/ /* get a character */
X KbdPeek(&keyInfo, 0); /* peek at keyboard */
X return (keyInfo.fbStatus != 0);
X#else
X return(kbhit());
X#endif
X#endif
X}
END_OF_FILE
if test 1229 -ne `wc -c <'private/_ckbiosk.c'`; then
echo shar: \"'private/_ckbiosk.c'\" unpacked with wrong size!
fi
# end of 'private/_ckbiosk.c'
fi
if test -f 'private/_gcrspos.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_gcrspos.c'\"
else
echo shar: Extracting \"'private/_gcrspos.c'\" \(1348 characters\)
sed "s/^X//" >'private/_gcrspos.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__gcrspos = "$Header: c:/curses/private/RCS/_gcrspos.c%v 2.0 1992/11/15 03:24:22 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_get_cursor_pos() - return current cursor position
X
X PDCurses Description:
X This is a private PDCurses function
X
X Gets the cursor position in video page 0. 'row' and 'column'
X are the cursor address. At this time, there is no support for
X use of multiple screen pages.
X
X PDCurses Return Value:
X This routine will return OK upon success and otherwise ERR will be
X returned.
X
X PDCurses Errors:
X There are no defined errors for this routine.
X
X Portability:
X PDCurses int PDC_get_cursor_pos( int* row, int* col );
X
X**man-end**********************************************************************/
X
Xint PDC_get_cursor_pos(int *row, int *col)
X{
X#ifdef FLEXOS
X retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
X if (retcode < 0L)
X return( ERR );
X *row = vir.vc_cursor.pos_row;
X *col = vir.vc_cursor.pos_col;
X return( OK );
X#endif
X#ifdef DOS
X regs.h.ah = 0x03;
X regs.h.bh = _cursvar.video_page;
X int86(0x10, ®s, ®s);
X *row = regs.h.dh;
X *col = regs.h.dl;
X return( OK );
X#endif
X#ifdef OS2
X VioGetCurPos((PUSHORT)&row,(PUSHORT)&col,0);
X return( OK );
X#endif
X}
END_OF_FILE
if test 1348 -ne `wc -c <'private/_gcrspos.c'`; then
echo shar: \"'private/_gcrspos.c'\" unpacked with wrong size!
fi
# end of 'private/_gcrspos.c'
fi
if test -f 'private/_gcurcol.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_gcurcol.c'\"
else
echo shar: Extracting \"'private/_gcurcol.c'\" \(1243 characters\)
sed "s/^X//" >'private/_gcurcol.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__gcurcol = "$Header: c:/curses/private/RCS/_gcurcol.c%v 2.0 1992/11/15 03:24:22 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_get_cur_col() - get current column position of cursor
X
X PDCurses Description:
X This is a private PDCurses function
X
X This routine returns the current column position of the cursor on
X screen.
X
X PDCurses Return Value:
X This routine returns the current column position of the cursor. No
X error is returned.
X
X PDCurses Errors:
X There are no defined errors for this routine.
X
X Portability:
X PDCurses int PDC_get_cur_col( void );
X
X**man-end**********************************************************************/
X
Xint PDC_get_cur_col(void)
X{
X#ifdef FLEXOS
X retcode = s_get(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir));
X return( (retcode < 0L) ? ERR : vir.vc_cursor.pos_col );
X#endif
X#ifdef DOS
X regs.x.ax = 0x0003;
X regs.h.bh = _cursvar.video_page;
X int86(0x10, ®s, ®s);
X return((int) regs.h.dl);
X#endif
X#ifdef OS2
X USHORT curCol, curRow;
X
X /* find the current cursor position */
X VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
X return (curCol);
X#endif
X}
END_OF_FILE
if test 1243 -ne `wc -c <'private/_gcurcol.c'`; then
echo shar: \"'private/_gcurcol.c'\" unpacked with wrong size!
fi
# end of 'private/_gcurcol.c'
fi
if test -f 'private/_gcurrow.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_gcurrow.c'\"
else
echo shar: Extracting \"'private/_gcurrow.c'\" \(1235 characters\)
sed "s/^X//" >'private/_gcurrow.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__gcurrow = "$Header: c:/curses/private/RCS/_gcurrow.c%v 2.0 1992/11/15 03:24:23 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_get_cur_row() - get current row position of cursor
X
X PDCurses Description:
X This is a private PDCurses function
X
X This routine returns the current row position of the cursor on
X screen.
X
X PDCurses Return Value:
X This routine returns the current row position of the cursor. No
X error is returned.
X
X PDCurses Errors:
X There are no defined errors for this routine.
X
X Portability:
X PDCurses int PDC_get_cur_row( void );
X
X**man-end**********************************************************************/
X
Xint PDC_get_cur_row(void)
X{
X#ifdef FLEXOS
X retcode = s_get(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir));
X return( (retcode < 0L) ? ERR : vir.vc_cursor.pos_col );
X#endif
X#ifdef DOS
X regs.x.ax = 0x0003;
X regs.h.bh = _cursvar.video_page;
X int86(0x10, ®s, ®s);
X return ((int) regs.h.dh);
X#endif
X#ifdef OS2
X USHORT curCol, curRow;
X
X /* find the current cursor position */
X VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
X return (curRow);
X#endif
X}
END_OF_FILE
if test 1235 -ne `wc -c <'private/_gcurrow.c'`; then
echo shar: \"'private/_gcurrow.c'\" unpacked with wrong size!
fi
# end of 'private/_gcurrow.c'
fi
if test -f 'private/_getattr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_getattr.c'\"
else
echo shar: Extracting \"'private/_getattr.c'\" \(1298 characters\)
sed "s/^X//" >'private/_getattr.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__getattr = "$Header: c:/curses/private/RCS/_getattr.c%v 2.0 1992/11/15 03:24:23 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_get_attribute() - Get attribute at current cursor
X
X PDCurses Description:
X This is a private PDCurses function
X
X Return the current attr at current cursor position on the screen.
X
X PDCurses Return Value:
X This routine will return OK upon success and otherwise ERR will be
X returned.
X
X PDCurses Errors:
X There are no defined errors for this routine.
X
X Portability:
X PDCurses int PDC_get_attribute( void );
X
X**man-end**********************************************************************/
X
Xint PDC_get_attribute(void)
X{
X#ifdef FLEXOS
X /* Get and return current attribute. Force error until fixed. */
X return ((COLOR_CYAN) >> ((sizeof(ch type) / 2) * 8));
X#endif
X#ifdef DOS
X regs.x.ax = 0x0800;
X regs.h.bh = _cursvar.video_page;
X int86(0x10, ®s, ®s);
X return ((int) regs.h.ah);
X#endif
X#ifdef OS2
X char Cell[4];
X USHORT cellLen = 2;
X USHORT curRow = PDC_get_cur_row();
X USHORT curCol = PDC_get_cur_col();
X VioReadCellStr((PCH)&Cell, (PUSHORT)&cellLen, (USHORT)curRow, (USHORT)curCol, 0);
X return ((int) Cell[1]);
X#endif
X}
END_OF_FILE
if test 1298 -ne `wc -c <'private/_getattr.c'`; then
echo shar: \"'private/_getattr.c'\" unpacked with wrong size!
fi
# end of 'private/_getattr.c'
fi
if test -f 'private/_scrnmod.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_scrnmod.c'\"
else
echo shar: Extracting \"'private/_scrnmod.c'\" \(1210 characters\)
sed "s/^X//" >'private/_scrnmod.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_scrn_modes_equal() - Decide if two screen modes are equal
X
X PDCurses Description:
X Mainly required for OS/2. It decides if two screen modes
X (VIOMODEINFO structure) are equal. Under DOS it just compares
X two integers
X
X PDCurses Return Value:
X This function returns TRUE if equal else FALSe.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_scrn_modes_equal( int mode1, int mode2 );
X OS2 PDCurses int PDC_scrn_modes_equal( VIOMODEINFO mode1, VIOMODEINFO mode2 );
X
X**man-end**********************************************************************/
X
X#ifdef OS2
Xbool PDC_scrn_modes_equal(VIOMODEINFO mode1, VIOMODEINFO mode2)
X#else
Xbool PDC_scrn_modes_equal(int mode1, int mode2)
X#endif
X{
X#ifdef OS2
X return ( (mode1.cb == mode2.cb) && (mode1.fbType == mode2.fbType)
X && (mode1.color == mode2.color) && (mode1.col == mode2.col)
X && (mode1.row == mode2.row) && (mode1.hres == mode2.vres)
X && (mode1.vres == mode2.vres) );
X#else
X return (mode1 == mode2);
X#endif
X}
END_OF_FILE
if test 1210 -ne `wc -c <'private/_scrnmod.c'`; then
echo shar: \"'private/_scrnmod.c'\" unpacked with wrong size!
fi
# end of 'private/_scrnmod.c'
fi
echo shar: End of archive 10 \(of 11\).
cp /dev/null ark10isdone
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: demos/firework.def demos/newdemo.def demos/testcurs.def
# demos/xmas.def doc/todo.man flexos/_gname.c nonport/border.c
# nonport/breakcha.c nonport/cursoff.c nonport/mvwinser.c
# nonport/rawout.c nonport/tabsize.c nonport/waddraws.c
# nonport/wordchar.c nonport/wtabsize.c portable/canchang.c
# portable/clearok.c portable/echo.c portable/erasecha.c
# portable/fixterm.c portable/gettmode.c portable/has_il.c
# portable/killchar.c portable/nodelay.c portable/noecho.c
# portable/resetter.c portable/saveoldt.c portable/saveterm.c
# portable/ungetch.c private/_clrscr.c private/_findwin.c
# private/_getscrn.c private/_newline.c private/_rmwin.c
# private/_usleep.c
# Wrapped by kent@sparky on Wed Nov 18 21:44:11 1992
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 11 (of 11)."'
if test -f 'demos/firework.def' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'demos/firework.def'\"
else
echo shar: Extracting \"'demos/firework.def'\" \(719 characters\)
sed "s/^X//" >'demos/firework.def' <<'END_OF_FILE'
XNAME firework windowcompat
X
XDESCRIPTION 'test'
X
XPROTMODE
X
XSTACKSIZE 32767
X
XIMPORTS
XVioGetCurType=vio32.Vio32GetCurType
XVioSetCurType=vio32.Vio32SetCurType
XVioGetCurPos=vio32.Vio32GetCurPos
XVioSetCurPos=vio32.Vio32SetCurPos
XVioGetMode=vio32.Vio32GetMode
XVioSetMode=vio32.Vio32SetMode
XVioReadCellStr=vio32.Vio32ReadCellStr
XVioWrtTTY=vio32.Vio32WrtTTY
XVioWrtNAttr=vio32.Vio32WrtNAttr
XVioGetConfig=vio32.Vio32GetConfig
XVioScrollUp=vio32.Vio32ScrollUp
XVioWrtCellStr=vio32.Vio32WrtCellStr
XVioWrtNCell=vio32.Vio32WrtNCell
XVioWrtCharStr=vio32.Vio32WrtCharStr
XKbd32CharIn=kbd32.Kbd32CharIn
XKbd32Peek=kbd32.Kbd32Peek
XKbd32FlushBuffer=kbd32.Kbd32FlushBuffer
XKbd32GetStatus=kbd32.Kbd32GetStatus
XKbd32SetStatus=kbd32.Kbd32SetStatus
END_OF_FILE
if test 719 -ne `wc -c <'demos/firework.def'`; then
echo shar: \"'demos/firework.def'\" unpacked with wrong size!
fi
# end of 'demos/firework.def'
fi
if test -f 'demos/newdemo.def' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'demos/newdemo.def'\"
else
echo shar: Extracting \"'demos/newdemo.def'\" \(718 characters\)
sed "s/^X//" >'demos/newdemo.def' <<'END_OF_FILE'
XNAME newdemo windowcompat
X
XDESCRIPTION 'test'
X
XPROTMODE
X
XSTACKSIZE 32767
X
XIMPORTS
XVioGetCurType=vio32.Vio32GetCurType
XVioSetCurType=vio32.Vio32SetCurType
XVioGetCurPos=vio32.Vio32GetCurPos
XVioSetCurPos=vio32.Vio32SetCurPos
XVioGetMode=vio32.Vio32GetMode
XVioSetMode=vio32.Vio32SetMode
XVioReadCellStr=vio32.Vio32ReadCellStr
XVioWrtTTY=vio32.Vio32WrtTTY
XVioWrtNAttr=vio32.Vio32WrtNAttr
XVioGetConfig=vio32.Vio32GetConfig
XVioScrollUp=vio32.Vio32ScrollUp
XVioWrtCellStr=vio32.Vio32WrtCellStr
XVioWrtNCell=vio32.Vio32WrtNCell
XVioWrtCharStr=vio32.Vio32WrtCharStr
XKbd32CharIn=kbd32.Kbd32CharIn
XKbd32Peek=kbd32.Kbd32Peek
XKbd32FlushBuffer=kbd32.Kbd32FlushBuffer
XKbd32GetStatus=kbd32.Kbd32GetStatus
XKbd32SetStatus=kbd32.Kbd32SetStatus
END_OF_FILE
if test 718 -ne `wc -c <'demos/newdemo.def'`; then
echo shar: \"'demos/newdemo.def'\" unpacked with wrong size!
fi
# end of 'demos/newdemo.def'
fi
if test -f 'demos/testcurs.def' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'demos/testcurs.def'\"
else
echo shar: Extracting \"'demos/testcurs.def'\" \(719 characters\)
sed "s/^X//" >'demos/testcurs.def' <<'END_OF_FILE'
XNAME testcurs windowcompat
X
XDESCRIPTION 'test'
X
XPROTMODE
X
XSTACKSIZE 32767
X
XIMPORTS
XVioGetCurType=vio32.Vio32GetCurType
XVioSetCurType=vio32.Vio32SetCurType
XVioGetCurPos=vio32.Vio32GetCurPos
XVioSetCurPos=vio32.Vio32SetCurPos
XVioGetMode=vio32.Vio32GetMode
XVioSetMode=vio32.Vio32SetMode
XVioReadCellStr=vio32.Vio32ReadCellStr
XVioWrtTTY=vio32.Vio32WrtTTY
XVioWrtNAttr=vio32.Vio32WrtNAttr
XVioGetConfig=vio32.Vio32GetConfig
XVioScrollUp=vio32.Vio32ScrollUp
XVioWrtCellStr=vio32.Vio32WrtCellStr
XVioWrtNCell=vio32.Vio32WrtNCell
XVioWrtCharStr=vio32.Vio32WrtCharStr
XKbd32CharIn=kbd32.Kbd32CharIn
XKbd32Peek=kbd32.Kbd32Peek
XKbd32FlushBuffer=kbd32.Kbd32FlushBuffer
XKbd32GetStatus=kbd32.Kbd32GetStatus
XKbd32SetStatus=kbd32.Kbd32SetStatus
END_OF_FILE
if test 719 -ne `wc -c <'demos/testcurs.def'`; then
echo shar: \"'demos/testcurs.def'\" unpacked with wrong size!
fi
# end of 'demos/testcurs.def'
fi
if test -f 'demos/xmas.def' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'demos/xmas.def'\"
else
echo shar: Extracting \"'demos/xmas.def'\" \(715 characters\)
sed "s/^X//" >'demos/xmas.def' <<'END_OF_FILE'
XNAME xmas windowcompat
X
XDESCRIPTION 'test'
X
XPROTMODE
X
XSTACKSIZE 32767
X
XIMPORTS
XVioGetCurType=vio32.Vio32GetCurType
XVioSetCurType=vio32.Vio32SetCurType
XVioGetCurPos=vio32.Vio32GetCurPos
XVioSetCurPos=vio32.Vio32SetCurPos
XVioGetMode=vio32.Vio32GetMode
XVioSetMode=vio32.Vio32SetMode
XVioReadCellStr=vio32.Vio32ReadCellStr
XVioWrtTTY=vio32.Vio32WrtTTY
XVioWrtNAttr=vio32.Vio32WrtNAttr
XVioGetConfig=vio32.Vio32GetConfig
XVioScrollUp=vio32.Vio32ScrollUp
XVioWrtCellStr=vio32.Vio32WrtCellStr
XVioWrtNCell=vio32.Vio32WrtNCell
XVioWrtCharStr=vio32.Vio32WrtCharStr
XKbd32CharIn=kbd32.Kbd32CharIn
XKbd32Peek=kbd32.Kbd32Peek
XKbd32FlushBuffer=kbd32.Kbd32FlushBuffer
XKbd32GetStatus=kbd32.Kbd32GetStatus
XKbd32SetStatus=kbd32.Kbd32SetStatus
END_OF_FILE
if test 715 -ne `wc -c <'demos/xmas.def'`; then
echo shar: \"'demos/xmas.def'\" unpacked with wrong size!
fi
# end of 'demos/xmas.def'
fi
if test -f 'doc/todo.man' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'doc/todo.man'\"
else
echo shar: Extracting \"'doc/todo.man'\" \(562 characters\)
sed "s/^X//" >'doc/todo.man' <<'END_OF_FILE'
X/*man-start*********************************************************************
X
XThe following curses functions are not supported in the current release
Xof PDCurses:
X
X copywin halfdelay scr_restore
X notimeout setsyx
X filter resetterm slk*
X flushok ripoffline subpad
X garbagedlines scr_dump vwprintf
X getsyx scr_init vwscanf
X
X**man-end**********************************************************************/
END_OF_FILE
if test 562 -ne `wc -c <'doc/todo.man'`; then
echo shar: \"'doc/todo.man'\" unpacked with wrong size!
fi
# end of 'doc/todo.man'
fi
if test -f 'flexos/_gname.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'flexos/_gname.c'\"
else
echo shar: Extracting \"'flexos/_gname.c'\" \(927 characters\)
sed "s/^X//" >'flexos/_gname.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__gname = "$Header: c:/curses/flexos/RCS/_gname.c%v 2.0 1992/11/15 02:42:08 mh Rel $";
X#endif
X
X
X
X
X#ifdef FLEXOS
XVIRCON vir; /* Allocate a Virtual Console Structure */
X
X/*man-start*********************************************************************
X
X _flexos_gname() - FLEXOS: Return virtual console name
X
X PDCurses Description:
X This is a Flexos platform PDCurses function.
X
X This routine returns the name of the Flexos virtual console.
X The VIRCON vir structure is initialized within the initscr()
X calltree.
X
X PDCurses Return Value:
X This routine returns a character pointer.
X
X PDCurses Errors:
X No errors are defined for this routine.
X
X Portability:
X PDCurses char* _flexos_gname( void );
X
X**man-end**********************************************************************/
X
Xchar* _flexos_gname(void)
X{
X return (&vir.vc_wname[0]);
X}
X#endif
END_OF_FILE
if test 927 -ne `wc -c <'flexos/_gname.c'`; then
echo shar: \"'flexos/_gname.c'\" unpacked with wrong size!
fi
# end of 'flexos/_gname.c'
fi
if test -f 'nonport/border.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/border.c'\"
else
echo shar: Extracting \"'nonport/border.c'\" \(1096 characters\)
sed "s/^X//" >'nonport/border.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef border
X
X#ifndef NDEBUG
Xchar *rcsid_border = "$Header: c:/curses/nonport/RCS/border.c%v 2.0 1992/11/15 03:18:25 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X border() - sets the border characters in the stdscr window.
X
X PDCurses Description:
X This routine sets the border characters for stdscr.
X
X WARNING:
X Don't make this a call to wborder() - it would
X require too much stack for parameters.
X
X PDCurses Return Value:
X This function returns OK upon success otherwise ERR is returned.
X
X PDCurses Errors:
X It is an error for stdscr to be a NULL pointer.
X
X Portability:
X PDCurses int border( chtype l, chtype r, chtype t, chtype b,
X chtype tl, chtype tr chtype bl, chtype br );
X
X**man-end**********************************************************************/
X
Xint border(chtype l,chtype r,chtype t,chtype b,chtype tl,chtype tr,chtype bl,chtype br)
X{
X if (stdscr == (WINDOW *)NULL)
X return( ERR );
X
X return( wborder( stdscr, l, r, t, b, tl, tr, bl, br ) );
X}
END_OF_FILE
if test 1096 -ne `wc -c <'nonport/border.c'`; then
echo shar: \"'nonport/border.c'\" unpacked with wrong size!
fi
# end of 'nonport/border.c'
fi
if test -f 'nonport/breakcha.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/breakcha.c'\"
else
echo shar: Extracting \"'nonport/breakcha.c'\" \(1142 characters\)
sed "s/^X//" >'nonport/breakcha.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef breakchar
X
X#ifndef NDEBUG
Xchar *rcsid_breakcha = "$Header: c:/curses/nonport/RCS/breakcha.c%v 2.0 1992/11/15 03:18:25 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X breakchar() - Return's user's current break character.
X
X PDCurses Description:
X
X This routine will return the current BREAK char. This is a
X routine and not a macro in anticipation of providing
X user-specified BREAK chars.
X
X PDCurses Return Value:
X The (chtype) character value that is the user's current break
X character. This is currently hardcoded, but provided in
X anticipation of providing support for a user defined break char.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses chtype breakchar(void);
X BSD Curses
X SYS V Curses
X**man-end**********************************************************************/
X
Xchtype breakchar(void)
X{
X#ifdef FLEXOS
X return( (chtype) 0x03 );
X#endif
X#ifdef DOS
X return( (chtype) 0x03 ); /* Control-C */
X#endif
X#ifdef OS2
X return( (chtype) 0x03 ); /* Control-C */
X#endif
X}
END_OF_FILE
if test 1142 -ne `wc -c <'nonport/breakcha.c'`; then
echo shar: \"'nonport/breakcha.c'\" unpacked with wrong size!
fi
# end of 'nonport/breakcha.c'
fi
if test -f 'nonport/cursoff.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/cursoff.c'\"
else
echo shar: Extracting \"'nonport/cursoff.c'\" \(1096 characters\)
sed "s/^X//" >'nonport/cursoff.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef cursoff
X
X#ifndef NDEBUG
Xchar *rcsid_cursoff = "$Header: c:/curses/nonport/RCS/cursoff.c%v 2.0 1992/11/15 03:18:26 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X cursoff() - Turns off the hardware cursor.
X
X PDCurses Description:
X Turns off the hardware curses, it does nothing if it is already off.
X
X PDCurses Return Value:
X Returns OK upon success, ERR upon failure.
X
X PDCurses Errors:
X ERR will be returned (in the case of FLEXOS) if the hardware cursor
X can not be disabled.
X
X Portability:
X PDCurses int cursoff( void );
X
X**man-end**********************************************************************/
X
Xint cursoff(void)
X{
X if (_cursvar.visible_cursor)
X {
X _cursvar.visible_cursor = FALSE;
X#ifdef OS2
X PDC_set_cursor_mode(32, 33); /* turn it off */
X#else
X switch (_cursvar.adapter)
X {
X case _FLEXOS:
X PDC_set_cursor_mode(_cursvar.visible_cursor, 0);
X break;
X default:
X PDC_set_cursor_mode(32, 33); /* turn it off */
X break;
X }
X#endif
X }
X return( OK );
X}
END_OF_FILE
if test 1096 -ne `wc -c <'nonport/cursoff.c'`; then
echo shar: \"'nonport/cursoff.c'\" unpacked with wrong size!
fi
# end of 'nonport/cursoff.c'
fi
if test -f 'nonport/mvwinser.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/mvwinser.c'\"
else
echo shar: Extracting \"'nonport/mvwinser.c'\" \(910 characters\)
sed "s/^X//" >'nonport/mvwinser.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef mvwinsert
X
X#ifndef NDEBUG
Xchar *rcsid_mvwinser = "$Header: c:/curses/nonport/RCS/mvwinser.c%v 2.0 1992/11/15 03:18:27 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X mvwinsert() - Insert line
X
X PDCurses Description:
X A blank line is inserted above the current line and the bottom
X line is lost.
X
X This routine is provided as an extension to the X/Open interface.
X
X PDCurses Return Value:
X These functions return OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int mvwinsertln( WINDOW win, int y, int x );
X
X**man-end**********************************************************************/
X
Xint mvwinsertln(WINDOW *win, int y, int x)
X{
X return( (wmove(win, y, x) == ERR) ? ERR : winsertln(win) );
X}
END_OF_FILE
if test 910 -ne `wc -c <'nonport/mvwinser.c'`; then
echo shar: \"'nonport/mvwinser.c'\" unpacked with wrong size!
fi
# end of 'nonport/mvwinser.c'
fi
if test -f 'nonport/rawout.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/rawout.c'\"
else
echo shar: Extracting \"'nonport/rawout.c'\" \(973 characters\)
sed "s/^X//" >'nonport/rawout.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef raw_output
X
X#ifndef NDEBUG
Xchar *rcsid_rawout = "$Header: c:/curses/nonport/RCS/rawout.c%v 2.0 1992/11/15 03:18:27 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X raw_output() - enable raw output mode
X
X PDCurses Description:
X This routine enables the output of raw characters using the
X 'standard' *add* and *ins* curses functions.
X To force 8 bit output and no translation of control characters,
X invoke raw_output() with bf as TRUE. To force 7 bit output and
X translation of control characters, invoke raw_output() with bf
X as FALSE.
X
X PDCurses Return Value:
X This function returns OK.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int raw_output( bool );
X
X**man-end**********************************************************************/
X
Xint raw_output(bool bf)
X{
X _cursvar.raw_out = bf;
X return( OK );
X}
END_OF_FILE
if test 973 -ne `wc -c <'nonport/rawout.c'`; then
echo shar: \"'nonport/rawout.c'\" unpacked with wrong size!
fi
# end of 'nonport/rawout.c'
fi
if test -f 'nonport/tabsize.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/tabsize.c'\"
else
echo shar: Extracting \"'nonport/tabsize.c'\" \(959 characters\)
sed "s/^X//" >'nonport/tabsize.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef tabsize
X
X#ifndef NDEBUG
Xchar *rcsid_tabsize = "$Header: c:/curses/nonport/RCS/tabsize.c%v 2.0 1992/11/15 03:18:29 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X tabsize() - Set tab size in window
X
X PDCurses Description:
X This routine sets the tabsize for stdscr and returns the previous
X tab size settings.
X
X PDCurses Return Value:
X This routine returns the previous tab size setting upon success
X otherwise, it returns ERR.
X
X PDCurses Errors:
X It is an error to call this routine before initscr().
X
X Portability:
X PDCurses int tabsize( int ts );
X X/Open Dec '88
X SysV Curses
X BSD Curses
X
X**man-end**********************************************************************/
X
Xint tabsize(int ts)
X{
X int origval;
X
X if (stdscr == (WINDOW *)NULL)
X return( ERR );
X
X origval = stdscr->_tabsize;
X stdscr->_tabsize = ts;
X return( origval );
X}
END_OF_FILE
if test 959 -ne `wc -c <'nonport/tabsize.c'`; then
echo shar: \"'nonport/tabsize.c'\" unpacked with wrong size!
fi
# end of 'nonport/tabsize.c'
fi
if test -f 'nonport/waddraws.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/waddraws.c'\"
else
echo shar: Extracting \"'nonport/waddraws.c'\" \(1104 characters\)
sed "s/^X//" >'nonport/waddraws.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef waddeawstr
X
X#ifndef NDEBUG
Xchar *rcsid_waddraws = "$Header: c:/curses/nonport/RCS/waddraws.c%v 2.0 1992/11/15 03:18:29 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X waddrawstr() - add raw string to window
X
X PDCurses Description:
X The *raw*() routines output 8 bit values. These contrast to their
X normal counterparts which output 7 bit values and convert control
X character to the ^X notation.
X
X str is a standard 8 bit character string WITHOUT embedded attributes.
X
X PDCurses Return Value:
X The waddrawstr() function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int waddrawstr( WINDOW* win, char* str );
X
X**man-end**********************************************************************/
X
Xint waddrawstr(WINDOW *win, char *str)
X{
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X while (*str)
X {
X if (waddrawch(win, *str++) == ERR)
X {
X return( ERR );
X }
X }
X return( OK );
X}
END_OF_FILE
if test 1104 -ne `wc -c <'nonport/waddraws.c'`; then
echo shar: \"'nonport/waddraws.c'\" unpacked with wrong size!
fi
# end of 'nonport/waddraws.c'
fi
if test -f 'nonport/wordchar.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/wordchar.c'\"
else
echo shar: Extracting \"'nonport/wordchar.c'\" \(892 characters\)
sed "s/^X//" >'nonport/wordchar.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wordchar
X
X#ifndef NDEBUG
Xchar *rcsid_wordchar = "$Header: c:/curses/nonport/RCS/wordchar.c%v 2.0 1992/11/15 03:18:31 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wordchar() - returns the users word delete char
X
X PDCurses Description:
X This routine returns the user's current word delete char.
X
X At the present time, this is still a constant, but positions
X the library to more fully support this in the future.
X
X PDCurses Errors:
X The wordchar returns the user's current delete word character.
X If none is specified, then Ctrl-U is returned.
X
X Portability:
X PDCurses char wordchar( void );
X SysV Curses
X BSD Curses
X
X**man-end**********************************************************************/
X
Xchar wordchar(void)
X{
X return (_DWCHAR); /* word delete char */
X}
END_OF_FILE
if test 892 -ne `wc -c <'nonport/wordchar.c'`; then
echo shar: \"'nonport/wordchar.c'\" unpacked with wrong size!
fi
# end of 'nonport/wordchar.c'
fi
if test -f 'nonport/wtabsize.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'nonport/wtabsize.c'\"
else
echo shar: Extracting \"'nonport/wtabsize.c'\" \(1003 characters\)
sed "s/^X//" >'nonport/wtabsize.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef wtabsize
X
X#ifndef NDEBUG
Xchar *rcsid_wtabsize = "$Header: c:/curses/nonport/RCS/wtabsize.c%v 2.0 1992/11/15 03:18:32 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X wtabsize() - Set tab size in window
X
X X/Open Description:
X Not available.
X
X PDCurses Description:
X This routine sets the tabsize for stdscr and returns the previous
X tab size settings.
X
X X/Open Return Value:
X This routine returns the previous tab size setting upon success
X otherwise, it returns ERR.
X
X PDCurses Errors:
X
X
X Portability:
X PDCurses int wtabsize( WINDOW* win, int ts );
X X/Open Dec '88 int wtabsize( WINDOW* win, int ts );
X SysV Curses
X BSD Curses
X
X**man-end**********************************************************************/
X
Xint wtabsize(WINDOW *win, int ts)
X{
X int origval;
X
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X origval = win->_tabsize;
X win->_tabsize = ts;
X return( origval );
X}
END_OF_FILE
if test 1003 -ne `wc -c <'nonport/wtabsize.c'`; then
echo shar: \"'nonport/wtabsize.c'\" unpacked with wrong size!
fi
# end of 'nonport/wtabsize.c'
fi
if test -f 'portable/canchang.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/canchang.c'\"
else
echo shar: Extracting \"'portable/canchang.c'\" \(876 characters\)
sed "s/^X//" >'portable/canchang.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef can_change_color
X
X#ifndef NDEBUG
Xchar *rcsid_canchang = "$Header: c:/curses/portable/RCS/canchang.c%v 2.0 1992/11/15 03:28:47 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X can_change_color() - Indicate if terminal can change color definitions
X
X PDCurses Description:
X This is defined as a macro.
X
X This routine indicates if the terminal has the capability to change
X the definition of its colors. Although this is possible at least
X with VGA monitors, this function always returns FALSE.
X
X
X PDCurses Return Value:
X This function returns FALSE.
X
X PDCurses Errors:
X N/A
X
X Portability:
X PDCurses int can_change_color( void );
X
X**man-end**********************************************************************/
X
Xint can_change_color(void)
X{
X return(FALSE);
X}
END_OF_FILE
if test 876 -ne `wc -c <'portable/canchang.c'`; then
echo shar: \"'portable/canchang.c'\" unpacked with wrong size!
fi
# end of 'portable/canchang.c'
fi
if test -f 'portable/clearok.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/clearok.c'\"
else
echo shar: Extracting \"'portable/clearok.c'\" \(1138 characters\)
sed "s/^X//" >'portable/clearok.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef clearok
X
X#ifndef NDEBUG
Xchar *rcsid_clearok = "$Header: c:/curses/portable/RCS/clearok.c%v 2.0 1992/11/15 03:28:47 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X clearok() - enable screen clearing
X
X X/Open Description:
X If bf is TRUE, the next call to wrefresh() with this window will
X clear the screen completely and redraw the entire screen.
X
X X/Open Return Value:
X The clearok() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int clearok( WINDOW* win, bool flag );
X X/Open Dec '88 int clearok( WINDOW* win, bool bf );
X BSD Curses
X SYS V Curses int clearok( WINDOW* win, bool bf );
X
X**man-end**********************************************************************/
X
Xint clearok(WINDOW *win, bool flag)
X{
X if (win == (WINDOW *)NULL)
X return( ERR );
X
X if (win == curscr)
X tmpwin->_clear = flag;
X else
X win->_clear = flag;
X
X return( OK );
X}
END_OF_FILE
if test 1138 -ne `wc -c <'portable/clearok.c'`; then
echo shar: \"'portable/clearok.c'\" unpacked with wrong size!
fi
# end of 'portable/clearok.c'
fi
if test -f 'portable/echo.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/echo.c'\"
else
echo shar: Extracting \"'portable/echo.c'\" \(1030 characters\)
sed "s/^X//" >'portable/echo.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef echo
X
X#ifndef NDEBUG
Xchar *rcsid_echo = "$Header: c:/curses/portable/RCS/echo.c%v 2.0 1992/11/15 03:28:50 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X echo() - enable/disable terminal echo
X
X X/Open Description:
X These functions control whether characters typed by the user
X are echoed by the input routine. Initially, input characters
X are echoed. Subsequent calls to echo() and noecho() do not
X flush type-ahead.
X
X PDCurses Description:
X No additional PDCurses functionality.
X
X X/Open Return Value:
X The echo() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int echo( void );
X X/Open Dec '88 int echo( void );
X BSD Curses int echo( void );
X SYS V Curses int echo( void );
X
X**man-end**********************************************************************/
X
Xint echo(void)
X{
X _cursvar.echo = TRUE;
X return( OK );
X}
END_OF_FILE
if test 1030 -ne `wc -c <'portable/echo.c'`; then
echo shar: \"'portable/echo.c'\" unpacked with wrong size!
fi
# end of 'portable/echo.c'
fi
if test -f 'portable/erasecha.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/erasecha.c'\"
else
echo shar: Extracting \"'portable/erasecha.c'\" \(1040 characters\)
sed "s/^X//" >'portable/erasecha.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef erasechar
X
X#ifndef NDEBUG
Xchar *rcsid_erasecha = "$Header: c:/curses/portable/RCS/erasecha.c%v 2.0 1992/11/15 03:28:51 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X erasechar() - Return current ERASE character.
X
X X/Open Description:
X The user's current ERASE character is returned.
X
X PDCurses Description:
X This is hardcoded at this time. There may be future development
X to allow applications an easy way to specify this value.
X
X X/Open Return Value:
X The erasechar() function returns the user's current line ERASE
X character.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses char erasechar( void );
X X/Open Dec '88 char erasechar( void );
X BSD Curses char erasechar( void );
X SYS V Curses char erasechar( void );
X
X**man-end**********************************************************************/
X
Xchar erasechar(void)
X{
X return( _ECHAR ); /* character delete char (^H) */
X}
END_OF_FILE
if test 1040 -ne `wc -c <'portable/erasecha.c'`; then
echo shar: \"'portable/erasecha.c'\" unpacked with wrong size!
fi
# end of 'portable/erasecha.c'
fi
if test -f 'portable/fixterm.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/fixterm.c'\"
else
echo shar: Extracting \"'portable/fixterm.c'\" \(567 characters\)
sed "s/^X//" >'portable/fixterm.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef fixterm
X
X#ifndef NDEBUG
Xchar *rcsid_fixterm = "$Header: c:/curses/portable/RCS/fixterm.c%v 2.0 1992/11/15 03:28:52 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X fixterm() - restore terminal mode
X
X PDCurses Description:
X Now obsolete. Retained for compatibility with older versions
X of curses.
X
X see reset_prog_mode()
X**man-end**********************************************************************/
X
Xint fixterm(void)
X{
X return( reset_prog_mode() );
X}
END_OF_FILE
if test 567 -ne `wc -c <'portable/fixterm.c'`; then
echo shar: \"'portable/fixterm.c'\" unpacked with wrong size!
fi
# end of 'portable/fixterm.c'
fi
if test -f 'portable/gettmode.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/gettmode.c'\"
else
echo shar: Extracting \"'portable/gettmode.c'\" \(542 characters\)
sed "s/^X//" >'portable/gettmode.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef gettmode
X
X#ifndef NDEBUG
Xchar *rcsid_gettmode = "$Header: c:/curses/portable/RCS/gettmode.c%v 2.0 1992/11/15 03:28:53 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X gettmode() - Unknown description.
X
X PDCurses Description:
X Now obsolete. Retained for compatibility with older versions
X of curses.
X
X A no-op.
X**man-end**********************************************************************/
X
Xint gettmode(void)
X{
X return (OK);
X}
END_OF_FILE
if test 542 -ne `wc -c <'portable/gettmode.c'`; then
echo shar: \"'portable/gettmode.c'\" unpacked with wrong size!
fi
# end of 'portable/gettmode.c'
fi
if test -f 'portable/has_il.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/has_il.c'\"
else
echo shar: Extracting \"'portable/has_il.c'\" \(1184 characters\)
sed "s/^X//" >'portable/has_il.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef has_il
X
X#ifndef NDEBUG
Xchar *rcsid_has_il = "$Header: c:/curses/portable/RCS/has_il.c%v 2.0 1992/11/15 03:28:54 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X has_il() - determine whether insert/delete line available
X
X X/Open Description:
X This function will return TRUE if the terminal has insert line
X and delete line capabilities.
X
X PDCurses Description:
X For DOS, this is irrelevant (and ALWAYS TRUE), as the speed of
X the DIRECT VIDEO or even BIOS writes is quicker than on a
X serial terminal.
X
X For FLEXOS, this value has meaning and depends on the terminal,
X though at this time, it is a constant TRUE.
X
X X/Open Return Value:
X The has_il() function returns TRUE if the terminal has insert
X line and delete line capabilities, otherwise it returns
X FALSE.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses bool has_il( void );
X X/Open Dec '88 bool has_il( void );
X BSD Curses
X SYS V Curses
X
X**man-end**********************************************************************/
X
Xbool has_il(void)
X{
X return( TRUE );
X}
END_OF_FILE
if test 1184 -ne `wc -c <'portable/has_il.c'`; then
echo shar: \"'portable/has_il.c'\" unpacked with wrong size!
fi
# end of 'portable/has_il.c'
fi
if test -f 'portable/killchar.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/killchar.c'\"
else
echo shar: Extracting \"'portable/killchar.c'\" \(1015 characters\)
sed "s/^X//" >'portable/killchar.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef killchar
X
X#ifndef NDEBUG
Xchar *rcsid_killchar = "$Header: c:/curses/portable/RCS/killchar.c%v 2.0 1992/11/15 03:28:58 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X killchar() - return current KILL character
X
X X/Open Description:
X The user's current line KILL character.
X
X PDCurses Description:
X This is hardcoded at this time. There may be future development
X to allow applications an easy way to specify this value.
X
X X/Open Return Value:
X The killchar() function returns the user's current line KILL
X character.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses char killchar( void );
X X/Open Dec '88 char killchar( void );
X BSD Curses char killchar( void );
X SYS V Curses char killchar( void );
X
X**man-end**********************************************************************/
X
Xchar killchar(void)
X{
X return( _DLCHAR ); /* line delete char (^U) */
X}
END_OF_FILE
if test 1015 -ne `wc -c <'portable/killchar.c'`; then
echo shar: \"'portable/killchar.c'\" unpacked with wrong size!
fi
# end of 'portable/killchar.c'
fi
if test -f 'portable/nodelay.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/nodelay.c'\"
else
echo shar: Extracting \"'portable/nodelay.c'\" \(1151 characters\)
sed "s/^X//" >'portable/nodelay.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef nodelay
X
X#ifndef NDEBUG
Xchar *rcsid_nodelay = "$Header: c:/curses/portable/RCS/nodelay.c%v 2.0 1992/11/15 03:29:05 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X nodelay() - disable block during read
X
X X/Open Description:
X This function controls whether wgetch() is a non-blocking
X call. If the option is enabled, and no input is ready, wgetch()
X will return ERR. If disabled, wgetch() will hang until input
X is ready.
X
X PDCurses Description:
X There is no additional PDCurses functionality for this function.
X
X X/Open Return Value:
X This function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int nodelay( WINDOW* win, bool bf );
X X/Open Dec '88 int nodelay( WINDOW* win, bool bf );
X BSD Curses int nodelay( WINDOW* win, bool bf );
X SYS V Curses int nodelay( WINDOW* win, bool bf );
X
X**man-end**********************************************************************/
X
Xint nodelay( WINDOW *win, bool flag )
X{
X win->_nodelay = flag;
X return( OK );
X}
END_OF_FILE
if test 1151 -ne `wc -c <'portable/nodelay.c'`; then
echo shar: \"'portable/nodelay.c'\" unpacked with wrong size!
fi
# end of 'portable/nodelay.c'
fi
if test -f 'portable/noecho.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/noecho.c'\"
else
echo shar: Extracting \"'portable/noecho.c'\" \(1050 characters\)
sed "s/^X//" >'portable/noecho.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef noecho
X
X#ifndef NDEBUG
Xchar *rcsid_noecho = "$Header: c:/curses/portable/RCS/noecho.c%v 2.0 1992/11/15 03:29:05 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X noecho() - enable/disable terminal echo
X
X X/Open Description:
X These functions control whether characters typed by the user
X are echoed by the input routine. Initially, input characters
X are echoed. Subsequent calls to echo() and noecho() do not
X flush type-ahead.
X
X PDCurses Description:
X No additional PDCurses functionality.
X
X X/Open Return Value:
X The noraw() function returns OK on success and ERR on error.
X
X X/Open Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int noecho( void );
X X/Open Dec '88 int noecho( void );
X BSD Curses int noecho( void );
X SYS V Curses int noecho( void );
X
X**man-end**********************************************************************/
X
Xint noecho(void)
X{
X _cursvar.echo = FALSE;
X return( OK );
X}
END_OF_FILE
if test 1050 -ne `wc -c <'portable/noecho.c'`; then
echo shar: \"'portable/noecho.c'\" unpacked with wrong size!
fi
# end of 'portable/noecho.c'
fi
if test -f 'portable/resetter.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/resetter.c'\"
else
echo shar: Extracting \"'portable/resetter.c'\" \(599 characters\)
sed "s/^X//" >'portable/resetter.c' <<'END_OF_FILE'
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid_resetter = "$Header: c:/curses/portable/RCS/resetter.c%v 2.0 1992/11/15 03:29:10 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X resetterm() - Reset's terminal to "out of curses" mode
X
X PDCurses Description:
X Now obsolete. Retained for compatibility with older versions
X of curses.
X
X see reset_shell_mode()
X**man-end**********************************************************************/
X
Xint resetterm(void)
X{
X return( reset_shell_mode() );
X}
END_OF_FILE
if test 599 -ne `wc -c <'portable/resetter.c'`; then
echo shar: \"'portable/resetter.c'\" unpacked with wrong size!
fi
# end of 'portable/resetter.c'
fi
if test -f 'portable/saveoldt.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/saveoldt.c'\"
else
echo shar: Extracting \"'portable/saveoldt.c'\" \(527 characters\)
sed "s/^X//" >'portable/saveoldt.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#if !defined( NDEBUG )
Xchar *rcsid_saveoldt = "$Header: c:/curses/portable/RCS/saveoldt.c%v 2.0 1992/11/15 03:29:12 MH Rel $";
X#endif
X
X
X/*man-start*********************************************************************
X
X saveoldterm() - Unknown description.
X
X PDCurses Description:
X Now obsolete. Retained for compatibility with older versions
X of curses.
X**man-end**********************************************************************/
X
Xint saveoldterm(void)
X{
X return( OK );
X}
END_OF_FILE
if test 527 -ne `wc -c <'portable/saveoldt.c'`; then
echo shar: \"'portable/saveoldt.c'\" unpacked with wrong size!
fi
# end of 'portable/saveoldt.c'
fi
if test -f 'portable/saveterm.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/saveterm.c'\"
else
echo shar: Extracting \"'portable/saveterm.c'\" \(574 characters\)
sed "s/^X//" >'portable/saveterm.c' <<'END_OF_FILE'
X#include <string.h>
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid_saveterm = "$Header: c:/curses/portable/RCS/saveterm.c%v 2.0 1992/11/15 03:29:13 MH Rel $";
X#endif
X
X/*man-start*********************************************************************
X
X saveterm() - Save the terminal settings
X
X PDCurses Description:
X Now obsolete. Retained for compatibility with older versions
X of curses.
X
X see def_prog_mode()
X**man-end**********************************************************************/
X
Xint saveterm(void)
X{
X return( def_prog_mode() );
X}
END_OF_FILE
if test 574 -ne `wc -c <'portable/saveterm.c'`; then
echo shar: \"'portable/saveterm.c'\" unpacked with wrong size!
fi
# end of 'portable/saveterm.c'
fi
if test -f 'portable/ungetch.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'portable/ungetch.c'\"
else
echo shar: Extracting \"'portable/ungetch.c'\" \(1121 characters\)
sed "s/^X//" >'portable/ungetch.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef ungetch
X
X#ifndef NDEBUG
Xchar *rcsid_ungetch = "$Header: c:/curses/portable/RCS/ungetch.c%v 2.0 1992/11/15 03:29:20 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X ungetch() - pushes a character back onto the input stream
X
X PDCurses Description:
X There is only one input stream to ungetch characters onto. It
X is of size NUNGETCH.
X
X PDCurses Return Value:
X The ungetch() routine returns OK upon success otherwise ERR is
X returned.
X
X PDCurses Errors:
X ERR will be returned when the push back stack is full.
X
X Portability:
X PDCurses ungetch( chtype ch );
X SysV Curses
X BSD Curses
X
X**man-end**********************************************************************/
X
Xint ungetch(chtype ch)
X{
Xextern int c_pindex; /* putter index */
Xextern int c_gindex; /* getter index */
Xextern int c_ungind; /* wungetch() push index */
Xextern chtype c_ungch[NUNGETCH]; /* array of ungotten chars */
X
X if (c_ungind >= NUNGETCH) /* pushback stack full */
X return( ERR );
X
X c_ungch[c_ungind++] = ch;
X return( OK );
X}
END_OF_FILE
if test 1121 -ne `wc -c <'portable/ungetch.c'`; then
echo shar: \"'portable/ungetch.c'\" unpacked with wrong size!
fi
# end of 'portable/ungetch.c'
fi
if test -f 'private/_clrscr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_clrscr.c'\"
else
echo shar: Extracting \"'private/_clrscr.c'\" \(763 characters\)
sed "s/^X//" >'private/_clrscr.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__clrscr = "$Header: c:/curses/private/RCS/_clrscr.c%v 2.0 1992/11/15 03:24:42 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_clr_scrn() - Clears the physical screen and homes the cursor.
X
X PDCurses Description:
X This is an internal routine called by the doupdate() routines.
X
X PDCurses Return Value:
X This routine always returns OK.
X
X Portability:
X PDCurses int PDC_clr_scrn( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint PDC_clr_scrn(WINDOW *win)
X{
X chtype attrs = win->_attrs;
X PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, attrs);
X PDC_gotoxy(0, 0);
X return( OK );
X}
END_OF_FILE
if test 763 -ne `wc -c <'private/_clrscr.c'`; then
echo shar: \"'private/_clrscr.c'\" unpacked with wrong size!
fi
# end of 'private/_clrscr.c'
fi
if test -f 'private/_findwin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_findwin.c'\"
else
echo shar: Extracting \"'private/_findwin.c'\" \(1042 characters\)
sed "s/^X//" >'private/_findwin.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifdef REGISTERWINDOWS
X#ifndef NDEBUG
Xchar *rcsid__findwin = "$Header: c:/curses/private/RCS/_findwin.c%v 2.0 1992/11/15 03:24:42 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_findwin() - Find a window in the visible windows list.
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X This routine is a part of the developing window registration
X system that will reach maturity soon.
X
X This routine returns the passed WINDOW*'s WINDS pointer.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses WINDS* PDC_findwin( WINDOW* win );
X
X**man-end**********************************************************************/
X
XWINDS* PDC_findwin(WINDOW *win)
X{
X WINDS* next = _cursvar.visible;
X
X while (next != (WINDS *)NULL)
X {
X if (next->w == win)
X break;
X next = next->next;
X }
X return( next );
X}
X#endif
END_OF_FILE
if test 1042 -ne `wc -c <'private/_findwin.c'`; then
echo shar: \"'private/_findwin.c'\" unpacked with wrong size!
fi
# end of 'private/_findwin.c'
fi
if test -f 'private/_getscrn.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_getscrn.c'\"
else
echo shar: Extracting \"'private/_getscrn.c'\" \(1068 characters\)
sed "s/^X//" >'private/_getscrn.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__getscrn = "$Header: c:/curses/private/RCS/_getscrn.c%v 2.0 1992/11/15 03:24:26 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_get_scrn_mode() - Return the current BIOS video mode
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Returns the current BIOS Video Mode Number.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X The FLEXOS version of this routine returns an ERR.
X
X Portability:
X PDCurses int PDC_get_scrn_mode( void );
X
X**man-end**********************************************************************/
X
X#ifdef OS2
XVIOMODEINFO PDC_get_scrn_mode(void)
X#else
Xint PDC_get_scrn_mode(void)
X#endif
X{
X#ifdef FLEXOS
X return( ERR );
X#endif
X#ifdef DOS
X regs.h.ah = 0x0f;
X int86(0x10, ®s, ®s);
X return ((int) regs.h.al);
X#endif
X#ifdef OS2
X VIOMODEINFO vioModeInfo;
X VioGetMode (&vioModeInfo, 0);
X return vioModeInfo;
X#endif
X}
END_OF_FILE
if test 1068 -ne `wc -c <'private/_getscrn.c'`; then
echo shar: \"'private/_getscrn.c'\" unpacked with wrong size!
fi
# end of 'private/_getscrn.c'
fi
if test -f 'private/_newline.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_newline.c'\"
else
echo shar: Extracting \"'private/_newline.c'\" \(962 characters\)
sed "s/^X//" >'private/_newline.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifndef NDEBUG
Xchar *rcsid__newline = "$Header: c:/curses/private/RCS/_newline.c%v 2.0 1992/11/15 03:24:17 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X PDC_newline() - Advances 1 newline from supplied line number.
X
X PDCurses Description:
X This is a private PDCurses routine.
X
X Does line advance and returns the new cursor line. If error,
X return -1.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X No errors are defined for this function.
X
X Portability:
X PDCurses int PDC_newline( WINDOW* win, int lin );
X
X**man-end**********************************************************************/
X
Xint PDC_newline(WINDOW *win, int lin)
X{
X if (win == (WINDOW *)NULL)
X return( -1 );
X
X if (++lin > win->_bmarg)
X {
X lin--;
X if (win->_scroll)
X scroll(win);
X else
X return( -1 );
X }
X return( lin );
X}
END_OF_FILE
if test 962 -ne `wc -c <'private/_newline.c'`; then
echo shar: \"'private/_newline.c'\" unpacked with wrong size!
fi
# end of 'private/_newline.c'
fi
if test -f 'private/_rmwin.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_rmwin.c'\"
else
echo shar: Extracting \"'private/_rmwin.c'\" \(1200 characters\)
sed "s/^X//" >'private/_rmwin.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X
X#ifdef REGISTERWINDOWS
X#ifndef NDEBUG
Xchar *rcsid__rmwin = "$Header: c:/curses/private/RCS/_rmwin.c%v 2.0 1992/11/15 03:24:32 MH Rel $";
X#endif
X
X
X
X
X/*man-start*********************************************************************
X
X _rmwin() - Unregister window
X
X PDCurses Description:
X This routine removes a window from the current visible list
X of windows.
X
X PDCurses Return Value:
X This function returns OK on success and ERR on error.
X
X PDCurses Errors:
X It is an error to call this function with a NULL window pointer.
X
X Portability:
X PDCurses int _rmwin( WINDOW* win );
X
X**man-end**********************************************************************/
X
Xint _rmwin(WINDOW *win)
X{
Xextern void (*fre)();
X
X WINDS *w = _findwin(win);
X WINDS *next;
X WINDS *prev;
X
X if (w != (WINDS *)NULL)
X {
X if (_cursvar.visible == w)
X {
X _cursvar.visible = w->next;
X (*fre)(w);
X }
X else
X if (w->next == NULL)
X {
X if (w->prev != NULL)
X {
X w->prev->next = NULL;
X (*fre)(w);
X }
X }
X else
X {
X next = w->next;
X prev = w->prev;
X next->prev = prev;
X prev->next = next;
X (*fre)(w);
X }
X return( OK );
X }
X return( ERR );
X}
X#endif
END_OF_FILE
if test 1200 -ne `wc -c <'private/_rmwin.c'`; then
echo shar: \"'private/_rmwin.c'\" unpacked with wrong size!
fi
# end of 'private/_rmwin.c'
fi
if test -f 'private/_usleep.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'private/_usleep.c'\"
else
echo shar: Extracting \"'private/_usleep.c'\" \(1149 characters\)
sed "s/^X//" >'private/_usleep.c' <<'END_OF_FILE'
X#define CURSES_LIBRARY 1
X#include <curses.h>
X#undef PDC_usleep
X
X#if defined(DOS) && defined(MSC)
X#include <time.h>
X#endif
X
X#ifndef NDEBUG
Xchar *rcsid__usleep = "$Header: c:/curses/private/RCS/_usleep.c%v 2.0 1992/11/15 03:24:40 MH Rel $";
X#endif
X
X
X
X/*man-start*********************************************************************
X
X PDC_usleep() - waits for specified number of microseconds
X
X PDCurses Description:
X This routine is intended to provide a mechanism to wait the
X specified number of microseconds. This routine is provided for
X users of the Microsoft compilers under DOS as the default
X library does not provide a suitable function.
X Under any other Operating System/Compiler option, this function
X does nothing.
X
X Portability:
X PDCurses void PDC_usleep( clock_t );
X
X Acknowledgement
X PDC_usleep() was written by John Steele (jst...@netcom.com)
X
X**man-end**********************************************************************/
X
X#if defined(DOS) && defined(MSC)
Xvoid PDC_usleep(clock_t wait)
X{
X clock_t goal;
X goal = wait + clock();
X while (goal > clock())
X ;
X return;
X}
X#else
Xvoid PDC_usleep(long wait)
X{
X return;
X}
X#endif
END_OF_FILE
if test 1149 -ne `wc -c <'private/_usleep.c'`; then
echo shar: \"'private/_usleep.c'\" unpacked with wrong size!
fi
# end of 'private/_usleep.c'
fi
echo shar: End of archive 11 \(of 11\).
cp /dev/null ark11isdone