diff --git a/curses.h b/curses.h index 0470f761..dc877a32 100644 --- a/curses.h +++ b/curses.h @@ -1,2111 +1,2111 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -/* -$Id: curses.h,v 1.1 2001/01/10 08:31:31 mark Exp $ -*/ -/* -*---------------------------------------------------------------------- -* PDCurses -*---------------------------------------------------------------------- -* MH -* 991212 2.4 -* Key modifiers pressed by themselves are now returned as keys -* KEY_SHIFT_L KEY_SHIFT_R -* KEY_CONTROL_L KEY_CONTROL_R -* KEY_ALT_L KEY_ALT_R -* This works on Win32 and X11 ports only -* Added support for lcc-win32, supplied by Matthias Burian -* Added support for MingW32, and CygnusW32 compilers -* Added clipboard support for X11, Win32 and OS/2 ports -* Added ability to get to the input file descriptor -* New function for X11; Xinitscr() which allows standard X11 -* switches to be passed to the application -* Added X11 shared library support -* -* MH -* 960920 2.3 Added more System V R4 functions -* -* Rewrote X11 port -* -* Added Win32 port - original port by Chris Szurgot -* some updates by Mark Hessling -* some updates by Gurusamy Sarathy -* -* slk() functions added by Kim Huron -* -* Support for more and newer versions of compilers -* -* Added mouse support for X11 and Win32 ports -* -* Size of chtype now long -* -* MH -* 950126 2.2 Added more System V R4 functions -* -* Added beta Xwindows port -* -* Changed chtype to long -* -* Incorporated panels library -* -* Support for more and newer versions of compilers -* -* MH -* 930531 2.1 Added support for djgpp -* -* Added beta Unix version -* -* Added OS/2 DLL support. -* -* Changed behaviour of overlay(), overwrite() and typeahead() -* -* 921120 2.0 Changed #if to #ifdef/#if defined to make it -* easier to add new platforms/compilers. -* -* Added System V colour support. -* -* Added OS/2 port. -*------- -* Frotz -* 911221 2.0 pre-beta Changed back from short to int. (int is the -* correct size for the default platform. Short -* might be too short on some platforms. This -* is more portable. I, also, made this mistake.) -* -* Many functions are now macros. If you want -* the real thing, #undef the macro. (X/Open -* requirement.) -* -* Merged many sources into current release. -* -* Added many X/Open routines (not quite all yet). -* -* Added internal documentation to all routines. -* -* Added a HISTORY file to the environment. -* -* Added a CONTRIB file to the environment. -*------- -* bl 900114 1.4 Window origin mod in overlay() and overwrite(), on -* public (and very reasonable) request. Swapped -* #define'd values of OK and ERR; OK now 1, and -* ERR is 0/NULL. Conforms better to UNIX -* versions. borderchars[] removed from WINDOW -* struct since the border() functions were -* redefined. Use of short wherever possible. -* Portability improvements, mispelled name of -* [w]setscrreg(). -* -* 881005 1.3 All modules lint-checked with MSC '-W3' and -* turbo'C' '-w -w-pro' switches. Support for -* border(), wborder() functions. -* -* 881002 1.2 Rcsid[] string in all modules, for maintenance. -* -* 880306 1.1 'Raw' output routines, revision info in curses.h. -* -* 870515 1.0 Initial Release. -* -*---------------------------------------------------------------------- -*/ -#if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS) - extern "C" - { -# define bool _bool -#endif - -#ifndef __PDCURSES__ -#define __PDCURSES__ 1 - -/*man-start********************************************************************* - -All defines are "defined" here. All compiler and environment -specific definitions are defined into generic class defines. -These defines are to be given values so that the code can -rely on #if, rather than a complicated set of #if defined() or -#ifdefs... - -PDCurses definitions list: (Only define those needed) - - REGISTERWINDOWS True for auto window update registery. - FAST_VIDEO True if display is memory mapped, or - we can utilize the fast video update routines. - DOS True if compiling for DOS. - OS2 True if compiling for OS/2. - WIN32 True if compiling for Windoze 95 or Windoze NT - FLEXOS True if compiling for Flexos. - HC True if using a Metaware compiler. - TC True if using a Borland compiler. - MSC True if using a Microsoft compiler. - HAVE_PROTO True if the compiler supports ANSI prototypes. - CPLUSPLUS True if the compiler supports C++. - PDC_BUILD???? Defines API build version. - -PDCurses portable platform definitions list: - - PDCURSES Enables access to PDCurses-only routines. - XOPEN Always true. - SYSVcurses True if you are compiling for SYSV portability. - BSDcurses True if you are compiling for BSD portability. - PDCURSES_WCLR Makes behaviour of wclrtoeol() and wclrtoeof() - unique to PDCurses. By default Unix behavior is set. - See notes in wclrtoeol() and wclrtoeof(). -**man-end**********************************************************************/ - -#define PDC_BUILD 2401 -#define PDCURSES 1 /* PDCurses-only routines */ -#define XOPEN 1 /* X/Open Curses routines */ -#define SYSVcurses 1 /* System V Curses routines */ -#define BSDcurses 1 /* BSD Curses routines */ -#define CHTYPE_LONG 1 /* size of chtype; long */ - -#define PDC_CDECL /* default define this as empty */ - -/*---------------------------------------- -* BORLAND COMPILERS Turbo C[++], Borland C[++] -* -* Borland definitions: -* TC -* DOS -* OS2 -* CPLUSPLUS -* -* __TURBOC__, __MSDOS__, -* __OS2__ and __WIN32__ -* are predefined by compiler. -*/ -#ifdef __TURBOC__ /* Borland gives defines this as a value*/ -# define TC __TURBOC__ /* Define a value for TC */ -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* Borland supports ANSI C prototypes */ -# endif -# ifdef __MSDOS__ -# define DOS 6 /* Major release of DOS supported */ -# include -# include -# endif -# ifdef __OS2__ -# define OS2 3 /* Major release of OS/2 supported */ -# define INCL_VIO -# define INCL_KBD -# include -# endif -# ifdef __WIN32__ -# ifdef INCLUDE_WINDOWS_H /* only include for WIN32 files */ -# include -# ifdef MOUSE_MOVED /* get rid of Windows #define */ -# undef MOUSE_MOVED -# endif -# endif -# ifndef WIN32 -# define WIN32 1 -# endif -# endif -# if __TURBOC__ >= 0x290 -# ifdef __BCPLUSPLUS__ -# define CPLUSPLUS 1 /* Define that we are compiling C++. */ -# endif -# ifdef __TCPLUSPLUS__ -# define CPLUSPLUS 1 /* Define that we are compiling C++. */ -# endif -# ifdef __CPLUSPLUS__ -# define CPLUSPLUS 1 /* Define that we are compiling C++. */ -# endif -# endif -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -# ifndef HAVE_MEMORY_H -# define HAVE_MEMORY_H /* have */ -# endif -# ifndef HAVE_STDARG_H -# define HAVE_STDARG_H /* have */ -# endif -# ifndef HAVE_MEMMOVE -# define HAVE_MEMMOVE /* have memmove() */ -# endif -# ifndef HAVE_VSSCANF -# define HAVE_VSSCANF /* have vsscanf() */ -# endif -#endif - - -/*---------------------------------------- -* METAWARE COMPILERS High C -* -* Metaware definitions: -* HC -* DOS -* FLEXOS -*/ -#ifdef __HIGHC__ -# define HC 1 -# pragma off(prototype_override_warnings) -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* Metaware supports ANSI C prototypes */ -# endif -# ifdef __MSDOS__ -# define DOS 6 /* Major release of DOS supported */ -# include -# include -# endif -# ifdef __FLEXOS__ /* define this on the command line */ -# define FLEXOS 2 /* or latest major release value. */ -# endif -#endif - -/*---------------------------------------- -* MICROSOFT COMPILERS MSC -* -* Microsoft definitions: -* MSC -* DOS || OS2 -*/ -#ifdef _MSC_VER /* defined by compiler */ -# define MSC 1 -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* Microsoft supports ANSI C prototypes */ -# endif -# ifdef __OS2__ /* You will have to define in makefile */ -# define USE_OS2_H 1 /* Use the os2.h for the compiler */ -# define OS2 3 /* Major release of OS/2 supported */ -# define INCL_VIO -# define INCL_KBD -# include -# define FARKeyword far -# define APIRET USHORT -# else /* no __OS2__ define, so assume DOS */ -# ifdef _WIN32 -# ifndef WIN32 -# define WIN32 -# endif -# ifdef INCLUDE_WINDOWS_H /* only include for WIN32 files */ -# include -# ifdef MOUSE_MOVED /* get rid of Windows #define */ -# undef MOUSE_MOVED -# endif -# endif -# ifndef HAVE_MEMORY_H -# define HAVE_MEMORY_H /* have */ -# endif -# ifndef HAVE_STDARG_H -# define HAVE_STDARG_H /* have */ -# endif -# else -# define DOS 6 /* Major release of DOS supported */ -# include -# include -# undef HAVE_VSSCANF /* vsscanf() function NOT in library */ -# endif -# endif -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -# ifndef HAVE_MEMMOVE -# define HAVE_MEMMOVE /* have memmove() */ -# endif -#endif - -/*---------------------------------------- -* MICROSOFT QUICK C COMPILERS QC -* -*/ -#ifdef _QC /* defined by compiler */ -# define MSC 1 -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* QuickC supports ANSI C prototypes */ -# endif -# define DOS 6 /* Major release of DOS supported */ -# include -# include -# undef HAVE_VSSCANF /* vsscanf() function NOT in library */ -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -#endif - -/*---------------------------------------- -* TOPSPEED compilers TSC -* -* TOPSPEED definitions: -* TSC -* DOS || OS2 -*/ -#ifdef __TSC__ /* You may have to define in makefile */ -# define TSC 1 -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* TopSpeed supports ANSI C prototypes */ -# endif -# ifdef __OS2__ -# define OS2 3 /* Major release of OS/2 supported */ -# define INCL_VIO -# define INCL_KBD -# include -# endif -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -#endif - -/*---------------------------------------- -* IBM C Set/2 Compiler CSET2 -* -* IBM definitions: -* CSET2 -* OS2 -*/ -#ifdef __IBMC__ -# define CSET2 1 -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* C Set/2 supports ANSI C prototypes */ -# endif -# ifndef HAVE_STDARG_H -# define HAVE_STDARG_H /* have */ -# endif -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -# ifndef HAVE_MEMORY_H -# define HAVE_MEMORY_H /* have */ -# endif -# ifndef HAVE_MEMMOVE -# define HAVE_MEMMOVE /* have memmove() */ -# endif -# ifdef __OS2__ -# define OS2 3 /* Major release of OS/2 supported */ -# define INCL_VIO -# define INCL_KBD -# include -# endif -#endif - -/*---------------------------------------- -* GNU compilers emx -* -* emx definitions: -* EMX -* OS2 -*/ -#ifdef __EMX__ /* You may have to define in makefile */ -# define EMX 1 -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* emx supports ANSI C prototypes */ -# endif -# define __OS2__ /* EMX does not define this :-( */ -# define OS2 3 /* Major release of OS/2 supported */ -# define CURSES__32BIT__ -# ifndef HAVE_STDARG_H -# define HAVE_STDARG_H /* have */ -# endif -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -# ifndef HAVE_MEMORY_H -# define HAVE_MEMORY_H /* have */ -# endif -# ifndef HAVE_UNISTD_H -# define HAVE_UNISTD_H /* have */ -# endif -# ifndef HAVE_MEMMOVE -# define HAVE_MEMMOVE /* have memmove() */ -# endif -# ifndef HAVE_VSSCANF -# define HAVE_VSSCANF /* have vsscanf() */ -# endif -# if defined(EMXVIDEO) -# include -# include -# else -# define INCL_VIO -# define INCL_KBD -# include -# endif -#endif - -/*---------------------------------------- -* GNU compilers djgpp -* -* djgpp definitions: -* GO32 -* DOS -*/ -#ifdef GO32 /* You may have to define in makefile */ -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* DJGPP supports ANSI C prototypes */ -# endif -# define DOS 6 -# include -# ifdef __FLEXOS__ /* define this on the command line */ -# define FLEXOS 2 /* or latest major release value. */ -# endif -# define CURSES__32BIT__ -# ifdef _cplusplus -# define CPLUSPLUS 1 -# endif -# ifndef HAVE_STDARG_H -# define HAVE_STDARG_H /* have */ -# endif -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -# ifndef HAVE_MEMORY_H -# define HAVE_MEMORY_H /* have */ -# endif -# ifndef HAVE_UNISTD_H -# define HAVE_UNISTD_H /* have */ -# endif -# ifndef HAVE_MEMMOVE -# define HAVE_MEMMOVE /* have memmove() */ -# endif -# ifndef HAVE_USLEEP -# define HAVE_USLEEP /* have usleep() */ -# endif -#endif - - -/*---------------------------------------- -* GNU compilers Cygnus Win32 -* -* cygnus definitions: -* WIN32 -*/ -#ifdef __CYGWIN32__ /* You may have to define in makefile */ -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* Cygnuc GCC supports ANSI C prototypes */ -# endif -# ifdef INCLUDE_WINDOWS_H -# include -# ifdef MOUSE_MOVED -# undef MOUSE_MOVED -# endif -# endif -# ifndef WIN32 -# define WIN32 -# endif -# ifndef INT_MAX -# define INT_MAX 32762 -# endif -# define CURSES__32BIT__ -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -# ifndef HAVE_MEMORY_H -# define HAVE_MEMORY_H /* have */ -# endif -# ifndef HAVE_STDARG_H -# define HAVE_STDARG_H /* have */ -# endif -# ifndef HAVE_UNISTD_H -# define HAVE_UNISTD_H /* have */ -# endif -# ifndef HAVE_MEMMOVE -# define HAVE_MEMMOVE /* have memmove() */ -# endif -# ifndef HAVE_USLEEP -# define HAVE_USLEEP /* have usleep() */ -# endif -#endif - -/*---------------------------------------- -* GNU compilers Ming Win32 -* -* Ming definitions: -* WIN32 -*/ -#ifdef __MINGW32__ -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* Ming GCC supports ANSI C prototypes */ -# endif -# ifdef INCLUDE_WINDOWS_H -# include -# ifdef MOUSE_MOVED -# undef MOUSE_MOVED -# endif -# endif -# ifndef WIN32 -# define WIN32 -# endif -# define CURSES__32BIT__ -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -# ifndef HAVE_MEMORY_H -# define HAVE_MEMORY_H /* have */ -# endif -# ifndef HAVE_STDARG_H -# define HAVE_STDARG_H /* have */ -# endif -# ifndef HAVE_UNISTD_H -# define HAVE_UNISTD_H /* have */ -# endif -# ifndef HAVE_MEMMOVE -# define HAVE_MEMMOVE /* have memmove() */ -# endif -#endif - -/*---------------------------------------- -* LCC WIN32 -* -*/ -#ifdef __LCC__ /* should already be defined by the compiler */ -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* LCC-Win32 supports ANSI C prototypes */ -# endif -# ifdef INCLUDE_WINDOWS_H -# include -# ifdef MOUSE_MOVED -# undef MOUSE_MOVED -# endif -# endif -# ifndef WIN32 -# define WIN32 -# endif -# ifndef INT_MAX -# define INT_MAX 32762 -# endif -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -# ifndef HAVE_MEMORY_H -# define HAVE_MEMORY_H /* have */ -# endif -# ifndef HAVE_STDARG_H -# define HAVE_STDARG_H /* have */ -# endif -# ifndef HAVE_MEMMOVE -# define HAVE_MEMMOVE /* have memmove() */ -# endif -#endif - -/*---------------------------------------- -* Watcom C/C++ 10.6 compiler -* -* WATCOM definitions: -* WATCOMC -* OS2 -* WIN32 -*/ -#ifdef __WATCOMC__ -# define WATCOMC 1 -# ifndef HAVE_PROTO -# define HAVE_PROTO 1 /* Watcom C supports ANSI C prototypes */ -# endif -# define CURSES__32BIT__ -# if defined( __DOS__ ) || defined( __DOS4G__ ) -# define DOS 7 /* Major release of DOS supported */ -# include -# include -# include -# ifdef __386__ -# define int86 int386 -# define int86x int386x -# endif -# endif -# if defined( __OS2__ ) || defined( __OS2V2__ ) -# define OS2 3 /* Major release of OS/2 supported */ -# define CURSES__32BIT__ -# define INCL_VIO -# define INCL_KBD -# include -# endif -# ifdef __NT__ /* This specifies WIN32 target */ -# ifdef INCLUDE_WINDOWS_H -# include -# ifdef MOUSE_MOVED -# undef MOUSE_MOVED -# endif -# endif -# ifndef WIN32 -# define WIN32 -# endif - -/* -# ifdef PDC_CDECL -# undef PDC_CDECL -# define PDC_CDECL cdecl -# endif -*/ - -# endif -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -# ifndef HAVE_MEMORY_H -# define HAVE_MEMORY_H /* have */ -# endif -# ifndef HAVE_STDARG_H -# define HAVE_STDARG_H /* have */ -# endif -# ifndef HAVE_MEMMOVE -# define HAVE_MEMMOVE /* have memmove() */ -# endif -# ifndef HAVE_VSSCANF -# define HAVE_VSSCANF /* have vsscanf() */ -# endif -#endif - -#if 0 -/*---------------------------------------- -* gcc under UNIX -* -* GNU definitions: -* UNIX -*/ -#ifdef UNIX -# define HAVE_PROTO 1 /* GNU C supports ANSI C prototypes */ -# ifdef SUNOS -# define NO_VSSCANF -# define NO_MEMMOVE -# undef BSD -# endif -# ifdef linux -# undef BSD -# endif -#endif -#endif - -/*---------------------------------------- -* MicroWay NDP C/C++ 386 4.2.0 compiler -*/ -#ifdef MX386 -# define HAVE_PROTO 1 -# define NDP 1 -# include -# ifdef DOS -# define MK_FP(seg,ofs) ( (((int) (seg)) << 4) + ((int) (ofs)) ) -# ifdef __i860 - typedef void _int; -# else - typedef int _int; -# endif -# endif -# undef NO_VSSCANF /* vsscanf() function NOT in library */ -# ifndef HAVE_LIMITS_H -# define HAVE_LIMITS_H /* have */ -# endif -#endif - -/*---------------------------------------------------------------------*/ -#include /* Required by X/Open usage below */ -/*---------------------------------------------------------------------- - * - * PDCurses Manifest Constants - * - */ -#ifndef FALSE /* booleans */ -# define FALSE 0 -#endif -#ifndef TRUE /* booleans */ -# define TRUE !FALSE -#endif -#ifndef NULL -# define NULL 0 /* Null pointer */ -#endif -#ifndef ERR -# define ERR 0 /* general error flag */ -#endif -#ifndef OK -# define OK 1 /* general OK flag */ -#endif - - -/*---------------------------------------------------------------------- - * - * PDCurses Type Declarations - * - */ -typedef unsigned char bool; /* PDCurses Boolean type */ - -#ifdef CHTYPE_LONG -typedef unsigned long chtype; /* 16-bit attr + 16-bit char */ -#else -typedef unsigned short chtype; /* 8-bit attr + 8-bit char */ -#endif - -/*---------------------------------------------------------------------- - * This defines a new type for attributes. - * - */ -typedef chtype attr_t; - -/*---------------------------------------------------------------------- - * Define our mouse interface - same as SYSVR4 (with extensions) - */ - -typedef struct -{ - int x; /* absolute column, 0 based, measured in characters */ - int y; /* absolute row, 0 based, measured in characters */ - short button[3]; /* state of each button */ - int changes; /* flags indicating what has changed with the mouse */ -} MOUSE_STATUS; - - -#define BUTTON_RELEASED 0000 -#define BUTTON_PRESSED 0001 -#define BUTTON_CLICKED 0002 -#define BUTTON_DOUBLE_CLICKED 0003 -#define BUTTON_TRIPLE_CLICKED 0004 -#define BUTTON_MOVED 0005 /* PDCurses enhancement */ -#define BUTTON_ACTION_MASK 0007 /* PDCurses enhancement */ -#define BUTTON_SHIFT 0010 /* PDCurses enhancement */ -#define BUTTON_CONTROL 0020 /* PDCurses enhancement */ -#define BUTTON_ALT 0040 /* PDCurses enhancement */ -#define BUTTON_MODIFIER_MASK 0070 /* PDCurses enhancement */ - -#define MOUSE_X_POS (Mouse_status.x) -#define MOUSE_Y_POS (Mouse_status.y) -#define A_BUTTON_CHANGED (Mouse_status.changes & 7) -#define MOUSE_MOVED (Mouse_status.changes & 8) -#define MOUSE_POS_REPORT (Mouse_status.changes & 16) -#define BUTTON_CHANGED(x) (Mouse_status.changes & (1 << ((x) - 1))) -#define BUTTON_STATUS(x) (Mouse_status.button[(x)-1]) - -/* mouse bit-masks */ -#define BUTTON1_RELEASED 000000000001L -#define BUTTON1_PRESSED 000000000002L -#define BUTTON1_CLICKED 000000000004L -#define BUTTON1_DOUBLE_CLICKED 000000000010L -#define BUTTON1_TRIPLE_CLICKED 000000000020L -#define BUTTON1_MOVED 000000000020L /* PDCurses enhancement */ -#define BUTTON2_RELEASED 000000000040L -#define BUTTON2_PRESSED 000000000100L -#define BUTTON2_CLICKED 000000000200L -#define BUTTON2_DOUBLE_CLICKED 000000000400L -#define BUTTON2_TRIPLE_CLICKED 000000001000L -#define BUTTON2_MOVED 000000001000L /* PDCurses enhancement */ -#define BUTTON3_RELEASED 000000002000L -#define BUTTON3_PRESSED 000000004000L -#define BUTTON3_CLICKED 000000010000L -#define BUTTON3_DOUBLE_CLICKED 000000020000L -#define BUTTON3_TRIPLE_CLICKED 000000040000L -#define BUTTON3_MOVED 000000040000L /* PDCurses enhancement */ -#define BUTTON_MODIFIER_SHIFT 000000100000L /* PDCurses enhancement */ -#define BUTTON_MODIFIER_CONTROL 000000200000L /* PDCurses enhancement */ -#define BUTTON_MODIFIER_ALT 000000400000L /* PDCurses enhancement */ -#define ALL_MOUSE_EVENTS 000000777777L -#define REPORT_MOUSE_POSITION 000001000000L - -/*---------------------------------------------------------------------- - * - * PDCurses Structure Definitions: - * - */ -typedef struct _win /* definition of a window. */ -{ - int _cury; /* current pseudo-cursor */ - int _curx; - int _maxy; /* max window coordinates */ - int _maxx; - int _pmaxy; /* max physical size */ - int _pmaxx; - int _begy; /* origin on screen */ - int _begx; - int _lastpy; /* last y coordinate of upper left pad display area */ - int _lastpx; /* last x coordinate of upper left pad display area */ - int _lastsy1; /* last upper y coordinate of screen window for pad */ - int _lastsx1; /* last upper x coordinate of screen window for pad */ - int _lastsy2; /* last lower y coordinate of screen window for pad */ - int _lastsx2; /* last lower x coordinate of screen window for pad */ - int _flags; /* window properties */ - attr_t _attrs; /* standard A_STANDOUT attributes and colors */ - chtype _bkgd; /* wrs(4/6/93) background, normally blank */ - int _tabsize; /* tab character size */ - bool _clear; /* causes clear at next refresh */ - bool _leaveit; /* leaves cursor where it is */ - bool _scroll; /* allows window scrolling */ - bool _nodelay; /* input character wait flag */ - bool _immed; /* immediate update flag */ - bool _sync; /* synchronise window ancestors */ - bool _use_keypad; /* flags keypad key mode active */ - bool _use_idl; /* True if Ins/Del line can be used*/ - bool _use_idc; /* True if Ins/Del character can be used*/ - chtype**_y; /* pointer to line pointer array */ - int* _firstch; /* first changed character in line */ - int* _lastch; /* last changed character in line */ - int _tmarg; /* top of scrolling region */ - int _bmarg; /* bottom of scrolling region */ - char* _title; /* window title */ - char _title_ofs; /* window title offset from left */ - attr_t _title_attr; /* window title attributes */ - chtype _blank; /* window's blank character */ - int _parx, _pary; /* coords relative to parent (0,0) */ -struct _win* _parent; /* subwin's pointer to parent win */ -} WINDOW; - - - -/*---------------------------------------------------------------------- -* -* Private structures that are necessary for correct -* macro construction. -* -*/ - -#ifdef REGISTERWINDOWS -typedef struct _ref /* Refresh Window Structure */ -{ - WINDOW* win; -struct _ref* next; -struct _ref* tail; -} ACTIVE; - -typedef struct _wins -{ - WINDOW* w; /* pointer to a visible window */ - struct _wins* next; /* Next visible window pointer */ - struct _wins* prev; /* Next visible window pointer */ - struct _wins* tail; /* Last visible window pointer */ - /* Only head window (stdscr) has */ - /* a valid tail pointer. */ -} WINDS; -#endif - -typedef struct /* structure for ripped off lines */ -{ - int line; - int (*init)(); -} RIPPEDOFFLINE; - - -typedef struct -{ - bool alive; /* if initscr() called */ - bool autocr; /* if lf -> crlf */ - bool cbreak; /* if terminal unbuffered */ - bool echo; /* if terminal echo */ - bool raw_inp; /* raw input mode (v. cooked input) */ - bool raw_out; /* raw output mode (7 v. 8 bits) */ - bool refrbrk; /* if premature refresh brk allowed */ - bool orgcbr; /* original MSDOS ^-BREAK setting */ - bool visible_cursor; /* TRUE if cursor is visible */ - bool audible; /* FALSE if the bell is visual */ - bool full_redraw; /* TRUE for bad performance */ - bool direct_video; /* Allow Direct Screen Memory writes*/ - bool mono; /* TRUE if current screen is mono. */ - bool sizeable; /* TRUE if adapter is resizeable. */ - bool resized; /* TRUE if TERM has been resized */ - bool bogus_adapter; /* TRUE if adapter has insane values*/ - bool shell; /* TRUE if reset_prog_mode() needs */ - /* to be called. */ - chtype blank; /* Background character */ - attr_t orig_attr; /* Original screen attributes */ - int cursrow; /* position of physical cursor */ - int curscol; /* position of physical cursor */ - int cursor; /* Current Cursor definition */ - int visibility; /* Visibility of cursor */ - int video_page; /* Current PC video page */ - int orig_emulation; /* Original cursor emulation value */ - int orig_cursor; /* Original cursor size */ - int font; /* default font size */ - int orig_font; /* Original font size */ - int lines; /* New value for LINES */ - int cols; /* New value for COLS */ - unsigned long _trap_mbe; /* trap these mouse button events */ - unsigned long _map_mbe_to_key; /* map mouse buttons to slk */ - int slklines; /* Lines in use by slk_init() */ - WINDOW * slk_winptr; /* window for slk */ - int linesrippedoff; /* Lines ripped off via ripoffline() */ - int linesrippedoffontop; /* Lines ripped off on top via ripoffline() */ - int delaytenths; /* 1/10ths second to wait block getch() for */ - bool _preserve; /* TRUE if screen background to be preserved */ - bool _restore; /* TRUE if screen background to be restored */ - bool save_key_modifiers; /* TRUE if each key modifiers saved with each key press */ - bool return_key_modifiers; /* TRUE if modifier keys are returned as "real" keys */ - -#ifdef OS2 -# ifdef EMXVIDEO /* nop if using EMX builtins */ - int tahead; /* Type-ahead value */ - int adapter; /* Screen type */ -# else - VIOMODEINFO scrnmode; /* default screen mode */ - VIOCONFIGINFO adapter; /* Screen type */ -# endif -#else - int adapter; /* Screen type */ -#endif - -#if defined(DOS) || defined(WIN32) - int scrnmode; /* default screen mode */ - unsigned video_seg; /* video base segment */ - unsigned video_ofs; /* video base offset */ -#endif - -#if defined(OS2) || defined(WIN32) - int num_mouse_buttons; /* number of mouse buttons */ -#endif - -#if defined (XCURSES) - int XcurscrSize; /* size of Xcurscr shared memory block */ - bool sb_on; - int sb_viewport_y; - int sb_viewport_x; - int sb_total_y; - int sb_total_x; - int sb_cur_y; - int sb_cur_x; -#endif - -#ifdef REGISTERWINDOWS - WINDS* visible; /* List of visible windows */ - bool refreshall; /* Refresh all registered windows? */ -#endif - -} SCREEN; - - -/* external variables */ -#if !defined(PDC_STATIC_BUILD) && defined(_MSC_VER) && defined(WIN32) && !defined(CURSES_LIBRARY) -__declspec(dllimport) int LINES; /* terminal height */ -__declspec(dllimport) int COLS; /* terminal width */ -__declspec(dllimport) WINDOW* stdscr; /* the default screen window */ -__declspec(dllimport) WINDOW* curscr; /* the current screen image */ -__declspec(dllimport) SCREEN *SP; /* curses variables */ -__declspec(dllimport) int use_emalloc; /* set to true to use your own malloc,etc */ -__declspec(dllimport) MOUSE_STATUS Mouse_status; -__declspec(dllimport) int COLORS; -__declspec(dllimport) int COLOR_PAIRS; -#else -# if !defined(PDC_STATIC_BUILD) && defined(_MSC_VER) && defined(WIN32) -__declspec(dllexport) extern int LINES; /* terminal height */ -__declspec(dllexport) extern int COLS; /* terminal width */ -__declspec(dllexport) extern WINDOW* stdscr; /* the default screen window */ -__declspec(dllexport) extern WINDOW* curscr; /* the current screen image */ -__declspec(dllexport) extern SCREEN *SP; /* curses variables */ -__declspec(dllexport) extern int use_emalloc; /* set to true to use your own malloc,etc */ -__declspec(dllexport) extern MOUSE_STATUS Mouse_status; -__declspec(dllexport) extern int COLORS; -__declspec(dllexport) extern int COLOR_PAIRS; -# else -extern int LINES; /* terminal height */ -extern int COLS; /* terminal width */ -extern WINDOW* stdscr; /* the default screen window */ -extern WINDOW* curscr; /* the current screen image */ -extern SCREEN *SP; /* curses variables */ -extern int use_emalloc; /* set to true to use your own malloc,etc */ -extern MOUSE_STATUS Mouse_status; -extern int COLORS,COLOR_PAIRS; -# endif -#endif - -#if defined (CURSES_LIBRARY) -extern int _default_lines; /* For presetting maximum lines */ -#endif - -#ifdef REGISTERWINDOWS -extern ACTIVE* CurWins; /* Currently Visible Windows */ -#endif - - - - -/*man-start********************************************************************* - -PDCurses Text Attributes: - -To include colour in PDCurses, a number of things had to be sacrificed -from the strict Unix and System V support. -The main problem is fitting all character attributes and colour into -an unsigned char (all 8 bits!). On System V, chtype is a long on -PDCurses it is a short int. - -The following is the structure of a win->_attrs chtype: - -------------------------------------------------------------------------------------------------- -|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| -------------------------------------------------------------------------------------------------- - colour number | modifiers | character eg 'a' (potential for DBCS) - -The available attribute modifiers are bold, underline, invisible, protect, reverse -and blink. - -**man-end**********************************************************************/ - -/* Video attribute definitions. */ -#ifdef CHTYPE_LONG -#define A_NORMAL 0x00000000L -#define A_STANDOUT 0x00A00000L -#define A_BOLD 0x00800000L -#define A_UNDERLINE 0x00100000L -#define A_REVERSE 0x00200000L -#define A_BLINK 0x00400000L -#define A_DIM 0x00020000L -#define A_INVIS 0x00080000L -#define A_PROTECT 0x00010000L -#define A_ALTCHARSET 0x00040000L -#define A_ATTRIBUTES 0xFFFF0000L -#define A_CHARTEXT 0x0000FFFFL -#define A_COLOR 0xFF000000L - -#else - -#define A_NORMAL (chtype)0x0000 /* SysV */ -#define A_ALTCHARSET (chtype)0x0000 /* X/Open */ -#define A_BLINK (chtype)0x0400 /* X/Open */ -#define A_BLANK (chtype)0x0000 /* X/Open */ -#define A_BOLD (chtype)0x0100 /* X/Open */ -#define A_DIM (chtype)0x0000 /* X/Open */ -#define A_PROTECT (chtype)0x0000 /* X/Open */ -#define A_REVERSE (chtype)0x0200 /* X/Open */ -#define A_STANDOUT ((chtype)(A_REVERSE | A_BOLD)) /* X/Open */ -#define A_UNDERLINE (chtype)0x0000 /* X/Open */ -#define A_COLOR (chtype)0xF800 /*System V */ -#define A_CHARTEXT (chtype)(0xFF) /* X/Open */ -#define A_ATTRIBUTES (chtype)(~A_CHARTEXT) /* X/Open */ -#endif - -#define CHR_MSK A_CHARTEXT /* Obsolete */ -#define ATR_MSK A_ATTRIBUTES /* Obsolete */ -#define ATR_NRM A_NORMAL /* Obsolete */ - -#ifdef XCURSES -extern chtype *acs_map; - -# define ACS_BSSB (acs_map['l']) -# define ACS_SSBB (acs_map['m']) -# define ACS_BBSS (acs_map['k']) -# define ACS_SBBS (acs_map['j']) -# define ACS_SBSS (acs_map['u']) -# define ACS_SSSB (acs_map['t']) -# define ACS_SSBS (acs_map['v']) -# define ACS_BSSS (acs_map['w']) -# define ACS_BSBS (acs_map['q']) -# define ACS_SBSB (acs_map['x']) -# define ACS_SSSS (acs_map['n']) - -# define ACS_ULCORNER ACS_BSSB -# define ACS_LLCORNER ACS_SSBB -# define ACS_URCORNER ACS_BBSS -# define ACS_LRCORNER ACS_SBBS -# define ACS_RTEE ACS_SBSS -# define ACS_LTEE ACS_SSSB -# define ACS_BTEE ACS_SSBS -# define ACS_TTEE ACS_BSSS -# define ACS_HLINE ACS_BSBS -# define ACS_VLINE ACS_SBSB -# define ACS_PLUS ACS_SSSS - -# define ACS_S1 (acs_map['o']) -# define ACS_S9 (acs_map['s']) -# define ACS_DIAMOND (acs_map['\'']) -# define ACS_CKBOARD (acs_map['a']) -# define ACS_DEGREE (acs_map['f']) -# define ACS_PLMINUS (acs_map['g']) -# define ACS_BULLET (acs_map['~']) -# define ACS_LARROW (acs_map[',']) -# define ACS_RARROW (acs_map['+']) -# define ACS_DARROW (acs_map['.']) -# define ACS_UARROW (acs_map['-']) -# define ACS_BOARD (acs_map['h']) -# define ACS_LANTERN (acs_map['i']) -# define ACS_BLOCK (acs_map['0']) - -# define ACS_S3 (acs_map['p']) -# define ACS_S7 (acs_map['r']) -# define ACS_LEQUAL (acs_map['y']) -# define ACS_GEQUAL (acs_map['z']) -# define ACS_PI (acs_map['{']) -# define ACS_NEQUAL (acs_map['|']) -# define ACS_STERLING (acs_map['}']) -#endif - -#if defined(DOS) || defined(OS2) || defined(WIN32) -/* ALTCHARSET definitions from jshumate@wrdis01.robins.af.mil */ -# define ACS_ULCORNER (chtype)0xda /* SysV */ -# define ACS_LLCORNER (chtype)0xc0 /* SysV */ -# define ACS_URCORNER (chtype)0xbf /* SysV */ -# define ACS_LRCORNER (chtype)0xd9 /* SysV */ -# define ACS_RTEE (chtype)0xb4 /* SysV */ -# define ACS_LTEE (chtype)0xc3 /* SysV */ -# define ACS_BTEE (chtype)0xc1 /* SysV */ -# define ACS_TTEE (chtype)0xc2 /* SysV */ -# define ACS_HLINE (chtype)0xc4 /* SysV */ -# define ACS_VLINE (chtype)0xb3 /* SysV */ -# define ACS_PLUS (chtype)0xc5 /* SysV */ -# define ACS_S1 (chtype)0x2d /* SysV */ -# define ACS_S9 (chtype)0x5f /* SysV */ -# define ACS_DIAMOND (chtype)0xc5 /* SysV */ -# define ACS_CKBOARD (chtype)0xb2 /* SysV */ -# define ACS_DEGREE (chtype)0xf8 /* SysV */ -# define ACS_PLMINUS (chtype)0xf1 /* SysV */ -# define ACS_BULLET (chtype)0xf9 /* SysV */ -# define ACS_LARROW (chtype)0x3c /* SysV */ -# define ACS_RARROW (chtype)0x3e /* SysV */ -# define ACS_DARROW (chtype)0x76 /* SysV */ -# define ACS_UARROW (chtype)0x5e /* SysV */ -# define ACS_BOARD (chtype)0x23 /* SysV */ -# define ACS_LANTERN (chtype)0x23 /* SysV */ -# define ACS_BLOCK (chtype)0x23 /* SysV */ - -/* the following definitions can be used if you have set raw_output() - or are using the PDCurses *raw*() functions */ -# if 0 -# define ACS_DIAMOND (chtype)0x04 /* SysV */ -# define ACS_LARROW (chtype)0x1b /* SysV */ -# define ACS_RARROW (chtype)0x1a /* SysV */ -# define ACS_DARROW (chtype)0x19 /* SysV */ -# define ACS_UARROW (chtype)0x18 /* SysV */ -# define ACS_BOARD (chtype)0xb0 /* SysV */ -# define ACS_LANTERN (chtype)0x0f /* SysV */ -# define ACS_BLOCK (chtype)0xdb /* SysV */ -# endif -#endif - -/* colour attributes */ -#if defined (XCURSES) -# define COLOR_BLACK 0 -# define COLOR_RED 1 -# define COLOR_GREEN 2 -# define COLOR_YELLOW 3 -# define COLOR_BLUE 4 -# define COLOR_MAGENTA 5 -# define COLOR_CYAN 6 -# define COLOR_WHITE 7 -#endif - -#if defined(DOS) || defined(OS2) -# define COLOR_BLACK 0 -# define COLOR_BLUE 1 -# define COLOR_GREEN 2 -# define COLOR_CYAN 3 -# define COLOR_RED 4 -# define COLOR_MAGENTA 5 -# define COLOR_YELLOW 6 -# define COLOR_WHITE 7 -#endif - -#if defined(WIN32) -# define MS_MOUSE_MOVED 0x0001 -/* - * These defines taken directly from windows.h to reduce - * compilation time by only #include'ing - * when absolutely necesssary. Cygnus-W32 #defines all of these - * so we need to check for that. - */ -# ifndef FOREGROUND_BLUE -# define FOREGROUND_BLUE 0x0001 -# endif -# ifndef FOREGROUND_GREEN -# define FOREGROUND_GREEN 0x0002 -# endif -# ifndef FOREGROUND_RED -# define FOREGROUND_RED 0x0004 -# endif -# ifndef FOREGROUND_INTENSITY -# define FOREGROUND_INTENSITY 0x0008 /* BOLD */ -# endif -# ifndef BACKGROUND_BLUE -# define BACKGROUND_BLUE 0x0010 -# endif -# ifndef BACKGROUND_GREEN -# define BACKGROUND_GREEN 0x0020 -# endif -# ifndef BACKGROUND_RED -# define BACKGROUND_RED 0x0040 -# endif -# ifndef BACKGROUND_INTENSITY -# define BACKGROUND_INTENSITY 0x0080 /* BLINK */ -# endif - -# define COLOR_BLACK 0 -# define COLOR_BLUE FOREGROUND_BLUE -# define COLOR_RED FOREGROUND_RED -# define COLOR_GREEN FOREGROUND_GREEN -# define COLOR_CYAN FOREGROUND_BLUE | FOREGROUND_GREEN -# define COLOR_MAGENTA FOREGROUND_RED | FOREGROUND_BLUE -# define COLOR_YELLOW FOREGROUND_RED | FOREGROUND_GREEN -# define COLOR_WHITE FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE -#endif - -#ifdef CHTYPE_LONG -#define COLOR_PAIR(n) ((chtype)(n) << 24) -#define PAIR_NUMBER(n) (((n) & A_COLOR) >> 24) -#else -#define COLOR_PAIR(n) (((n) << 11) & A_ATTRIBUTES) -#define PAIR_NUMBER(n) (((n) & A_COLOR) >> 11) -#endif - -/*---------------------------------------------------------------------- - * - * Function and Keypad Key Definitions. - * Many are just for compatibility. - * - */ -#define KEY_MIN 0x101 /* Minimum curses key value */ -#define KEY_BREAK 0x101 /* Not on PC KBD */ -#define KEY_DOWN 0x102 /* Down arrow key */ -#define KEY_UP 0x103 /* Up arrow key */ -#define KEY_LEFT 0x104 /* Left arrow key */ -#define KEY_RIGHT 0x105 /* Right arrow key */ -#define KEY_HOME 0x106 /* home key */ -#define KEY_BACKSPACE 0x107 /* not on pc */ -#define KEY_F0 0x108 /* function keys. space for */ -#define KEY_F(n) (KEY_F0+(n))/* 64 keys are reserved. */ -#define KEY_DL 0x148 /* delete line */ -#define KEY_IL 0x149 /* insert line */ -#define KEY_DC 0x14a /* delete character */ -#define KEY_IC 0x14b /* insert char or enter ins mode */ -#define KEY_EIC 0x14c /* exit insert char mode */ -#define KEY_CLEAR 0x14d /* clear screen */ -#define KEY_EOS 0x14e /* clear to end of screen */ -#define KEY_EOL 0x14f /* clear to end of line */ -#define KEY_SF 0x150 /* scroll 1 line forward */ -#define KEY_SR 0x151 /* scroll 1 line back (reverse) */ -#define KEY_NPAGE 0x152 /* next page */ -#define KEY_PPAGE 0x153 /* previous page */ -#define KEY_STAB 0x154 /* set tab */ -#define KEY_CTAB 0x155 /* clear tab */ -#define KEY_CATAB 0x156 /* clear all tabs */ -#define KEY_ENTER 0x157 /* enter or send (unreliable) */ -#define KEY_SRESET 0x158 /* soft/reset (partial/unreliable)*/ -#define KEY_RESET 0x159 /* reset/hard reset (unreliable) */ -#define KEY_PRINT 0x15a /* print/copy */ -#define KEY_LL 0x15b /* home down/bottom (lower left) */ -#define KEY_ABORT 0x15c /* abort/terminate key (any) */ -#define KEY_SHELP 0x15d /* short help */ -#define KEY_LHELP 0x15e /* long help */ -#define KEY_BTAB 0x15f /* Back tab key */ -#define KEY_BEG 0x160 /* beg(inning) key */ -#define KEY_CANCEL 0x161 /* cancel key */ -#define KEY_CLOSE 0x162 /* close key */ -#define KEY_COMMAND 0x163 /* cmd (command) key */ -#define KEY_COPY 0x164 /* copy key */ -#define KEY_CREATE 0x165 /* create key */ -#define KEY_END 0x166 /* end key */ -#define KEY_EXIT 0x167 /* exit key */ -#define KEY_FIND 0x168 /* find key */ -#define KEY_HELP 0x169 /* help key */ -#define KEY_MARK 0x16a /* mark key */ -#define KEY_MESSAGE 0x16b /* message key */ -#define KEY_MOVE 0x16c /* move key */ -#define KEY_NEXT 0x16d /* next object key */ -#define KEY_OPEN 0x16e /* open key */ -#define KEY_OPTIONS 0x16f /* options key */ -#define KEY_PREVIOUS 0x170 /* previous object key */ -#define KEY_REDO 0x171 /* redo key */ -#define KEY_REFERENCE 0x172 /* ref(erence) key */ -#define KEY_REFRESH 0x173 /* refresh key */ -#define KEY_REPLACE 0x174 /* replace key */ -#define KEY_RESTART 0x175 /* restart key */ -#define KEY_RESUME 0x176 /* resume key */ -#define KEY_SAVE 0x177 /* save key */ -#define KEY_SBEG 0x178 /* shifted beginning key */ -#define KEY_SCANCEL 0x179 /* shifted cancel key */ -#define KEY_SCOMMAND 0x17a /* shifted command key */ -#define KEY_SCOPY 0x17b /* shifted copy key */ -#define KEY_SCREATE 0x17c /* shifted create key */ -#define KEY_SDC 0x17d /* shifted delete char key */ -#define KEY_SDL 0x17e /* shifted delete line key */ -#define KEY_SELECT 0x17f /* select key */ -#define KEY_SEND 0x180 /* shifted end key */ -#define KEY_SEOL 0x181 /* shifted clear line key */ -#define KEY_SEXIT 0x182 /* shifted exit key */ -#define KEY_SFIND 0x183 /* shifted find key */ -#define KEY_SHOME 0x184 /* shifted home key */ -#define KEY_SIC 0x185 /* shifted input key */ -#define KEY_SLEFT 0x187 /* shifted left arrow key */ -#define KEY_SMESSAGE 0x188 /* shifted message key */ -#define KEY_SMOVE 0x189 /* shifted move key */ -#define KEY_SNEXT 0x18a /* shifted next key */ -#define KEY_SOPTIONS 0x18b /* shifted options key */ -#define KEY_SPREVIOUS 0x18c /* shifted prev key */ -#define KEY_SPRINT 0x18d /* shifted print key */ -#define KEY_SREDO 0x18e /* shifted redo key */ -#define KEY_SREPLACE 0x18f /* shifted replace key */ -#define KEY_SRIGHT 0x190 /* shifted right arrow */ -#define KEY_SRSUME 0x191 /* shifted resume key */ -#define KEY_SSAVE 0x192 /* shifted save key */ -#define KEY_SSUSPEND 0x193 /* shifted suspend key */ -#define KEY_SUNDO 0x194 /* shifted undo key */ -#define KEY_SUSPEND 0x195 /* suspend key */ -#define KEY_UNDO 0x196 /* undo key */ - -/* PDCurses specific key definitions */ - -#define ALT_0 0x197 /* Alt-0 PC only */ -#define ALT_1 0x198 /* Alt-1 PC only */ -#define ALT_2 0x199 /* Alt-2 PC only */ -#define ALT_3 0x19a /* Alt-3 PC only */ -#define ALT_4 0x19b /* Alt-4 PC only */ -#define ALT_5 0x19c /* Alt-5 PC only */ -#define ALT_6 0x19d /* Alt-6 PC only */ -#define ALT_7 0x19e /* Alt-7 PC only */ -#define ALT_8 0x19f /* Alt-8 PC only */ -#define ALT_9 0x1a0 /* Alt-9 PC only */ -#define ALT_A 0x1a1 /* Alt-A PC only */ -#define ALT_B 0x1a2 /* Alt-B PC only */ -#define ALT_C 0x1a3 /* Alt-C PC only */ -#define ALT_D 0x1a4 /* Alt-D PC only */ -#define ALT_E 0x1a5 /* Alt-E PC only */ -#define ALT_F 0x1a6 /* Alt-F PC only */ -#define ALT_G 0x1a7 /* Alt-G PC only */ -#define ALT_H 0x1a8 /* Alt-H PC only */ -#define ALT_I 0x1a9 /* Alt-I PC only */ -#define ALT_J 0x1aa /* Alt-J PC only */ -#define ALT_K 0x1ab /* Alt-K PC only */ -#define ALT_L 0x1ac /* Alt-L PC only */ -#define ALT_M 0x1ad /* Alt-M PC only */ -#define ALT_N 0x1ae /* Alt-N PC only */ -#define ALT_O 0x1af /* Alt-O PC only */ -#define ALT_P 0x1b0 /* Alt-P PC only */ -#define ALT_Q 0x1b1 /* Alt-Q PC only */ -#define ALT_R 0x1b2 /* Alt-R PC only */ -#define ALT_S 0x1b3 /* Alt-S PC only */ -#define ALT_T 0x1b4 /* Alt-T PC only */ -#define ALT_U 0x1b5 /* Alt-U PC only */ -#define ALT_V 0x1b6 /* Alt-V PC only */ -#define ALT_W 0x1b7 /* Alt-W PC only */ -#define ALT_X 0x1b8 /* Alt-X PC only */ -#define ALT_Y 0x1b9 /* Alt-Y PC only */ -#define ALT_Z 0x1ba /* Alt-Z PC only */ -#define CTL_LEFT 0x1bb /* Control-Left-Arrow PC only */ -#define CTL_RIGHT 0x1bc /* Control-Right-Arrow PC only */ -#define CTL_PGUP 0x1bd /* Control-PgUp PC only */ -#define CTL_PGDN 0x1be /* Control-PgDn PC only */ -#define CTL_HOME 0x1bf /* Control-Home PC only */ -#define CTL_END 0x1c0 /* Control-End PC only */ - -#if defined(FLEXOS) -# define KEY_MOUSE 0x1c1 /* "mouse" key */ -# define KEY_A1 KEY_HOME/* upper left on Virtual keypad */ -# define KEY_A2 KEY_UP /* upper middle on Virt. keypad */ -# define KEY_A3 KEY_PPAGE/* upper right on Vir. keypad */ -# define KEY_B1 KEY_LEFT/* middle left on Virt. keypad */ -# define KEY_B2 0x00 /* center on Virt. keypad */ -# define KEY_B3 KEY_RIGHT/* middle right on Vir. keypad */ -# define KEY_C1 KEY_LL /* lower left on Virt. keypad */ -# define KEY_C2 KEY_DOWN /* lower middle on Virt. keypad */ -# define KEY_C3 KEY_NPAGE /* lower right on Vir. keypad */ -# define KEY_MAX KEY_MOUSE /* Maximum curses key */ -#endif - - -#if defined(DOS) || defined (OS2) || defined(XCURSES) || defined(WIN32) -# define KEY_A1 0x1c1 /* upper left on Virtual keypad */ -# define KEY_A2 0x1c2 /* upper middle on Virt. keypad */ -# define KEY_A3 0x1c3 /* upper right on Vir. keypad */ -# define KEY_B1 0x1c4 /* middle left on Virt. keypad */ -# define KEY_B2 0x1c5 /* center on Virt. keypad */ -# define KEY_B3 0x1c6 /* middle right on Vir. keypad */ -# define KEY_C1 0x1c7 /* lower left on Virt. keypad */ -# define KEY_C2 0x1c8 /* lower middle on Virt. keypad */ -# define KEY_C3 0x1c9 /* lower right on Vir. keypad */ -# define PADSLASH 0x1ca /* slash on keypad */ -# define PADENTER 0x1cb /* enter on keypad */ -# define CTL_PADENTER 0x1cc /* ctl-enter on keypad */ -# define ALT_PADENTER 0x1cd /* alt-enter on keypad */ -# define PADSTOP 0x1ce /* stop on keypad */ -# define PADSTAR 0x1cf /* star on keypad */ -# define PADMINUS 0x1d0 /* minus on keypad */ -# define PADPLUS 0x1d1 /* plus on keypad */ -# define CTL_PADSTOP 0x1d2 /* ctl-stop on keypad */ -# define CTL_PADCENTER 0x1d3 /* ctl-enter on keypad */ -# define CTL_PADPLUS 0x1d4 /* ctl-plus on keypad */ -# define CTL_PADMINUS 0x1d5 /* ctl-minus on keypad */ -# define CTL_PADSLASH 0x1d6 /* ctl-slash on keypad */ -# define CTL_PADSTAR 0x1d7 /* ctl-star on keypad */ -# define ALT_PADPLUS 0x1d8 /* alt-plus on keypad */ -# define ALT_PADMINUS 0x1d9 /* alt-minus on keypad */ -# define ALT_PADSLASH 0x1da /* alt-slash on keypad */ -# define ALT_PADSTAR 0x1db /* alt-star on keypad */ -# define ALT_PADSTOP 0x1dc /* alt-star on keypad */ -# define CTL_INS 0x1dd /* ctl-insert */ -# define ALT_DEL 0x1de /* alt-delete */ -# define ALT_INS 0x1df /* alt-insert */ -# define CTL_UP 0x1e0 /* ctl-up arrow */ -# define CTL_DOWN 0x1e1 /* ctl-down arrow */ -# define CTL_TAB 0x1e2 /* ctl-tab */ -# define ALT_TAB 0x1e3 /* alt-tab */ -# define ALT_MINUS 0x1e4 /* alt-minus */ -# define ALT_EQUAL 0x1e5 /* alt-equal */ -# define ALT_HOME 0x1e6 /* alt-home */ -# define ALT_PGUP 0x1e7 /* alt-pgup */ -# define ALT_PGDN 0x1e8 /* alt-pgdn */ -# define ALT_END 0x1e9 /* alt-end */ -# define ALT_UP 0x1ea /* alt-up arrow */ -# define ALT_DOWN 0x1eb /* alt-down arrow */ -# define ALT_RIGHT 0x1ec /* alt-right arrow */ -# define ALT_LEFT 0x1ed /* alt-left arrow */ -# define ALT_ENTER 0x1ee /* alt-enter */ -# define ALT_ESC 0x1ef /* alt-escape */ -# define ALT_BQUOTE 0x1f0 /* alt-back quote */ -# define ALT_LBRACKET 0x1f1 /* alt-left bracket */ -# define ALT_RBRACKET 0x1f2 /* alt-right bracket */ -# define ALT_SEMICOLON 0x1f3 /* alt-semi-colon */ -# define ALT_FQUOTE 0x1f4 /* alt-forward quote */ -# define ALT_COMMA 0x1f5 /* alt-comma */ -# define ALT_STOP 0x1f6 /* alt-stop */ -# define ALT_FSLASH 0x1f7 /* alt-forward slash */ -# define ALT_BKSP 0x1f8 /* alt-backspace */ -# define CTL_BKSP 0x1f9 /* ctl-backspace */ -# define PAD0 0x1fa /* ctl-keypad 0 */ -# define CTL_PAD0 0x1fb /* ctl-keypad 0 */ -# define CTL_PAD1 0x1fc /* ctl-keypad 1 */ -# define CTL_PAD2 0x1fd /* ctl-keypad 2 */ -# define CTL_PAD3 0x1fe /* ctl-keypad 3 */ -# define CTL_PAD4 0x1ff /* ctl-keypad 4 */ -# define CTL_PAD5 0x200 /* ctl-keypad 5 */ -# define CTL_PAD6 0x201 /* ctl-keypad 6 */ -# define CTL_PAD7 0x202 /* ctl-keypad 7 */ -# define CTL_PAD8 0x203 /* ctl-keypad 8 */ -# define CTL_PAD9 0x204 /* ctl-keypad 9 */ -# define ALT_PAD0 0x205 /* ctl-keypad 0 */ -# define ALT_PAD1 0x206 /* ctl-keypad 1 */ -# define ALT_PAD2 0x207 /* ctl-keypad 2 */ -# define ALT_PAD3 0x208 /* ctl-keypad 3 */ -# define ALT_PAD4 0x209 /* ctl-keypad 4 */ -# define ALT_PAD5 0x20a /* ctl-keypad 5 */ -# define ALT_PAD6 0x20b /* ctl-keypad 6 */ -# define ALT_PAD7 0x20c /* ctl-keypad 7 */ -# define ALT_PAD8 0x20d /* ctl-keypad 8 */ -# define ALT_PAD9 0x20e /* ctl-keypad 9 */ -# define CTL_DEL 0x20f /* clt-delete */ -# define ALT_BSLASH 0x210 /* alt-back slash */ -# define CTL_ENTER 0x211 /* ctl-enter */ -# define SHF_PADENTER 0x212 /* shift-enter on keypad */ -# define SHF_PADSLASH 0x213 /* shift-slash on keypad */ -# define SHF_PADSTAR 0x214 /* shift-star on keypad */ -# define SHF_PADPLUS 0x215 /* shift-plus on keypad */ -# define SHF_PADMINUS 0x216 /* shift-minus on keypad */ -# define SHF_UP 0x217 /* shift-up on keypad */ -# define SHF_DOWN 0x218 /* shift-down on keypad */ -# define SHF_IC 0x219 /* shift-insert on keypad */ -# define SHF_DC 0x21a /* shift-delete on keypad */ -# define KEY_MOUSE 0x21b /* "mouse" key */ -# define KEY_SHIFT_L 0x21c /* Left-shift */ -# define KEY_SHIFT_R 0x21d /* Right-shift */ -# define KEY_CONTROL_L 0x21e /* Left-control */ -# define KEY_CONTROL_R 0x21f /* Right-control */ -# define KEY_ALT_L 0x220 /* Left-alt */ -# define KEY_ALT_R 0x221 /* Right-alt */ -# define KEY_RESIZE 0x222 /* Window resize */ -# define KEY_MAX 0x222 /* Maximum curses key */ -#endif - -/*---------------------------------------------------------------------- -* PDCurses function declarations -*/ -#ifdef HAVE_PROTO -int PDC_CDECL addchnstr( chtype *, int ); -int PDC_CDECL baudrate( void ); -int PDC_CDECL beep( void ); -int PDC_CDECL border( chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype ); -int PDC_CDECL can_change_color ( void ); -int PDC_CDECL clearok( WINDOW*, bool ); -int PDC_CDECL color_content( short, short*, short*, short* ); -int PDC_CDECL copywin( WINDOW*, WINDOW*, int, int, int, int, int, int, int ); -int PDC_CDECL curs_set( int ); -int PDC_CDECL def_prog_mode( void ); -int PDC_CDECL def_shell_mode( void ); -int PDC_CDECL delay_output( int ); -int PDC_CDECL delwin( WINDOW* ); -WINDOW* PDC_CDECL derwin( WINDOW*, int, int, int, int ); -int PDC_CDECL doupdate( void ); -WINDOW* PDC_CDECL dupwin( WINDOW* ); -int PDC_CDECL endwin( void ); -int PDC_CDECL erase( void ); -char PDC_CDECL erasechar( void ); -int PDC_CDECL flash( void ); -int PDC_CDECL flushinp( void ); -int PDC_CDECL getsyx( int*, int* ); -int PDC_CDECL halfdelay( int ); -bool PDC_CDECL has_colors( void ); -int PDC_CDECL hline( chtype, int ); -int PDC_CDECL immedok( WINDOW*, bool ); -int PDC_CDECL inchnstr( chtype *, int ); -int PDC_CDECL init_color( short, short, short, short ); -int PDC_CDECL init_pair( short, short, short ); -WINDOW* PDC_CDECL initscr( void ); -#ifdef XCURSES -WINDOW* PDC_CDECL Xinitscr( int, char ** ); -#endif -int PDC_CDECL intrflush( WINDOW*, bool ); -int PDC_CDECL is_linetouched(WINDOW *,int); -int PDC_CDECL is_wintouched(WINDOW *); -char* PDC_CDECL keyname( int ); -char PDC_CDECL killchar( void ); -char* PDC_CDECL longname( void ); -int PDC_CDECL meta( WINDOW*, bool ); -int PDC_CDECL mvcur( int, int, int, int ); -int PDC_CDECL mvderwin( WINDOW*, int, int ); -#ifdef HAVE_STDARG_H -int PDC_CDECL mvprintw( int, int, char*,... ); -int PDC_CDECL mvscanw( int, int, char*,... ); -#endif -int PDC_CDECL mvwaddnstr( WINDOW*,int,int,char*,int ); -int PDC_CDECL mvwin( WINDOW*, int, int ); -int PDC_CDECL mvwinsertln( WINDOW*, int, int ); -#ifdef HAVE_STDARG_H -int PDC_CDECL mvwprintw( WINDOW*, int, int, char*,... ); -int PDC_CDECL mvwscanw( WINDOW*, int, int, char*,... ); -#endif -WINDOW* PDC_CDECL newpad( int, int ); -SCREEN* PDC_CDECL newterm( char*, FILE*, FILE* ); -WINDOW* PDC_CDECL newwin( int, int, int, int ); -int PDC_CDECL noraw( void ); -int PDC_CDECL notimeout( WINDOW *, bool ); -int PDC_CDECL overlay( WINDOW*, WINDOW* ); -int PDC_CDECL overwrite( WINDOW*, WINDOW* ); -int PDC_CDECL pair_content( int, short*, short* ); -int PDC_CDECL pnoutrefresh( WINDOW*, int, int, int, int, int, int ); -int PDC_CDECL prefresh( WINDOW*, int, int, int, int, int, int ); -#ifdef HAVE_STDARG_H -int PDC_CDECL printw( char*,... ); -int PDC_CDECL scanw( char*,... ); -#endif -int PDC_CDECL raw( void ); -int PDC_CDECL refresh( void ); -int PDC_CDECL reset_prog_mode( void ); -int PDC_CDECL reset_shell_mode( void ); -int PDC_CDECL resetty( void ); -int PDC_CDECL ripoffline(int, int (*)(WINDOW *, int)); -int PDC_CDECL savetty( void ); -int PDC_CDECL sb_init(void); -int PDC_CDECL sb_set_horz(int, int, int); -int PDC_CDECL sb_set_vert(int, int, int); -int PDC_CDECL sb_get_horz(int *, int *, int *); -int PDC_CDECL sb_get_vert(int *, int *, int *); -int PDC_CDECL sb_refresh(void); -int PDC_CDECL scroll( WINDOW* ); -SCREEN* PDC_CDECL set_term( SCREEN* ); -int PDC_CDECL setsyx( int, int ); -int PDC_CDECL start_color( void ); -int PDC_CDECL slk_init(int); -int PDC_CDECL slk_set(int, char *, int); -int PDC_CDECL slk_refresh(void); -int PDC_CDECL slk_noutrefresh(void); -char* PDC_CDECL slk_label(int); -int PDC_CDECL slk_clear(void); -int PDC_CDECL slk_restore(void); -int PDC_CDECL slk_touch(void); -int PDC_CDECL slk_attron(attr_t); -int PDC_CDECL slk_attrset(attr_t); -int PDC_CDECL slk_attroff(attr_t); -WINDOW* PDC_CDECL subpad( WINDOW*, int, int, int, int ); -WINDOW* PDC_CDECL subwin( WINDOW*, int, int, int, int ); -int PDC_CDECL syncok(WINDOW*, bool); -attr_t PDC_CDECL termattrs( void ); -char* PDC_CDECL termname( void ); -int PDC_CDECL touchline( WINDOW*, int ,int ); -int PDC_CDECL touchwin( WINDOW* ); -#if !defined (CURSES_LIBRARY) -void PDC_CDECL traceoff( void ); -void PDC_CDECL traceon( void ); -#endif -int PDC_CDECL typeahead( int ); -char* PDC_CDECL unctrl( chtype ); -int PDC_CDECL vline( chtype, int ); -int PDC_CDECL waddchnstr( WINDOW*, chtype*, int ); -int PDC_CDECL waddnstr( WINDOW*, char*, int ); -int PDC_CDECL waddstr( WINDOW*, char* ); -int PDC_CDECL wattroff( WINDOW*, attr_t ); -int PDC_CDECL wattron( WINDOW*, attr_t ); -int PDC_CDECL wattrset( WINDOW*, attr_t ); -int PDC_CDECL wbkgd(WINDOW*, chtype); -void PDC_CDECL wbkgdset(WINDOW*, chtype); -int PDC_CDECL wborder( WINDOW*, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype ); -int PDC_CDECL wclear( WINDOW* ); -int PDC_CDECL wclrtobot( WINDOW* ); -int PDC_CDECL wclrtoeol( WINDOW* ); -void PDC_CDECL wcursyncup(WINDOW*); -int PDC_CDECL wdelch( WINDOW* ); -int PDC_CDECL wdeleteln( WINDOW* ); -int PDC_CDECL werase( WINDOW* ); -int PDC_CDECL wgetch( WINDOW* ); -int PDC_CDECL wgetnstr( WINDOW*, char*, int ); -int PDC_CDECL wgetstr( WINDOW*, char* ); -int PDC_CDECL whline( WINDOW*, chtype, int ); -int PDC_CDECL winchnstr( WINDOW*, chtype*, int ); -int PDC_CDECL winnstr( WINDOW*, char*, int ); -int PDC_CDECL winsch( WINDOW*, chtype ); -int PDC_CDECL winsdelln( WINDOW*, int ); -int PDC_CDECL winsertln( WINDOW* ); -int PDC_CDECL winsnstr( WINDOW*, char*, int ); -int PDC_CDECL wmove( WINDOW*, int, int ); -int PDC_CDECL wnoutrefresh( WINDOW* ); -char PDC_CDECL wordchar( void ); -#ifdef HAVE_STDARG_H -int PDC_CDECL wprintw( WINDOW*, char*,... ); -int PDC_CDECL wscanw( WINDOW*, char*,... ); -#endif -int PDC_CDECL wredrawln( WINDOW*, int ,int ); -int PDC_CDECL wrefresh( WINDOW* ); -int PDC_CDECL wscrl( WINDOW*, int ); -int PDC_CDECL wsetscrreg( WINDOW*, int, int ); -int PDC_CDECL wtimeout( WINDOW *, int ); -int PDC_CDECL wtouchln(WINDOW *, int, int, int); -void PDC_CDECL wsyncdown(WINDOW*); -void PDC_CDECL wsyncup(WINDOW*); -int PDC_CDECL wvline( WINDOW*, chtype, int ); - -#ifdef PDCURSES -int PDC_CDECL raw_output( bool ); -int PDC_CDECL resize_term( int, int ); -WINDOW* PDC_CDECL resize_window( WINDOW*, int, int ); -#endif - -#ifdef OBSOLETE_OR_TBD -char PDC_CDECL breakchar( /* void */ ); -int PDC_CDECL cursoff( /* void */ ); -int PDC_CDECL curson( /* void */ ); -int PDC_CDECL gettmode( /* void */ ); -int PDC_CDECL mvaddrawch( /* int, int, chtype */ ); -int PDC_CDECL mvaddrawstr( /* int, int, char* */ ); -int PDC_CDECL mvwinsrawch( /* WINDOW*, int, int, chtype */ ); -int PDC_CDECL mvinsrawch( /* int, int, chtype */ ); -int PDC_CDECL saveoldterm( /* void */ ); -int PDC_CDECL tabsize( /* int */ ); -int PDC_CDECL waddrawstr( /* WINDOW*, char* */ ); -int PDC_CDECL wtabsize( /* WINDOW*, int */ ); -int PDC_CDECL win_print( /* WINDOW*, int */ ); -#endif - -#ifdef XCURSES -void XCursesExit( void ); -int nocbreak( void ); -int cbreak( void ); -int nocrmode( void ); -int crmode( void ); -int noecho( void ); -int echo( void ); -int nodelay( WINDOW *,bool ); -#endif - -int PDC_CDECL mouse_set( unsigned long ); -int PDC_CDECL mouse_on( unsigned long ); -int PDC_CDECL mouse_off( unsigned long ); -int PDC_CDECL request_mouse_pos( void ); -int PDC_CDECL map_button( unsigned long ); -void PDC_CDECL wmouse_position( WINDOW *, int *, int * ); -unsigned long PDC_CDECL getmouse( void ); -unsigned long PDC_CDECL getbmap( void ); - -/* -* Keep the compiler happy with our macros below... -*/ -int PDC_CDECL PDC_chadd( WINDOW*, chtype, bool, bool ); -int PDC_CDECL PDC_chins( WINDOW*, chtype, bool ); -int PDC_CDECL PDC_ungetch( int ); - -void PDC_CDECL PDC_set_title( char * ); - -int PDC_CDECL PDC_getclipboard( char **, long * ); -int PDC_CDECL PDC_setclipboard( char *, long ); - -int PDC_CDECL PDC_get_input_fd( void ); -unsigned long PDC_CDECL PDC_get_key_modifiers( void ); - -#else - -int PDC_CDECL addchnstr( /* chtype *, int */ ); -int PDC_CDECL baudrate( /* void */ ); -int PDC_CDECL beep( /* void */ ); -int PDC_CDECL border( /* chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype */ ); -int PDC_CDECL can_change_color ( /* void */ ); -int PDC_CDECL clearok( /* WINDOW*, bool */ ); -int PDC_CDECL color_content( /* int, short*, short*, short* */ ); -int PDC_CDECL copywin( /* WINDOW*, WINDOW*, int, int, int, int, int, int, int */ ); -int PDC_CDECL curs_set( /* int */ ); -int PDC_CDECL def_prog_mode( /* void */ ); -int PDC_CDECL def_shell_mode( /* void */ ); -int PDC_CDECL delay_output( /* int */ ); -int PDC_CDECL delwin( /* WINDOW* */ ); -WINDOW* PDC_CDECL derwin( /* WINDOW*, int, int, int, int */ ); -int PDC_CDECL doupdate( /* void */ ); -WINDOW* PDC_CDECL dupwin( /* WINDOW* */ ); -int PDC_CDECL endwin( /* void */ ); -int PDC_CDECL erase( /* void */ ); -char PDC_CDECL erasechar( /* void */ ); -int PDC_CDECL flash( /* void */ ); -int PDC_CDECL flushinp( /* void */ ); -int PDC_CDECL getsyx( /* int*, int* */ ); -int PDC_CDECL halfdelay( /* int */ ); -bool PDC_CDECL has_colors( /* void */ ); -int PDC_CDECL hline( /* chtype, int */ ); -int PDC_CDECL immedok( /* WINDOW*, bool */ ); -int PDC_CDECL inchnstr( /* chtype *, int */ ); -int PDC_CDECL init_color( /* short, short, short, short */ ); -int PDC_CDECL init_pair( /* short, short, short */ ); -WINDOW* PDC_CDECL initscr( /* void */ ); -#ifdef XCURSES -WINDOW* PDC_CDECL Xinitscr( /* int, char ** */ ); -#endif -int PDC_CDECL intrflush( /* WINDOW*, bool */ ); -int PDC_CDECL is_linetouched( /*WINDOW *,int*/ ); -int PDC_CDECL is_wintouched( /*WINDOW **/ ); -char* PDC_CDECL keyname( /* int */ ); -char PDC_CDECL killchar( /* void */ ); -char* PDC_CDECL longname( /* void */ ); -int PDC_CDECL meta( /* WINDOW*, bool */ ); -int PDC_CDECL mvcur( /* int, int, int, int */ ); -int PDC_CDECL mvderwin( /* WINDOW*, int, int */ ); -int PDC_CDECL mvprintw( /* int, int, char*,... */ ); -int PDC_CDECL mvscanw( /* int, int, char*,... */ ); -int PDC_CDECL mvwaddnstr(/* WINDOW*,int,int,char*,int */ ); -int PDC_CDECL mvwin( /* WINDOW*, int, int */ ); -int PDC_CDECL mvwinsertln( /* WINDOW*, int, int */ ); -int PDC_CDECL mvwprintw( /* WINDOW*, int, int, char*,... */ ); -int PDC_CDECL mvwscanw( /* WINDOW*, int, int, char*,... */ ); -WINDOW* PDC_CDECL newpad( /* int, int */ ); -SCREEN* PDC_CDECL newterm( /* char*, FILE*, FILE* */ ); -WINDOW* PDC_CDECL newwin( /* int, int, int, int */ ); -int PDC_CDECL noraw( /* void */ ); -int PDC_CDECL notimeout( /* WINDOW *, bool */ ); -int PDC_CDECL overlay( /* WINDOW*, WINDOW* */ ); -int PDC_CDECL overwrite( /* WINDOW*, WINDOW* */ ); -int PDC_CDECL pair_content( /* int, short*, short* */ ); -int PDC_CDECL pnoutrefresh( /* WINDOW*, int, int, int, int, int, int */ ); -int PDC_CDECL prefresh( /* WINDOW*, int, int, int, int, int, int */ ); -int PDC_CDECL printw( /* char*,... */ ); -int PDC_CDECL raw( /* void */ ); -int PDC_CDECL refresh( /* void */ ); -int PDC_CDECL reset_prog_mode( /* void */ ); -int PDC_CDECL reset_shell_mode( /* void */ ); -int PDC_CDECL resetty( /* void */ ); -int PDC_CDECL ripoffline( /* int, int (*)(WINDOW *, int) */); -int PDC_CDECL savetty( /* void */ ); -int PDC_CDECL sb_init( /* void */ ); -int PDC_CDECL sb_set_horz( /* int, int, int */ ); -int PDC_CDECL sb_set_vert( /* int, int, int */ ); -int PDC_CDECL sb_get_horz( /* int *, int *, int * */ ); -int PDC_CDECL sb_get_vert( /* int *, int *, int * */ ); -int PDC_CDECL sb_refresh( /* void */ ); -int PDC_CDECL scanw( /* char*,... */ ); -int PDC_CDECL scroll( /* WINDOW* */ ); -int PDC_CDECL setsyx( /* int, int */ ); -SCREEN* PDC_CDECL set_term( /* SCREEN* */ ); -int PDC_CDECL slk_init(/* int */); -int PDC_CDECL slk_set(/* int, char *, int */); -int PDC_CDECL slk_refresh(/* void */); -int PDC_CDECL slk_noutrefresh(/* void */); -char* PDC_CDECL slk_label(/* int */); -int PDC_CDECL slk_clear(/* void */); -int PDC_CDECL slk_restore(/* void */); -int PDC_CDECL slk_touch(/* void */); -int PDC_CDECL slk_attron(/* attr_t */); -int PDC_CDECL slk_attrset(/* attr_t */); -int PDC_CDECL slk_attroff(/* attr_t */); -int PDC_CDECL start_color( /* void */ ); -WINDOW* PDC_CDECL subpad( /* WINDOW*, int, int, int, int */ ); -WINDOW* PDC_CDECL subwin( /* WINDOW*, int, int, int, int */ ); -int PDC_CDECL syncok(/* WINDOW*, bool */); -attr_t PDC_CDECL termattrs( /* void */ ); -char* PDC_CDECL termname( /* void */ ); -int PDC_CDECL touchline( /* WINDOW*, int ,int */ ); -int PDC_CDECL touchwin( /* WINDOW* */ ); -#if !defined (CURSES_LIBRARY) -void PDC_CDECL traceoff(/* void */); -void PDC_CDECL traceon(/* void */); -#endif -int PDC_CDECL typeahead( /* int */ ); -char* PDC_CDECL unctrl( /* chtype */ ); -int PDC_CDECL vline( /* chtype, int */ ); -int PDC_CDECL waddchnstr( /* WINDOW*, chtype*, int */ ); -int PDC_CDECL waddnstr( /* WINDOW*, char*, int */ ); -int PDC_CDECL waddstr( /* WINDOW*, char* */ ); -int PDC_CDECL wattroff( /* WINDOW*, attr_t */ ); -int PDC_CDECL wattron( /* WINDOW*, attr_t */ ); -int PDC_CDECL wattrset( /* WINDOW*, attr_t */ ); -int PDC_CDECL wbkgd( /*WINDOW*, chtype*/ ); -void PDC_CDECL wbkgdset( /*WINDOW*, chtype*/ ); -int PDC_CDECL wborder( /* WINDOW*, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype */ ); -int PDC_CDECL wclear( /* WINDOW* */ ); -int PDC_CDECL wclrtobot( /* WINDOW* */ ); -int PDC_CDECL wclrtoeol( /* WINDOW* */ ); -void PDC_CDECL wcursyncup(/* WINDOW* */); -int PDC_CDECL wdelch( /* WINDOW* */ ); -int PDC_CDECL wdeleteln( /* WINDOW* */ ); -int PDC_CDECL werase( /* WINDOW* */ ); -int PDC_CDECL wgetch( /* WINDOW* */ ); -int PDC_CDECL wgetnstr( /* WINDOW*, char*, int */ ); -int PDC_CDECL wgetstr( /* WINDOW*, char* */ ); -int PDC_CDECL whline( /* WINDOW*, chtype, int */ ); -int PDC_CDECL winchnstr( /* WINDOW*, chtype*, int */ ); -int PDC_CDECL winnstr( /* WINDOW*, char*, int */ ); -int PDC_CDECL winsch( /* WINDOW*, chtype */ ); -int PDC_CDECL winsdelln( /* WINDOW*, int */ ); -int PDC_CDECL winsertln( /* WINDOW* */ ); -int PDC_CDECL winsnstr( /* WINDOW*, char*, int */ ); -int PDC_CDECL wmove( /* WINDOW*, int, int */ ); -int PDC_CDECL wnoutrefresh( /* WINDOW* */ ); -char PDC_CDECL wordchar( /* void */ ); -int PDC_CDECL wprintw( /* WINDOW*, char*,... */ ); -int PDC_CDECL wredrawln( /* WINDOW*, int ,int */ ); -int PDC_CDECL wrefresh( /* WINDOW* */ ); -int PDC_CDECL wscanw( /* WINDOW*, char*,... */ ); -int PDC_CDECL wscrl( /* WINDOW*, int */ ); -int PDC_CDECL wsetscrreg( /* WINDOW*, int, int */ ); -int PDC_CDECL wtimeout( /* WINDOW *, int */ ); -int PDC_CDECL wtouchln( /*WINDOW *, int, int, int*/ ); -void PDC_CDECL wsyncdown(/* WINDOW* */); -void PDC_CDECL wsyncup(/* WINDOW* */); -int PDC_CDECL wvline( /* WINDOW*, chtype, int */ ); - -#ifdef PDCURSES -int PDC_CDECL raw_output( /* bool */ ); -int PDC_CDECL resize_term( /* int, int */ ); -WINDOW* PDC_CDECL resize_window( /* WINDOW*, int, int */ ); -#endif - -#ifdef OBSOLETE_OR_TBD -char PDC_CDECL breakchar( /* void */ ); -int PDC_CDECL cursoff( /* void */ ); -int PDC_CDECL curson( /* void */ ); -int PDC_CDECL gettmode( /* void */ ); -int PDC_CDECL mvaddrawch( /* int, int, chtype */ ); -int PDC_CDECL mvaddrawstr( /* int, int, char* */ ); -int PDC_CDECL mvwinsrawch( /* WINDOW*, int, int, chtype */ ); -int PDC_CDECL mvinsrawch( /* int, int, chtype */ ); -int PDC_CDECL saveoldterm( /* void */ ); -int PDC_CDECL tabsize( /* int */ ); -int PDC_CDECL waddrawstr( /* WINDOW*, char* */ ); -int PDC_CDECL wtabsize( /* WINDOW*, int */ ); -int PDC_CDECL win_print( /* WINDOW*, int */ ); -#endif - -#ifdef XCURSES -void XCursesExit(/* void */); -int nocbreak( /* void */ ); -int cbreak( /* void */ ); -int nocrmode( /* void */ ); -int crmode( /* void */ ); -int noecho( /* void */ ); -int echo( /* void */ ); -int nodelay( /* WINDOW *,bool */ ); -#endif - -int PDC_CDECL mouse_set( /* long */ ); -int PDC_CDECL mouse_on( /* long */ ); -int PDC_CDECL mouse_off( /* long */ ); -int PDC_CDECL request_mouse_pos( /* void */ ); -int PDC_CDECL map_button( /* unsigned long */ ); -void PDC_CDECL wmouse_position( /* WINDOW *, int *, int * */ ); -unsigned long PDC_CDECL getmouse( /* void */ ); -unsigned long PDC_CDECL getbmap( /* void */ ); - -/* -* Keep the compiler happy with our macros below... -*/ -int PDC_CDECL PDC_chadd( /* WINDOW*, chtype, bool, bool */ ); -int PDC_CDECL PDC_chins( /* WINDOW*, chtype, bool */ ); -int PDC_CDECL PDC_ungetch( /* int */ ); - -void PDC_CDECL PDC_set_title( /* char * */ ); -int PDC_CDECL PDC_getclipboard( /* char **, long * */ ); -int PDC_CDECL PDC_setclipboard( /* char *, long */ ); - -int PDC_CDECL PDC_get_input_fd( /* void */ ); -unsigned long PDC_CDECL PDC_get_key_modifiers( /* void */ ); - -#endif - - -#ifndef max -# define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif -#ifndef min -# define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -/* -* Functions defined as macros -*/ - -#define addch( c ) waddch( stdscr, c ) -#define addchstr( c ) addchnstr( c, -1 ) -#define addstr(str) waddstr( stdscr, str ) -#define addnstr(str, n) waddnstr( stdscr, str, n ) -#define attroff(attr) wattroff( stdscr, attr ) -#define attron(attr) wattron( stdscr, attr ) -#define attrset(attr) wattrset( stdscr, attr ) -#define bkgd(c) wbkgd(stdscr,c) -#define bkgdset(c) wbkgdset(stdscr,c) -#define border(ls,rs,ts,bs,tl,tr,bl,br) wborder(stdscr,ls,rs,ts,bs,tl,tr,bl,br) -#define box( w, v, h ) wborder( w, v, v, h, h, 0, 0, 0, 0 ) -#define clear() wclear( stdscr ) -#define clrtobot() wclrtobot( stdscr ) -#define clrtoeol() wclrtoeol( stdscr ) -#define delch() wdelch( stdscr ) -#define deleteln() wdeleteln( stdscr ) -#define derwin(w,nl,nc,by,bx) subwin((w),(nl),(nc),(by+(w)->_begy),(bx+(w)->_begx)) -#define draino(ms) delay_output(ms) -#define echochar(c) (addch((chtype)c)==ERR?ERR:refresh()) -#define erase() werase( stdscr ) -#define fixterm() reset_prog_mode() -#define getbegx(w) (w)->_begx -#define getbegy(w) (w)->_begy -#define getbegyx(w,y,x) ( y = (w)->_begy, x = (w)->_begx ) -#define getch() wgetch(stdscr) -#define getmaxx(w) (w)->_maxx -#define getmaxy(w) (w)->_maxy -#define getmaxyx(w,y,x) ( y = (w)->_maxy, x = (w)->_maxx ) -#define getparx(w) (w)->_parx -#define getpary(w) (w)->_pary -#define getparyx(w,y,x) ( y = (w)->_pary, x = (w)->_parx ) -#define getstr(str) wgetstr( stdscr, str ) -#define getnstr(str) wgetnstr( stdscr, str, num ) -#define getyx(w,y,x) ( y = (w)->_cury, x = (w)->_curx ) -#define has_colors() ((SP->mono) ? FALSE : TRUE) -#define idcok(w,flag) OK -#define idlok(w,flag) OK -#define inch() (stdscr->_y[stdscr->_cury][stdscr->_curx]) -#define inchstr( c ) inchnstr( c, stdscr->_maxx-stdscr->_curx ) -#define innstr(str,n) winnstr(stdscr,(str),(n)) -#define insch( c ) winsch( stdscr, c ) -#define insdelln(n) winsdelln(stdscr,n) -#define insertln() winsertln( stdscr ) -#define insnstr(s,n) winsnstr(stdscr,s,n) -#define insstr(s) winsnstr(stdscr,s,(-1)) -#define instr(str) winnstr(stdscr,(str),stdscr->_maxx) -#define isendwin() ((SP->alive) ? FALSE : TRUE) -#define is_termresized() (SP->resized) -#define keypad(w,flag) (w->_use_keypad = flag) -#define leaveok(w,flag) (w->_leaveit = flag) -#define move(y,x) wmove( stdscr, y, x ) -#define mvaddch(y,x,c) (move( y, x )==ERR?ERR:addch( c )) -#define mvaddchstr(y,x,c) (move( y, x )==ERR?ERR:addchnstr( c, -1 )) -#define mvaddchnstr(y,x,c,n) (move( y, x )==ERR?ERR:addchnstr( c, n )) -#define mvaddstr(y,x,str) (move( y, x )==ERR?ERR:addstr( str )) -#define mvaddnstr(y,x,str,n) (move( y, x )==ERR?ERR:addnstr( str, n )) -#define mvdelch(y,x) (move( y, x )==ERR?ERR:wdelch( stdscr )) -#define mvgetch(y,x) (move( y, x )==ERR?ERR:wgetch(stdscr)) -#define mvgetstr(y,x,str) (move( y, x )==ERR?ERR:wgetstr( stdscr, str )) -#define mvinch(y,x) (move( y, x )==ERR?ERR:(stdscr->_y[y][x])) -#define mvinchstr(y,x,c) (move( y, x )==ERR?ERR:inchnstr( c, stdscr->_maxx-stdscr->_curx )) -#define mvinchnstr(y,x,c,n) (move( y, x )==ERR?ERR:inchnstr( c, n )) -#define mvinsch(y,x,c) (move( y, x )==ERR?ERR:winsch( stdscr, c )) -#define mvinsnstr(y,x,s,n) (move( y, x )==ERR?ERR:winsnstr(stdscr,s,n)) -#define mvinsstr(y,x,s) (move( y, x )==ERR?ERR:winsnstr(stdscr,s,(-1))) -#define mvinstr(y,x,str) (move( y, x )==ERR?ERR:winnstr(stdscr,(str),stdscr->_maxx)) -#define mvinnstr(y,x,str,n) (move( y, x )==ERR?ERR:winnstr(stdscr,(str),(n))) -#define mvwaddch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddch( w, c )) -#define mvwaddchstr(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddchnstr( w, c, -1 )) -#define mvwaddchnstr(w,y,x,c,n) (wmove( w, y, x )==ERR?ERR:waddchnstr( w, c, n )) -#define mvwaddrawch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddrawch( w, c )) -#define mvwaddrawstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:waddrawstr( w, str )) -#define mvwaddstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:waddstr( w, str )) -#define mvwdelch(w,y,x) (wmove( w, y, x )==ERR?ERR:wdelch( w )) -#define mvwgetch(w,y,x) (wmove( w, y, x )==ERR?ERR:wgetch( w )) -#define mvwgetstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:wgetstr( w, str )) -#define mvwinch(w,y,x) (wmove( w, y, x )==ERR?ERR:((w)->_y[y][x])) -#define mvwinchstr(w,y,x,c) (wmove( w, y, x )==ERR?ERR:winchnstr( w, c, (w)->_maxx-(w)->_curx )) -#define mvwinchnstr(w,y,x,c,n) (wmove( w, y, x )==ERR?ERR:winchnstr( w, c, n )) -#define mvwinsch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:winsch( w, c )) -#define mvwinstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:winnstr(w,str,(w)->_maxx)) -#define mvwinnstr(w,y,x,str,n) (wmove( w, y, x )==ERR?ERR:winnstr(w,str,n)) -#define mvwinsnstr(w,y,x,s,n) (wmove( w, y, x )==ERR?ERR:winsnstr(w,s,n)) -#define mvwinsstr(w,y,x,s) (wmove( w, y, x )==ERR?ERR:winsnstr(w,s,(-1))) -#define napms(ms) delay_output(ms) -#define nl() (SP->autocr = TRUE) -#define nonl() (SP->autocr = FALSE) -#define pechochar(w,c) (waddch(w,(chtype)c)==ERR?ERR:prefresh(w)) -#define redrawwin(w) wredrawln((w),0,(win)->_maxy) -#define refresh() wrefresh( stdscr ) -#define resetterm() reset_shell_mode() -#define saveterm() def_prog_mode() -#define scrl(n) wscrl(stdscr,n) -#define scroll(w) wscrl((w),1) -#define scrollok(w,flag) ((w)->_scroll = flag) -#define setscrreg(top, bot) wsetscrreg( stdscr, top, bot ) -#define standend() wattrset(stdscr, A_NORMAL) -#define standout() wattrset(stdscr, A_STANDOUT) -#define timeout(n) wtimeout( stdscr, n ) -#define touchline(w,y,n) wtouchln((w),(y),(n),TRUE) -#define touchwin(w) wtouchln((w),0,(w)->_maxy,TRUE) -#if defined (CURSES_LIBRARY) -# define traceoff() {trace_on = FALSE;} -# define traceon() {trace_on = TRUE;} -#endif -#define ungetch(ch) PDC_ungetch(ch) -#define untouchwin(w) wtouchln((w),0,((w)->_maxy),FALSE) -#define waddch(w, c) PDC_chadd( w, (chtype)c, (bool)!(SP->raw_out), TRUE ) -#define waddchstr(w, c) (waddchnstr( w, c, -1 )) -#define werase(w) (wmove((w),0,0), wclrtobot(w)) -#define wclear(w) ((w)->_clear = TRUE , werase(w)) -#define wechochar(w,c) (waddch(w,(chtype)c)==ERR?ERR:wrefresh(w)) -#define winch(w) ((w)->_y[(w)->_cury][(w)->_curx]) -#define winchstr(w, c) (winchnstr( w, c, (w)->_maxx-(w)->_curx ) ) -#define winsstr(w,str) winsnstr((w),(str),(-1)) -#define winstr(w,str) winnstr((w),str,(w)->_maxx) -#define wstandend(w) wattrset(w, A_NORMAL) -#define wstandout(w) wattrset(w, A_STANDOUT) - -#if !defined(UNIX) && !defined(XCURSES) -# define nocbreak() (SP->cbreak = FALSE) -# define cbreak() (SP->cbreak = TRUE) -# define nocrmode() (SP->cbreak = FALSE) -# define crmode() (SP->cbreak = TRUE) -# define noecho() (SP->echo = FALSE) -# define echo() (SP->echo = TRUE) -# define nodelay(w,flag) (w->_nodelay = flag) -#endif - -#if defined(PDCURSES) -# define addrawch( c ) waddrawch( stdscr, c ) -# define addrawstr(str) waddrawstr( stdscr, str ) -# define insrawch( c ) winsrawch( stdscr, c ) -# define waddrawch(w, c) PDC_chadd( w, (chtype)c, FALSE, TRUE ) -# define winsrawch(w, c) PDC_chins( w, (chtype)c, FALSE ) -# define PDC_save_key_modifiers(flag) (SP->save_key_modifiers = flag) -# define PDC_return_key_modifiers(flag) (SP->return_key_modifiers = flag) - -/* - * FYI: Need to document these functions... - */ -# define title(s,a) wtitle( stdscr, s, (chtype)a ) -# define titleofs(ofs) wtitleofs( stdscr, ofs ) -# define wtitle(w,s,a) (w->_title = s, w->_title_attr = (chtype)a) -# define wtitleofs(w,ofs) (w->_title_ofs = ofs) -#endif - -/* - * return codes from PDC_getclipboard() and PDC_setclipboard() calls. - */ -#define PDC_CLIP_SUCCESS 0 -#define PDC_CLIP_ACCESS_ERROR 1 -#define PDC_CLIP_EMPTY 2 -#define PDC_CLIP_MEMORY_ERROR 3 - -/* - * PDCurses key modifier masks - */ -#define PDC_KEY_MODIFIER_SHIFT (1 << 0) -#define PDC_KEY_MODIFIER_CONTROL (1 << 1) -#define PDC_KEY_MODIFIER_ALT (1 << 2) -#define PDC_KEY_MODIFIER_NUMLOCK (1 << 3) - -/* - * Load up curspriv.h. This should be in the same place as - * stdlib.h. We allow anyone who defines CURSES_LIBRARY to have - * access to our internal routines. This provides quick - * PC applications at the expense of portability. - */ -#if defined(CURSES_LIBRARY) -# include -#endif - -#include - -#endif /* __PDCURSES__ */ - -#if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS) -# undef bool - } -#endif +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +/* +$Id: curses.h,v 1.2 2001/01/10 08:31:32 mark Exp $ +*/ +/* +*---------------------------------------------------------------------- +* PDCurses +*---------------------------------------------------------------------- +* MH +* 991212 2.4 +* Key modifiers pressed by themselves are now returned as keys +* KEY_SHIFT_L KEY_SHIFT_R +* KEY_CONTROL_L KEY_CONTROL_R +* KEY_ALT_L KEY_ALT_R +* This works on Win32 and X11 ports only +* Added support for lcc-win32, supplied by Matthias Burian +* Added support for MingW32, and CygnusW32 compilers +* Added clipboard support for X11, Win32 and OS/2 ports +* Added ability to get to the input file descriptor +* New function for X11; Xinitscr() which allows standard X11 +* switches to be passed to the application +* Added X11 shared library support +* +* MH +* 960920 2.3 Added more System V R4 functions +* +* Rewrote X11 port +* +* Added Win32 port - original port by Chris Szurgot +* some updates by Mark Hessling +* some updates by Gurusamy Sarathy +* +* slk() functions added by Kim Huron +* +* Support for more and newer versions of compilers +* +* Added mouse support for X11 and Win32 ports +* +* Size of chtype now long +* +* MH +* 950126 2.2 Added more System V R4 functions +* +* Added beta Xwindows port +* +* Changed chtype to long +* +* Incorporated panels library +* +* Support for more and newer versions of compilers +* +* MH +* 930531 2.1 Added support for djgpp +* +* Added beta Unix version +* +* Added OS/2 DLL support. +* +* Changed behaviour of overlay(), overwrite() and typeahead() +* +* 921120 2.0 Changed #if to #ifdef/#if defined to make it +* easier to add new platforms/compilers. +* +* Added System V colour support. +* +* Added OS/2 port. +*------- +* Frotz +* 911221 2.0 pre-beta Changed back from short to int. (int is the +* correct size for the default platform. Short +* might be too short on some platforms. This +* is more portable. I, also, made this mistake.) +* +* Many functions are now macros. If you want +* the real thing, #undef the macro. (X/Open +* requirement.) +* +* Merged many sources into current release. +* +* Added many X/Open routines (not quite all yet). +* +* Added internal documentation to all routines. +* +* Added a HISTORY file to the environment. +* +* Added a CONTRIB file to the environment. +*------- +* bl 900114 1.4 Window origin mod in overlay() and overwrite(), on +* public (and very reasonable) request. Swapped +* #define'd values of OK and ERR; OK now 1, and +* ERR is 0/NULL. Conforms better to UNIX +* versions. borderchars[] removed from WINDOW +* struct since the border() functions were +* redefined. Use of short wherever possible. +* Portability improvements, mispelled name of +* [w]setscrreg(). +* +* 881005 1.3 All modules lint-checked with MSC '-W3' and +* turbo'C' '-w -w-pro' switches. Support for +* border(), wborder() functions. +* +* 881002 1.2 Rcsid[] string in all modules, for maintenance. +* +* 880306 1.1 'Raw' output routines, revision info in curses.h. +* +* 870515 1.0 Initial Release. +* +*---------------------------------------------------------------------- +*/ +#if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS) + extern "C" + { +# define bool _bool +#endif + +#ifndef __PDCURSES__ +#define __PDCURSES__ 1 + +/*man-start********************************************************************* + +All defines are "defined" here. All compiler and environment +specific definitions are defined into generic class defines. +These defines are to be given values so that the code can +rely on #if, rather than a complicated set of #if defined() or +#ifdefs... + +PDCurses definitions list: (Only define those needed) + + REGISTERWINDOWS True for auto window update registery. + FAST_VIDEO True if display is memory mapped, or + we can utilize the fast video update routines. + DOS True if compiling for DOS. + OS2 True if compiling for OS/2. + WIN32 True if compiling for Windoze 95 or Windoze NT + FLEXOS True if compiling for Flexos. + HC True if using a Metaware compiler. + TC True if using a Borland compiler. + MSC True if using a Microsoft compiler. + HAVE_PROTO True if the compiler supports ANSI prototypes. + CPLUSPLUS True if the compiler supports C++. + PDC_BUILD???? Defines API build version. + +PDCurses portable platform definitions list: + + PDCURSES Enables access to PDCurses-only routines. + XOPEN Always true. + SYSVcurses True if you are compiling for SYSV portability. + BSDcurses True if you are compiling for BSD portability. + PDCURSES_WCLR Makes behaviour of wclrtoeol() and wclrtoeof() + unique to PDCurses. By default Unix behavior is set. + See notes in wclrtoeol() and wclrtoeof(). +**man-end**********************************************************************/ + +#define PDC_BUILD 2401 +#define PDCURSES 1 /* PDCurses-only routines */ +#define XOPEN 1 /* X/Open Curses routines */ +#define SYSVcurses 1 /* System V Curses routines */ +#define BSDcurses 1 /* BSD Curses routines */ +#define CHTYPE_LONG 1 /* size of chtype; long */ + +#define PDC_CDECL /* default define this as empty */ + +/*---------------------------------------- +* BORLAND COMPILERS Turbo C[++], Borland C[++] +* +* Borland definitions: +* TC +* DOS +* OS2 +* CPLUSPLUS +* +* __TURBOC__, __MSDOS__, +* __OS2__ and __WIN32__ +* are predefined by compiler. +*/ +#ifdef __TURBOC__ /* Borland gives defines this as a value*/ +# define TC __TURBOC__ /* Define a value for TC */ +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* Borland supports ANSI C prototypes */ +# endif +# ifdef __MSDOS__ +# define DOS 6 /* Major release of DOS supported */ +# include +# include +# endif +# ifdef __OS2__ +# define OS2 3 /* Major release of OS/2 supported */ +# define INCL_VIO +# define INCL_KBD +# include +# endif +# ifdef __WIN32__ +# ifdef INCLUDE_WINDOWS_H /* only include for WIN32 files */ +# include +# ifdef MOUSE_MOVED /* get rid of Windows #define */ +# undef MOUSE_MOVED +# endif +# endif +# ifndef WIN32 +# define WIN32 1 +# endif +# endif +# if __TURBOC__ >= 0x290 +# ifdef __BCPLUSPLUS__ +# define CPLUSPLUS 1 /* Define that we are compiling C++. */ +# endif +# ifdef __TCPLUSPLUS__ +# define CPLUSPLUS 1 /* Define that we are compiling C++. */ +# endif +# ifdef __CPLUSPLUS__ +# define CPLUSPLUS 1 /* Define that we are compiling C++. */ +# endif +# endif +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +# ifndef HAVE_MEMORY_H +# define HAVE_MEMORY_H /* have */ +# endif +# ifndef HAVE_STDARG_H +# define HAVE_STDARG_H /* have */ +# endif +# ifndef HAVE_MEMMOVE +# define HAVE_MEMMOVE /* have memmove() */ +# endif +# ifndef HAVE_VSSCANF +# define HAVE_VSSCANF /* have vsscanf() */ +# endif +#endif + + +/*---------------------------------------- +* METAWARE COMPILERS High C +* +* Metaware definitions: +* HC +* DOS +* FLEXOS +*/ +#ifdef __HIGHC__ +# define HC 1 +# pragma off(prototype_override_warnings) +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* Metaware supports ANSI C prototypes */ +# endif +# ifdef __MSDOS__ +# define DOS 6 /* Major release of DOS supported */ +# include +# include +# endif +# ifdef __FLEXOS__ /* define this on the command line */ +# define FLEXOS 2 /* or latest major release value. */ +# endif +#endif + +/*---------------------------------------- +* MICROSOFT COMPILERS MSC +* +* Microsoft definitions: +* MSC +* DOS || OS2 +*/ +#ifdef _MSC_VER /* defined by compiler */ +# define MSC 1 +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* Microsoft supports ANSI C prototypes */ +# endif +# ifdef __OS2__ /* You will have to define in makefile */ +# define USE_OS2_H 1 /* Use the os2.h for the compiler */ +# define OS2 3 /* Major release of OS/2 supported */ +# define INCL_VIO +# define INCL_KBD +# include +# define FARKeyword far +# define APIRET USHORT +# else /* no __OS2__ define, so assume DOS */ +# ifdef _WIN32 +# ifndef WIN32 +# define WIN32 +# endif +# ifdef INCLUDE_WINDOWS_H /* only include for WIN32 files */ +# include +# ifdef MOUSE_MOVED /* get rid of Windows #define */ +# undef MOUSE_MOVED +# endif +# endif +# ifndef HAVE_MEMORY_H +# define HAVE_MEMORY_H /* have */ +# endif +# ifndef HAVE_STDARG_H +# define HAVE_STDARG_H /* have */ +# endif +# else +# define DOS 6 /* Major release of DOS supported */ +# include +# include +# undef HAVE_VSSCANF /* vsscanf() function NOT in library */ +# endif +# endif +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +# ifndef HAVE_MEMMOVE +# define HAVE_MEMMOVE /* have memmove() */ +# endif +#endif + +/*---------------------------------------- +* MICROSOFT QUICK C COMPILERS QC +* +*/ +#ifdef _QC /* defined by compiler */ +# define MSC 1 +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* QuickC supports ANSI C prototypes */ +# endif +# define DOS 6 /* Major release of DOS supported */ +# include +# include +# undef HAVE_VSSCANF /* vsscanf() function NOT in library */ +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +#endif + +/*---------------------------------------- +* TOPSPEED compilers TSC +* +* TOPSPEED definitions: +* TSC +* DOS || OS2 +*/ +#ifdef __TSC__ /* You may have to define in makefile */ +# define TSC 1 +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* TopSpeed supports ANSI C prototypes */ +# endif +# ifdef __OS2__ +# define OS2 3 /* Major release of OS/2 supported */ +# define INCL_VIO +# define INCL_KBD +# include +# endif +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +#endif + +/*---------------------------------------- +* IBM C Set/2 Compiler CSET2 +* +* IBM definitions: +* CSET2 +* OS2 +*/ +#ifdef __IBMC__ +# define CSET2 1 +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* C Set/2 supports ANSI C prototypes */ +# endif +# ifndef HAVE_STDARG_H +# define HAVE_STDARG_H /* have */ +# endif +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +# ifndef HAVE_MEMORY_H +# define HAVE_MEMORY_H /* have */ +# endif +# ifndef HAVE_MEMMOVE +# define HAVE_MEMMOVE /* have memmove() */ +# endif +# ifdef __OS2__ +# define OS2 3 /* Major release of OS/2 supported */ +# define INCL_VIO +# define INCL_KBD +# include +# endif +#endif + +/*---------------------------------------- +* GNU compilers emx +* +* emx definitions: +* EMX +* OS2 +*/ +#ifdef __EMX__ /* You may have to define in makefile */ +# define EMX 1 +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* emx supports ANSI C prototypes */ +# endif +# define __OS2__ /* EMX does not define this :-( */ +# define OS2 3 /* Major release of OS/2 supported */ +# define CURSES__32BIT__ +# ifndef HAVE_STDARG_H +# define HAVE_STDARG_H /* have */ +# endif +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +# ifndef HAVE_MEMORY_H +# define HAVE_MEMORY_H /* have */ +# endif +# ifndef HAVE_UNISTD_H +# define HAVE_UNISTD_H /* have */ +# endif +# ifndef HAVE_MEMMOVE +# define HAVE_MEMMOVE /* have memmove() */ +# endif +# ifndef HAVE_VSSCANF +# define HAVE_VSSCANF /* have vsscanf() */ +# endif +# if defined(EMXVIDEO) +# include +# include +# else +# define INCL_VIO +# define INCL_KBD +# include +# endif +#endif + +/*---------------------------------------- +* GNU compilers djgpp +* +* djgpp definitions: +* GO32 +* DOS +*/ +#ifdef GO32 /* You may have to define in makefile */ +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* DJGPP supports ANSI C prototypes */ +# endif +# define DOS 6 +# include +# ifdef __FLEXOS__ /* define this on the command line */ +# define FLEXOS 2 /* or latest major release value. */ +# endif +# define CURSES__32BIT__ +# ifdef _cplusplus +# define CPLUSPLUS 1 +# endif +# ifndef HAVE_STDARG_H +# define HAVE_STDARG_H /* have */ +# endif +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +# ifndef HAVE_MEMORY_H +# define HAVE_MEMORY_H /* have */ +# endif +# ifndef HAVE_UNISTD_H +# define HAVE_UNISTD_H /* have */ +# endif +# ifndef HAVE_MEMMOVE +# define HAVE_MEMMOVE /* have memmove() */ +# endif +# ifndef HAVE_USLEEP +# define HAVE_USLEEP /* have usleep() */ +# endif +#endif + + +/*---------------------------------------- +* GNU compilers Cygnus Win32 +* +* cygnus definitions: +* WIN32 +*/ +#ifdef __CYGWIN32__ /* You may have to define in makefile */ +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* Cygnuc GCC supports ANSI C prototypes */ +# endif +# ifdef INCLUDE_WINDOWS_H +# include +# ifdef MOUSE_MOVED +# undef MOUSE_MOVED +# endif +# endif +# ifndef WIN32 +# define WIN32 +# endif +# ifndef INT_MAX +# define INT_MAX 32762 +# endif +# define CURSES__32BIT__ +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +# ifndef HAVE_MEMORY_H +# define HAVE_MEMORY_H /* have */ +# endif +# ifndef HAVE_STDARG_H +# define HAVE_STDARG_H /* have */ +# endif +# ifndef HAVE_UNISTD_H +# define HAVE_UNISTD_H /* have */ +# endif +# ifndef HAVE_MEMMOVE +# define HAVE_MEMMOVE /* have memmove() */ +# endif +# ifndef HAVE_USLEEP +# define HAVE_USLEEP /* have usleep() */ +# endif +#endif + +/*---------------------------------------- +* GNU compilers Ming Win32 +* +* Ming definitions: +* WIN32 +*/ +#ifdef __MINGW32__ +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* Ming GCC supports ANSI C prototypes */ +# endif +# ifdef INCLUDE_WINDOWS_H +# include +# ifdef MOUSE_MOVED +# undef MOUSE_MOVED +# endif +# endif +# ifndef WIN32 +# define WIN32 +# endif +# define CURSES__32BIT__ +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +# ifndef HAVE_MEMORY_H +# define HAVE_MEMORY_H /* have */ +# endif +# ifndef HAVE_STDARG_H +# define HAVE_STDARG_H /* have */ +# endif +# ifndef HAVE_UNISTD_H +# define HAVE_UNISTD_H /* have */ +# endif +# ifndef HAVE_MEMMOVE +# define HAVE_MEMMOVE /* have memmove() */ +# endif +#endif + +/*---------------------------------------- +* LCC WIN32 +* +*/ +#ifdef __LCC__ /* should already be defined by the compiler */ +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* LCC-Win32 supports ANSI C prototypes */ +# endif +# ifdef INCLUDE_WINDOWS_H +# include +# ifdef MOUSE_MOVED +# undef MOUSE_MOVED +# endif +# endif +# ifndef WIN32 +# define WIN32 +# endif +# ifndef INT_MAX +# define INT_MAX 32762 +# endif +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +# ifndef HAVE_MEMORY_H +# define HAVE_MEMORY_H /* have */ +# endif +# ifndef HAVE_STDARG_H +# define HAVE_STDARG_H /* have */ +# endif +# ifndef HAVE_MEMMOVE +# define HAVE_MEMMOVE /* have memmove() */ +# endif +#endif + +/*---------------------------------------- +* Watcom C/C++ 10.6 compiler +* +* WATCOM definitions: +* WATCOMC +* OS2 +* WIN32 +*/ +#ifdef __WATCOMC__ +# define WATCOMC 1 +# ifndef HAVE_PROTO +# define HAVE_PROTO 1 /* Watcom C supports ANSI C prototypes */ +# endif +# define CURSES__32BIT__ +# if defined( __DOS__ ) || defined( __DOS4G__ ) +# define DOS 7 /* Major release of DOS supported */ +# include +# include +# include +# ifdef __386__ +# define int86 int386 +# define int86x int386x +# endif +# endif +# if defined( __OS2__ ) || defined( __OS2V2__ ) +# define OS2 3 /* Major release of OS/2 supported */ +# define CURSES__32BIT__ +# define INCL_VIO +# define INCL_KBD +# include +# endif +# ifdef __NT__ /* This specifies WIN32 target */ +# ifdef INCLUDE_WINDOWS_H +# include +# ifdef MOUSE_MOVED +# undef MOUSE_MOVED +# endif +# endif +# ifndef WIN32 +# define WIN32 +# endif + +/* +# ifdef PDC_CDECL +# undef PDC_CDECL +# define PDC_CDECL cdecl +# endif +*/ + +# endif +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +# ifndef HAVE_MEMORY_H +# define HAVE_MEMORY_H /* have */ +# endif +# ifndef HAVE_STDARG_H +# define HAVE_STDARG_H /* have */ +# endif +# ifndef HAVE_MEMMOVE +# define HAVE_MEMMOVE /* have memmove() */ +# endif +# ifndef HAVE_VSSCANF +# define HAVE_VSSCANF /* have vsscanf() */ +# endif +#endif + +#if 0 +/*---------------------------------------- +* gcc under UNIX +* +* GNU definitions: +* UNIX +*/ +#ifdef UNIX +# define HAVE_PROTO 1 /* GNU C supports ANSI C prototypes */ +# ifdef SUNOS +# define NO_VSSCANF +# define NO_MEMMOVE +# undef BSD +# endif +# ifdef linux +# undef BSD +# endif +#endif +#endif + +/*---------------------------------------- +* MicroWay NDP C/C++ 386 4.2.0 compiler +*/ +#ifdef MX386 +# define HAVE_PROTO 1 +# define NDP 1 +# include +# ifdef DOS +# define MK_FP(seg,ofs) ( (((int) (seg)) << 4) + ((int) (ofs)) ) +# ifdef __i860 + typedef void _int; +# else + typedef int _int; +# endif +# endif +# undef NO_VSSCANF /* vsscanf() function NOT in library */ +# ifndef HAVE_LIMITS_H +# define HAVE_LIMITS_H /* have */ +# endif +#endif + +/*---------------------------------------------------------------------*/ +#include /* Required by X/Open usage below */ +/*---------------------------------------------------------------------- + * + * PDCurses Manifest Constants + * + */ +#ifndef FALSE /* booleans */ +# define FALSE 0 +#endif +#ifndef TRUE /* booleans */ +# define TRUE !FALSE +#endif +#ifndef NULL +# define NULL 0 /* Null pointer */ +#endif +#ifndef ERR +# define ERR 0 /* general error flag */ +#endif +#ifndef OK +# define OK 1 /* general OK flag */ +#endif + + +/*---------------------------------------------------------------------- + * + * PDCurses Type Declarations + * + */ +typedef unsigned char bool; /* PDCurses Boolean type */ + +#ifdef CHTYPE_LONG +typedef unsigned long chtype; /* 16-bit attr + 16-bit char */ +#else +typedef unsigned short chtype; /* 8-bit attr + 8-bit char */ +#endif + +/*---------------------------------------------------------------------- + * This defines a new type for attributes. + * + */ +typedef chtype attr_t; + +/*---------------------------------------------------------------------- + * Define our mouse interface - same as SYSVR4 (with extensions) + */ + +typedef struct +{ + int x; /* absolute column, 0 based, measured in characters */ + int y; /* absolute row, 0 based, measured in characters */ + short button[3]; /* state of each button */ + int changes; /* flags indicating what has changed with the mouse */ +} MOUSE_STATUS; + + +#define BUTTON_RELEASED 0000 +#define BUTTON_PRESSED 0001 +#define BUTTON_CLICKED 0002 +#define BUTTON_DOUBLE_CLICKED 0003 +#define BUTTON_TRIPLE_CLICKED 0004 +#define BUTTON_MOVED 0005 /* PDCurses enhancement */ +#define BUTTON_ACTION_MASK 0007 /* PDCurses enhancement */ +#define BUTTON_SHIFT 0010 /* PDCurses enhancement */ +#define BUTTON_CONTROL 0020 /* PDCurses enhancement */ +#define BUTTON_ALT 0040 /* PDCurses enhancement */ +#define BUTTON_MODIFIER_MASK 0070 /* PDCurses enhancement */ + +#define MOUSE_X_POS (Mouse_status.x) +#define MOUSE_Y_POS (Mouse_status.y) +#define A_BUTTON_CHANGED (Mouse_status.changes & 7) +#define MOUSE_MOVED (Mouse_status.changes & 8) +#define MOUSE_POS_REPORT (Mouse_status.changes & 16) +#define BUTTON_CHANGED(x) (Mouse_status.changes & (1 << ((x) - 1))) +#define BUTTON_STATUS(x) (Mouse_status.button[(x)-1]) + +/* mouse bit-masks */ +#define BUTTON1_RELEASED 000000000001L +#define BUTTON1_PRESSED 000000000002L +#define BUTTON1_CLICKED 000000000004L +#define BUTTON1_DOUBLE_CLICKED 000000000010L +#define BUTTON1_TRIPLE_CLICKED 000000000020L +#define BUTTON1_MOVED 000000000020L /* PDCurses enhancement */ +#define BUTTON2_RELEASED 000000000040L +#define BUTTON2_PRESSED 000000000100L +#define BUTTON2_CLICKED 000000000200L +#define BUTTON2_DOUBLE_CLICKED 000000000400L +#define BUTTON2_TRIPLE_CLICKED 000000001000L +#define BUTTON2_MOVED 000000001000L /* PDCurses enhancement */ +#define BUTTON3_RELEASED 000000002000L +#define BUTTON3_PRESSED 000000004000L +#define BUTTON3_CLICKED 000000010000L +#define BUTTON3_DOUBLE_CLICKED 000000020000L +#define BUTTON3_TRIPLE_CLICKED 000000040000L +#define BUTTON3_MOVED 000000040000L /* PDCurses enhancement */ +#define BUTTON_MODIFIER_SHIFT 000000100000L /* PDCurses enhancement */ +#define BUTTON_MODIFIER_CONTROL 000000200000L /* PDCurses enhancement */ +#define BUTTON_MODIFIER_ALT 000000400000L /* PDCurses enhancement */ +#define ALL_MOUSE_EVENTS 000000777777L +#define REPORT_MOUSE_POSITION 000001000000L + +/*---------------------------------------------------------------------- + * + * PDCurses Structure Definitions: + * + */ +typedef struct _win /* definition of a window. */ +{ + int _cury; /* current pseudo-cursor */ + int _curx; + int _maxy; /* max window coordinates */ + int _maxx; + int _pmaxy; /* max physical size */ + int _pmaxx; + int _begy; /* origin on screen */ + int _begx; + int _lastpy; /* last y coordinate of upper left pad display area */ + int _lastpx; /* last x coordinate of upper left pad display area */ + int _lastsy1; /* last upper y coordinate of screen window for pad */ + int _lastsx1; /* last upper x coordinate of screen window for pad */ + int _lastsy2; /* last lower y coordinate of screen window for pad */ + int _lastsx2; /* last lower x coordinate of screen window for pad */ + int _flags; /* window properties */ + attr_t _attrs; /* standard A_STANDOUT attributes and colors */ + chtype _bkgd; /* wrs(4/6/93) background, normally blank */ + int _tabsize; /* tab character size */ + bool _clear; /* causes clear at next refresh */ + bool _leaveit; /* leaves cursor where it is */ + bool _scroll; /* allows window scrolling */ + bool _nodelay; /* input character wait flag */ + bool _immed; /* immediate update flag */ + bool _sync; /* synchronise window ancestors */ + bool _use_keypad; /* flags keypad key mode active */ + bool _use_idl; /* True if Ins/Del line can be used*/ + bool _use_idc; /* True if Ins/Del character can be used*/ + chtype**_y; /* pointer to line pointer array */ + int* _firstch; /* first changed character in line */ + int* _lastch; /* last changed character in line */ + int _tmarg; /* top of scrolling region */ + int _bmarg; /* bottom of scrolling region */ + char* _title; /* window title */ + char _title_ofs; /* window title offset from left */ + attr_t _title_attr; /* window title attributes */ + chtype _blank; /* window's blank character */ + int _parx, _pary; /* coords relative to parent (0,0) */ +struct _win* _parent; /* subwin's pointer to parent win */ +} WINDOW; + + + +/*---------------------------------------------------------------------- +* +* Private structures that are necessary for correct +* macro construction. +* +*/ + +#ifdef REGISTERWINDOWS +typedef struct _ref /* Refresh Window Structure */ +{ + WINDOW* win; +struct _ref* next; +struct _ref* tail; +} ACTIVE; + +typedef struct _wins +{ + WINDOW* w; /* pointer to a visible window */ + struct _wins* next; /* Next visible window pointer */ + struct _wins* prev; /* Next visible window pointer */ + struct _wins* tail; /* Last visible window pointer */ + /* Only head window (stdscr) has */ + /* a valid tail pointer. */ +} WINDS; +#endif + +typedef struct /* structure for ripped off lines */ +{ + int line; + int (*init)(); +} RIPPEDOFFLINE; + + +typedef struct +{ + bool alive; /* if initscr() called */ + bool autocr; /* if lf -> crlf */ + bool cbreak; /* if terminal unbuffered */ + bool echo; /* if terminal echo */ + bool raw_inp; /* raw input mode (v. cooked input) */ + bool raw_out; /* raw output mode (7 v. 8 bits) */ + bool refrbrk; /* if premature refresh brk allowed */ + bool orgcbr; /* original MSDOS ^-BREAK setting */ + bool visible_cursor; /* TRUE if cursor is visible */ + bool audible; /* FALSE if the bell is visual */ + bool full_redraw; /* TRUE for bad performance */ + bool direct_video; /* Allow Direct Screen Memory writes*/ + bool mono; /* TRUE if current screen is mono. */ + bool sizeable; /* TRUE if adapter is resizeable. */ + bool resized; /* TRUE if TERM has been resized */ + bool bogus_adapter; /* TRUE if adapter has insane values*/ + bool shell; /* TRUE if reset_prog_mode() needs */ + /* to be called. */ + chtype blank; /* Background character */ + attr_t orig_attr; /* Original screen attributes */ + int cursrow; /* position of physical cursor */ + int curscol; /* position of physical cursor */ + int cursor; /* Current Cursor definition */ + int visibility; /* Visibility of cursor */ + int video_page; /* Current PC video page */ + int orig_emulation; /* Original cursor emulation value */ + int orig_cursor; /* Original cursor size */ + int font; /* default font size */ + int orig_font; /* Original font size */ + int lines; /* New value for LINES */ + int cols; /* New value for COLS */ + unsigned long _trap_mbe; /* trap these mouse button events */ + unsigned long _map_mbe_to_key; /* map mouse buttons to slk */ + int slklines; /* Lines in use by slk_init() */ + WINDOW * slk_winptr; /* window for slk */ + int linesrippedoff; /* Lines ripped off via ripoffline() */ + int linesrippedoffontop; /* Lines ripped off on top via ripoffline() */ + int delaytenths; /* 1/10ths second to wait block getch() for */ + bool _preserve; /* TRUE if screen background to be preserved */ + bool _restore; /* TRUE if screen background to be restored */ + bool save_key_modifiers; /* TRUE if each key modifiers saved with each key press */ + bool return_key_modifiers; /* TRUE if modifier keys are returned as "real" keys */ + +#ifdef OS2 +# ifdef EMXVIDEO /* nop if using EMX builtins */ + int tahead; /* Type-ahead value */ + int adapter; /* Screen type */ +# else + VIOMODEINFO scrnmode; /* default screen mode */ + VIOCONFIGINFO adapter; /* Screen type */ +# endif +#else + int adapter; /* Screen type */ +#endif + +#if defined(DOS) || defined(WIN32) + int scrnmode; /* default screen mode */ + unsigned video_seg; /* video base segment */ + unsigned video_ofs; /* video base offset */ +#endif + +#if defined(OS2) || defined(WIN32) + int num_mouse_buttons; /* number of mouse buttons */ +#endif + +#if defined (XCURSES) + int XcurscrSize; /* size of Xcurscr shared memory block */ + bool sb_on; + int sb_viewport_y; + int sb_viewport_x; + int sb_total_y; + int sb_total_x; + int sb_cur_y; + int sb_cur_x; +#endif + +#ifdef REGISTERWINDOWS + WINDS* visible; /* List of visible windows */ + bool refreshall; /* Refresh all registered windows? */ +#endif + +} SCREEN; + + +/* external variables */ +#if !defined(PDC_STATIC_BUILD) && defined(_MSC_VER) && defined(WIN32) && !defined(CURSES_LIBRARY) +__declspec(dllimport) int LINES; /* terminal height */ +__declspec(dllimport) int COLS; /* terminal width */ +__declspec(dllimport) WINDOW* stdscr; /* the default screen window */ +__declspec(dllimport) WINDOW* curscr; /* the current screen image */ +__declspec(dllimport) SCREEN *SP; /* curses variables */ +__declspec(dllimport) int use_emalloc; /* set to true to use your own malloc,etc */ +__declspec(dllimport) MOUSE_STATUS Mouse_status; +__declspec(dllimport) int COLORS; +__declspec(dllimport) int COLOR_PAIRS; +#else +# if !defined(PDC_STATIC_BUILD) && defined(_MSC_VER) && defined(WIN32) +__declspec(dllexport) extern int LINES; /* terminal height */ +__declspec(dllexport) extern int COLS; /* terminal width */ +__declspec(dllexport) extern WINDOW* stdscr; /* the default screen window */ +__declspec(dllexport) extern WINDOW* curscr; /* the current screen image */ +__declspec(dllexport) extern SCREEN *SP; /* curses variables */ +__declspec(dllexport) extern int use_emalloc; /* set to true to use your own malloc,etc */ +__declspec(dllexport) extern MOUSE_STATUS Mouse_status; +__declspec(dllexport) extern int COLORS; +__declspec(dllexport) extern int COLOR_PAIRS; +# else +extern int LINES; /* terminal height */ +extern int COLS; /* terminal width */ +extern WINDOW* stdscr; /* the default screen window */ +extern WINDOW* curscr; /* the current screen image */ +extern SCREEN *SP; /* curses variables */ +extern int use_emalloc; /* set to true to use your own malloc,etc */ +extern MOUSE_STATUS Mouse_status; +extern int COLORS,COLOR_PAIRS; +# endif +#endif + +#if defined (CURSES_LIBRARY) +extern int _default_lines; /* For presetting maximum lines */ +#endif + +#ifdef REGISTERWINDOWS +extern ACTIVE* CurWins; /* Currently Visible Windows */ +#endif + + + + +/*man-start********************************************************************* + +PDCurses Text Attributes: + +To include colour in PDCurses, a number of things had to be sacrificed +from the strict Unix and System V support. +The main problem is fitting all character attributes and colour into +an unsigned char (all 8 bits!). On System V, chtype is a long on +PDCurses it is a short int. + +The following is the structure of a win->_attrs chtype: + +------------------------------------------------------------------------------------------------- +|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| +------------------------------------------------------------------------------------------------- + colour number | modifiers | character eg 'a' (potential for DBCS) + +The available attribute modifiers are bold, underline, invisible, protect, reverse +and blink. + +**man-end**********************************************************************/ + +/* Video attribute definitions. */ +#ifdef CHTYPE_LONG +#define A_NORMAL 0x00000000L +#define A_STANDOUT 0x00A00000L +#define A_BOLD 0x00800000L +#define A_UNDERLINE 0x00100000L +#define A_REVERSE 0x00200000L +#define A_BLINK 0x00400000L +#define A_DIM 0x00020000L +#define A_INVIS 0x00080000L +#define A_PROTECT 0x00010000L +#define A_ALTCHARSET 0x00040000L +#define A_ATTRIBUTES 0xFFFF0000L +#define A_CHARTEXT 0x0000FFFFL +#define A_COLOR 0xFF000000L + +#else + +#define A_NORMAL (chtype)0x0000 /* SysV */ +#define A_ALTCHARSET (chtype)0x0000 /* X/Open */ +#define A_BLINK (chtype)0x0400 /* X/Open */ +#define A_BLANK (chtype)0x0000 /* X/Open */ +#define A_BOLD (chtype)0x0100 /* X/Open */ +#define A_DIM (chtype)0x0000 /* X/Open */ +#define A_PROTECT (chtype)0x0000 /* X/Open */ +#define A_REVERSE (chtype)0x0200 /* X/Open */ +#define A_STANDOUT ((chtype)(A_REVERSE | A_BOLD)) /* X/Open */ +#define A_UNDERLINE (chtype)0x0000 /* X/Open */ +#define A_COLOR (chtype)0xF800 /*System V */ +#define A_CHARTEXT (chtype)(0xFF) /* X/Open */ +#define A_ATTRIBUTES (chtype)(~A_CHARTEXT) /* X/Open */ +#endif + +#define CHR_MSK A_CHARTEXT /* Obsolete */ +#define ATR_MSK A_ATTRIBUTES /* Obsolete */ +#define ATR_NRM A_NORMAL /* Obsolete */ + +#ifdef XCURSES +extern chtype *acs_map; + +# define ACS_BSSB (acs_map['l']) +# define ACS_SSBB (acs_map['m']) +# define ACS_BBSS (acs_map['k']) +# define ACS_SBBS (acs_map['j']) +# define ACS_SBSS (acs_map['u']) +# define ACS_SSSB (acs_map['t']) +# define ACS_SSBS (acs_map['v']) +# define ACS_BSSS (acs_map['w']) +# define ACS_BSBS (acs_map['q']) +# define ACS_SBSB (acs_map['x']) +# define ACS_SSSS (acs_map['n']) + +# define ACS_ULCORNER ACS_BSSB +# define ACS_LLCORNER ACS_SSBB +# define ACS_URCORNER ACS_BBSS +# define ACS_LRCORNER ACS_SBBS +# define ACS_RTEE ACS_SBSS +# define ACS_LTEE ACS_SSSB +# define ACS_BTEE ACS_SSBS +# define ACS_TTEE ACS_BSSS +# define ACS_HLINE ACS_BSBS +# define ACS_VLINE ACS_SBSB +# define ACS_PLUS ACS_SSSS + +# define ACS_S1 (acs_map['o']) +# define ACS_S9 (acs_map['s']) +# define ACS_DIAMOND (acs_map['\'']) +# define ACS_CKBOARD (acs_map['a']) +# define ACS_DEGREE (acs_map['f']) +# define ACS_PLMINUS (acs_map['g']) +# define ACS_BULLET (acs_map['~']) +# define ACS_LARROW (acs_map[',']) +# define ACS_RARROW (acs_map['+']) +# define ACS_DARROW (acs_map['.']) +# define ACS_UARROW (acs_map['-']) +# define ACS_BOARD (acs_map['h']) +# define ACS_LANTERN (acs_map['i']) +# define ACS_BLOCK (acs_map['0']) + +# define ACS_S3 (acs_map['p']) +# define ACS_S7 (acs_map['r']) +# define ACS_LEQUAL (acs_map['y']) +# define ACS_GEQUAL (acs_map['z']) +# define ACS_PI (acs_map['{']) +# define ACS_NEQUAL (acs_map['|']) +# define ACS_STERLING (acs_map['}']) +#endif + +#if defined(DOS) || defined(OS2) || defined(WIN32) +/* ALTCHARSET definitions from jshumate@wrdis01.robins.af.mil */ +# define ACS_ULCORNER (chtype)0xda /* SysV */ +# define ACS_LLCORNER (chtype)0xc0 /* SysV */ +# define ACS_URCORNER (chtype)0xbf /* SysV */ +# define ACS_LRCORNER (chtype)0xd9 /* SysV */ +# define ACS_RTEE (chtype)0xb4 /* SysV */ +# define ACS_LTEE (chtype)0xc3 /* SysV */ +# define ACS_BTEE (chtype)0xc1 /* SysV */ +# define ACS_TTEE (chtype)0xc2 /* SysV */ +# define ACS_HLINE (chtype)0xc4 /* SysV */ +# define ACS_VLINE (chtype)0xb3 /* SysV */ +# define ACS_PLUS (chtype)0xc5 /* SysV */ +# define ACS_S1 (chtype)0x2d /* SysV */ +# define ACS_S9 (chtype)0x5f /* SysV */ +# define ACS_DIAMOND (chtype)0xc5 /* SysV */ +# define ACS_CKBOARD (chtype)0xb2 /* SysV */ +# define ACS_DEGREE (chtype)0xf8 /* SysV */ +# define ACS_PLMINUS (chtype)0xf1 /* SysV */ +# define ACS_BULLET (chtype)0xf9 /* SysV */ +# define ACS_LARROW (chtype)0x3c /* SysV */ +# define ACS_RARROW (chtype)0x3e /* SysV */ +# define ACS_DARROW (chtype)0x76 /* SysV */ +# define ACS_UARROW (chtype)0x5e /* SysV */ +# define ACS_BOARD (chtype)0x23 /* SysV */ +# define ACS_LANTERN (chtype)0x23 /* SysV */ +# define ACS_BLOCK (chtype)0x23 /* SysV */ + +/* the following definitions can be used if you have set raw_output() + or are using the PDCurses *raw*() functions */ +# if 0 +# define ACS_DIAMOND (chtype)0x04 /* SysV */ +# define ACS_LARROW (chtype)0x1b /* SysV */ +# define ACS_RARROW (chtype)0x1a /* SysV */ +# define ACS_DARROW (chtype)0x19 /* SysV */ +# define ACS_UARROW (chtype)0x18 /* SysV */ +# define ACS_BOARD (chtype)0xb0 /* SysV */ +# define ACS_LANTERN (chtype)0x0f /* SysV */ +# define ACS_BLOCK (chtype)0xdb /* SysV */ +# endif +#endif + +/* colour attributes */ +#if defined (XCURSES) +# define COLOR_BLACK 0 +# define COLOR_RED 1 +# define COLOR_GREEN 2 +# define COLOR_YELLOW 3 +# define COLOR_BLUE 4 +# define COLOR_MAGENTA 5 +# define COLOR_CYAN 6 +# define COLOR_WHITE 7 +#endif + +#if defined(DOS) || defined(OS2) +# define COLOR_BLACK 0 +# define COLOR_BLUE 1 +# define COLOR_GREEN 2 +# define COLOR_CYAN 3 +# define COLOR_RED 4 +# define COLOR_MAGENTA 5 +# define COLOR_YELLOW 6 +# define COLOR_WHITE 7 +#endif + +#if defined(WIN32) +# define MS_MOUSE_MOVED 0x0001 +/* + * These defines taken directly from windows.h to reduce + * compilation time by only #include'ing + * when absolutely necesssary. Cygnus-W32 #defines all of these + * so we need to check for that. + */ +# ifndef FOREGROUND_BLUE +# define FOREGROUND_BLUE 0x0001 +# endif +# ifndef FOREGROUND_GREEN +# define FOREGROUND_GREEN 0x0002 +# endif +# ifndef FOREGROUND_RED +# define FOREGROUND_RED 0x0004 +# endif +# ifndef FOREGROUND_INTENSITY +# define FOREGROUND_INTENSITY 0x0008 /* BOLD */ +# endif +# ifndef BACKGROUND_BLUE +# define BACKGROUND_BLUE 0x0010 +# endif +# ifndef BACKGROUND_GREEN +# define BACKGROUND_GREEN 0x0020 +# endif +# ifndef BACKGROUND_RED +# define BACKGROUND_RED 0x0040 +# endif +# ifndef BACKGROUND_INTENSITY +# define BACKGROUND_INTENSITY 0x0080 /* BLINK */ +# endif + +# define COLOR_BLACK 0 +# define COLOR_BLUE FOREGROUND_BLUE +# define COLOR_RED FOREGROUND_RED +# define COLOR_GREEN FOREGROUND_GREEN +# define COLOR_CYAN FOREGROUND_BLUE | FOREGROUND_GREEN +# define COLOR_MAGENTA FOREGROUND_RED | FOREGROUND_BLUE +# define COLOR_YELLOW FOREGROUND_RED | FOREGROUND_GREEN +# define COLOR_WHITE FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE +#endif + +#ifdef CHTYPE_LONG +#define COLOR_PAIR(n) ((chtype)(n) << 24) +#define PAIR_NUMBER(n) (((n) & A_COLOR) >> 24) +#else +#define COLOR_PAIR(n) (((n) << 11) & A_ATTRIBUTES) +#define PAIR_NUMBER(n) (((n) & A_COLOR) >> 11) +#endif + +/*---------------------------------------------------------------------- + * + * Function and Keypad Key Definitions. + * Many are just for compatibility. + * + */ +#define KEY_MIN 0x101 /* Minimum curses key value */ +#define KEY_BREAK 0x101 /* Not on PC KBD */ +#define KEY_DOWN 0x102 /* Down arrow key */ +#define KEY_UP 0x103 /* Up arrow key */ +#define KEY_LEFT 0x104 /* Left arrow key */ +#define KEY_RIGHT 0x105 /* Right arrow key */ +#define KEY_HOME 0x106 /* home key */ +#define KEY_BACKSPACE 0x107 /* not on pc */ +#define KEY_F0 0x108 /* function keys. space for */ +#define KEY_F(n) (KEY_F0+(n))/* 64 keys are reserved. */ +#define KEY_DL 0x148 /* delete line */ +#define KEY_IL 0x149 /* insert line */ +#define KEY_DC 0x14a /* delete character */ +#define KEY_IC 0x14b /* insert char or enter ins mode */ +#define KEY_EIC 0x14c /* exit insert char mode */ +#define KEY_CLEAR 0x14d /* clear screen */ +#define KEY_EOS 0x14e /* clear to end of screen */ +#define KEY_EOL 0x14f /* clear to end of line */ +#define KEY_SF 0x150 /* scroll 1 line forward */ +#define KEY_SR 0x151 /* scroll 1 line back (reverse) */ +#define KEY_NPAGE 0x152 /* next page */ +#define KEY_PPAGE 0x153 /* previous page */ +#define KEY_STAB 0x154 /* set tab */ +#define KEY_CTAB 0x155 /* clear tab */ +#define KEY_CATAB 0x156 /* clear all tabs */ +#define KEY_ENTER 0x157 /* enter or send (unreliable) */ +#define KEY_SRESET 0x158 /* soft/reset (partial/unreliable)*/ +#define KEY_RESET 0x159 /* reset/hard reset (unreliable) */ +#define KEY_PRINT 0x15a /* print/copy */ +#define KEY_LL 0x15b /* home down/bottom (lower left) */ +#define KEY_ABORT 0x15c /* abort/terminate key (any) */ +#define KEY_SHELP 0x15d /* short help */ +#define KEY_LHELP 0x15e /* long help */ +#define KEY_BTAB 0x15f /* Back tab key */ +#define KEY_BEG 0x160 /* beg(inning) key */ +#define KEY_CANCEL 0x161 /* cancel key */ +#define KEY_CLOSE 0x162 /* close key */ +#define KEY_COMMAND 0x163 /* cmd (command) key */ +#define KEY_COPY 0x164 /* copy key */ +#define KEY_CREATE 0x165 /* create key */ +#define KEY_END 0x166 /* end key */ +#define KEY_EXIT 0x167 /* exit key */ +#define KEY_FIND 0x168 /* find key */ +#define KEY_HELP 0x169 /* help key */ +#define KEY_MARK 0x16a /* mark key */ +#define KEY_MESSAGE 0x16b /* message key */ +#define KEY_MOVE 0x16c /* move key */ +#define KEY_NEXT 0x16d /* next object key */ +#define KEY_OPEN 0x16e /* open key */ +#define KEY_OPTIONS 0x16f /* options key */ +#define KEY_PREVIOUS 0x170 /* previous object key */ +#define KEY_REDO 0x171 /* redo key */ +#define KEY_REFERENCE 0x172 /* ref(erence) key */ +#define KEY_REFRESH 0x173 /* refresh key */ +#define KEY_REPLACE 0x174 /* replace key */ +#define KEY_RESTART 0x175 /* restart key */ +#define KEY_RESUME 0x176 /* resume key */ +#define KEY_SAVE 0x177 /* save key */ +#define KEY_SBEG 0x178 /* shifted beginning key */ +#define KEY_SCANCEL 0x179 /* shifted cancel key */ +#define KEY_SCOMMAND 0x17a /* shifted command key */ +#define KEY_SCOPY 0x17b /* shifted copy key */ +#define KEY_SCREATE 0x17c /* shifted create key */ +#define KEY_SDC 0x17d /* shifted delete char key */ +#define KEY_SDL 0x17e /* shifted delete line key */ +#define KEY_SELECT 0x17f /* select key */ +#define KEY_SEND 0x180 /* shifted end key */ +#define KEY_SEOL 0x181 /* shifted clear line key */ +#define KEY_SEXIT 0x182 /* shifted exit key */ +#define KEY_SFIND 0x183 /* shifted find key */ +#define KEY_SHOME 0x184 /* shifted home key */ +#define KEY_SIC 0x185 /* shifted input key */ +#define KEY_SLEFT 0x187 /* shifted left arrow key */ +#define KEY_SMESSAGE 0x188 /* shifted message key */ +#define KEY_SMOVE 0x189 /* shifted move key */ +#define KEY_SNEXT 0x18a /* shifted next key */ +#define KEY_SOPTIONS 0x18b /* shifted options key */ +#define KEY_SPREVIOUS 0x18c /* shifted prev key */ +#define KEY_SPRINT 0x18d /* shifted print key */ +#define KEY_SREDO 0x18e /* shifted redo key */ +#define KEY_SREPLACE 0x18f /* shifted replace key */ +#define KEY_SRIGHT 0x190 /* shifted right arrow */ +#define KEY_SRSUME 0x191 /* shifted resume key */ +#define KEY_SSAVE 0x192 /* shifted save key */ +#define KEY_SSUSPEND 0x193 /* shifted suspend key */ +#define KEY_SUNDO 0x194 /* shifted undo key */ +#define KEY_SUSPEND 0x195 /* suspend key */ +#define KEY_UNDO 0x196 /* undo key */ + +/* PDCurses specific key definitions */ + +#define ALT_0 0x197 /* Alt-0 PC only */ +#define ALT_1 0x198 /* Alt-1 PC only */ +#define ALT_2 0x199 /* Alt-2 PC only */ +#define ALT_3 0x19a /* Alt-3 PC only */ +#define ALT_4 0x19b /* Alt-4 PC only */ +#define ALT_5 0x19c /* Alt-5 PC only */ +#define ALT_6 0x19d /* Alt-6 PC only */ +#define ALT_7 0x19e /* Alt-7 PC only */ +#define ALT_8 0x19f /* Alt-8 PC only */ +#define ALT_9 0x1a0 /* Alt-9 PC only */ +#define ALT_A 0x1a1 /* Alt-A PC only */ +#define ALT_B 0x1a2 /* Alt-B PC only */ +#define ALT_C 0x1a3 /* Alt-C PC only */ +#define ALT_D 0x1a4 /* Alt-D PC only */ +#define ALT_E 0x1a5 /* Alt-E PC only */ +#define ALT_F 0x1a6 /* Alt-F PC only */ +#define ALT_G 0x1a7 /* Alt-G PC only */ +#define ALT_H 0x1a8 /* Alt-H PC only */ +#define ALT_I 0x1a9 /* Alt-I PC only */ +#define ALT_J 0x1aa /* Alt-J PC only */ +#define ALT_K 0x1ab /* Alt-K PC only */ +#define ALT_L 0x1ac /* Alt-L PC only */ +#define ALT_M 0x1ad /* Alt-M PC only */ +#define ALT_N 0x1ae /* Alt-N PC only */ +#define ALT_O 0x1af /* Alt-O PC only */ +#define ALT_P 0x1b0 /* Alt-P PC only */ +#define ALT_Q 0x1b1 /* Alt-Q PC only */ +#define ALT_R 0x1b2 /* Alt-R PC only */ +#define ALT_S 0x1b3 /* Alt-S PC only */ +#define ALT_T 0x1b4 /* Alt-T PC only */ +#define ALT_U 0x1b5 /* Alt-U PC only */ +#define ALT_V 0x1b6 /* Alt-V PC only */ +#define ALT_W 0x1b7 /* Alt-W PC only */ +#define ALT_X 0x1b8 /* Alt-X PC only */ +#define ALT_Y 0x1b9 /* Alt-Y PC only */ +#define ALT_Z 0x1ba /* Alt-Z PC only */ +#define CTL_LEFT 0x1bb /* Control-Left-Arrow PC only */ +#define CTL_RIGHT 0x1bc /* Control-Right-Arrow PC only */ +#define CTL_PGUP 0x1bd /* Control-PgUp PC only */ +#define CTL_PGDN 0x1be /* Control-PgDn PC only */ +#define CTL_HOME 0x1bf /* Control-Home PC only */ +#define CTL_END 0x1c0 /* Control-End PC only */ + +#if defined(FLEXOS) +# define KEY_MOUSE 0x1c1 /* "mouse" key */ +# define KEY_A1 KEY_HOME/* upper left on Virtual keypad */ +# define KEY_A2 KEY_UP /* upper middle on Virt. keypad */ +# define KEY_A3 KEY_PPAGE/* upper right on Vir. keypad */ +# define KEY_B1 KEY_LEFT/* middle left on Virt. keypad */ +# define KEY_B2 0x00 /* center on Virt. keypad */ +# define KEY_B3 KEY_RIGHT/* middle right on Vir. keypad */ +# define KEY_C1 KEY_LL /* lower left on Virt. keypad */ +# define KEY_C2 KEY_DOWN /* lower middle on Virt. keypad */ +# define KEY_C3 KEY_NPAGE /* lower right on Vir. keypad */ +# define KEY_MAX KEY_MOUSE /* Maximum curses key */ +#endif + + +#if defined(DOS) || defined (OS2) || defined(XCURSES) || defined(WIN32) +# define KEY_A1 0x1c1 /* upper left on Virtual keypad */ +# define KEY_A2 0x1c2 /* upper middle on Virt. keypad */ +# define KEY_A3 0x1c3 /* upper right on Vir. keypad */ +# define KEY_B1 0x1c4 /* middle left on Virt. keypad */ +# define KEY_B2 0x1c5 /* center on Virt. keypad */ +# define KEY_B3 0x1c6 /* middle right on Vir. keypad */ +# define KEY_C1 0x1c7 /* lower left on Virt. keypad */ +# define KEY_C2 0x1c8 /* lower middle on Virt. keypad */ +# define KEY_C3 0x1c9 /* lower right on Vir. keypad */ +# define PADSLASH 0x1ca /* slash on keypad */ +# define PADENTER 0x1cb /* enter on keypad */ +# define CTL_PADENTER 0x1cc /* ctl-enter on keypad */ +# define ALT_PADENTER 0x1cd /* alt-enter on keypad */ +# define PADSTOP 0x1ce /* stop on keypad */ +# define PADSTAR 0x1cf /* star on keypad */ +# define PADMINUS 0x1d0 /* minus on keypad */ +# define PADPLUS 0x1d1 /* plus on keypad */ +# define CTL_PADSTOP 0x1d2 /* ctl-stop on keypad */ +# define CTL_PADCENTER 0x1d3 /* ctl-enter on keypad */ +# define CTL_PADPLUS 0x1d4 /* ctl-plus on keypad */ +# define CTL_PADMINUS 0x1d5 /* ctl-minus on keypad */ +# define CTL_PADSLASH 0x1d6 /* ctl-slash on keypad */ +# define CTL_PADSTAR 0x1d7 /* ctl-star on keypad */ +# define ALT_PADPLUS 0x1d8 /* alt-plus on keypad */ +# define ALT_PADMINUS 0x1d9 /* alt-minus on keypad */ +# define ALT_PADSLASH 0x1da /* alt-slash on keypad */ +# define ALT_PADSTAR 0x1db /* alt-star on keypad */ +# define ALT_PADSTOP 0x1dc /* alt-star on keypad */ +# define CTL_INS 0x1dd /* ctl-insert */ +# define ALT_DEL 0x1de /* alt-delete */ +# define ALT_INS 0x1df /* alt-insert */ +# define CTL_UP 0x1e0 /* ctl-up arrow */ +# define CTL_DOWN 0x1e1 /* ctl-down arrow */ +# define CTL_TAB 0x1e2 /* ctl-tab */ +# define ALT_TAB 0x1e3 /* alt-tab */ +# define ALT_MINUS 0x1e4 /* alt-minus */ +# define ALT_EQUAL 0x1e5 /* alt-equal */ +# define ALT_HOME 0x1e6 /* alt-home */ +# define ALT_PGUP 0x1e7 /* alt-pgup */ +# define ALT_PGDN 0x1e8 /* alt-pgdn */ +# define ALT_END 0x1e9 /* alt-end */ +# define ALT_UP 0x1ea /* alt-up arrow */ +# define ALT_DOWN 0x1eb /* alt-down arrow */ +# define ALT_RIGHT 0x1ec /* alt-right arrow */ +# define ALT_LEFT 0x1ed /* alt-left arrow */ +# define ALT_ENTER 0x1ee /* alt-enter */ +# define ALT_ESC 0x1ef /* alt-escape */ +# define ALT_BQUOTE 0x1f0 /* alt-back quote */ +# define ALT_LBRACKET 0x1f1 /* alt-left bracket */ +# define ALT_RBRACKET 0x1f2 /* alt-right bracket */ +# define ALT_SEMICOLON 0x1f3 /* alt-semi-colon */ +# define ALT_FQUOTE 0x1f4 /* alt-forward quote */ +# define ALT_COMMA 0x1f5 /* alt-comma */ +# define ALT_STOP 0x1f6 /* alt-stop */ +# define ALT_FSLASH 0x1f7 /* alt-forward slash */ +# define ALT_BKSP 0x1f8 /* alt-backspace */ +# define CTL_BKSP 0x1f9 /* ctl-backspace */ +# define PAD0 0x1fa /* ctl-keypad 0 */ +# define CTL_PAD0 0x1fb /* ctl-keypad 0 */ +# define CTL_PAD1 0x1fc /* ctl-keypad 1 */ +# define CTL_PAD2 0x1fd /* ctl-keypad 2 */ +# define CTL_PAD3 0x1fe /* ctl-keypad 3 */ +# define CTL_PAD4 0x1ff /* ctl-keypad 4 */ +# define CTL_PAD5 0x200 /* ctl-keypad 5 */ +# define CTL_PAD6 0x201 /* ctl-keypad 6 */ +# define CTL_PAD7 0x202 /* ctl-keypad 7 */ +# define CTL_PAD8 0x203 /* ctl-keypad 8 */ +# define CTL_PAD9 0x204 /* ctl-keypad 9 */ +# define ALT_PAD0 0x205 /* ctl-keypad 0 */ +# define ALT_PAD1 0x206 /* ctl-keypad 1 */ +# define ALT_PAD2 0x207 /* ctl-keypad 2 */ +# define ALT_PAD3 0x208 /* ctl-keypad 3 */ +# define ALT_PAD4 0x209 /* ctl-keypad 4 */ +# define ALT_PAD5 0x20a /* ctl-keypad 5 */ +# define ALT_PAD6 0x20b /* ctl-keypad 6 */ +# define ALT_PAD7 0x20c /* ctl-keypad 7 */ +# define ALT_PAD8 0x20d /* ctl-keypad 8 */ +# define ALT_PAD9 0x20e /* ctl-keypad 9 */ +# define CTL_DEL 0x20f /* clt-delete */ +# define ALT_BSLASH 0x210 /* alt-back slash */ +# define CTL_ENTER 0x211 /* ctl-enter */ +# define SHF_PADENTER 0x212 /* shift-enter on keypad */ +# define SHF_PADSLASH 0x213 /* shift-slash on keypad */ +# define SHF_PADSTAR 0x214 /* shift-star on keypad */ +# define SHF_PADPLUS 0x215 /* shift-plus on keypad */ +# define SHF_PADMINUS 0x216 /* shift-minus on keypad */ +# define SHF_UP 0x217 /* shift-up on keypad */ +# define SHF_DOWN 0x218 /* shift-down on keypad */ +# define SHF_IC 0x219 /* shift-insert on keypad */ +# define SHF_DC 0x21a /* shift-delete on keypad */ +# define KEY_MOUSE 0x21b /* "mouse" key */ +# define KEY_SHIFT_L 0x21c /* Left-shift */ +# define KEY_SHIFT_R 0x21d /* Right-shift */ +# define KEY_CONTROL_L 0x21e /* Left-control */ +# define KEY_CONTROL_R 0x21f /* Right-control */ +# define KEY_ALT_L 0x220 /* Left-alt */ +# define KEY_ALT_R 0x221 /* Right-alt */ +# define KEY_RESIZE 0x222 /* Window resize */ +# define KEY_MAX 0x222 /* Maximum curses key */ +#endif + +/*---------------------------------------------------------------------- +* PDCurses function declarations +*/ +#ifdef HAVE_PROTO +int PDC_CDECL addchnstr( chtype *, int ); +int PDC_CDECL baudrate( void ); +int PDC_CDECL beep( void ); +int PDC_CDECL border( chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype ); +int PDC_CDECL can_change_color ( void ); +int PDC_CDECL clearok( WINDOW*, bool ); +int PDC_CDECL color_content( short, short*, short*, short* ); +int PDC_CDECL copywin( WINDOW*, WINDOW*, int, int, int, int, int, int, int ); +int PDC_CDECL curs_set( int ); +int PDC_CDECL def_prog_mode( void ); +int PDC_CDECL def_shell_mode( void ); +int PDC_CDECL delay_output( int ); +int PDC_CDECL delwin( WINDOW* ); +WINDOW* PDC_CDECL derwin( WINDOW*, int, int, int, int ); +int PDC_CDECL doupdate( void ); +WINDOW* PDC_CDECL dupwin( WINDOW* ); +int PDC_CDECL endwin( void ); +int PDC_CDECL erase( void ); +char PDC_CDECL erasechar( void ); +int PDC_CDECL flash( void ); +int PDC_CDECL flushinp( void ); +int PDC_CDECL getsyx( int*, int* ); +int PDC_CDECL halfdelay( int ); +bool PDC_CDECL has_colors( void ); +int PDC_CDECL hline( chtype, int ); +int PDC_CDECL immedok( WINDOW*, bool ); +int PDC_CDECL inchnstr( chtype *, int ); +int PDC_CDECL init_color( short, short, short, short ); +int PDC_CDECL init_pair( short, short, short ); +WINDOW* PDC_CDECL initscr( void ); +#ifdef XCURSES +WINDOW* PDC_CDECL Xinitscr( int, char ** ); +#endif +int PDC_CDECL intrflush( WINDOW*, bool ); +int PDC_CDECL is_linetouched(WINDOW *,int); +int PDC_CDECL is_wintouched(WINDOW *); +char* PDC_CDECL keyname( int ); +char PDC_CDECL killchar( void ); +char* PDC_CDECL longname( void ); +int PDC_CDECL meta( WINDOW*, bool ); +int PDC_CDECL mvcur( int, int, int, int ); +int PDC_CDECL mvderwin( WINDOW*, int, int ); +#ifdef HAVE_STDARG_H +int PDC_CDECL mvprintw( int, int, char*,... ); +int PDC_CDECL mvscanw( int, int, char*,... ); +#endif +int PDC_CDECL mvwaddnstr( WINDOW*,int,int,char*,int ); +int PDC_CDECL mvwin( WINDOW*, int, int ); +int PDC_CDECL mvwinsertln( WINDOW*, int, int ); +#ifdef HAVE_STDARG_H +int PDC_CDECL mvwprintw( WINDOW*, int, int, char*,... ); +int PDC_CDECL mvwscanw( WINDOW*, int, int, char*,... ); +#endif +WINDOW* PDC_CDECL newpad( int, int ); +SCREEN* PDC_CDECL newterm( char*, FILE*, FILE* ); +WINDOW* PDC_CDECL newwin( int, int, int, int ); +int PDC_CDECL noraw( void ); +int PDC_CDECL notimeout( WINDOW *, bool ); +int PDC_CDECL overlay( WINDOW*, WINDOW* ); +int PDC_CDECL overwrite( WINDOW*, WINDOW* ); +int PDC_CDECL pair_content( int, short*, short* ); +int PDC_CDECL pnoutrefresh( WINDOW*, int, int, int, int, int, int ); +int PDC_CDECL prefresh( WINDOW*, int, int, int, int, int, int ); +#ifdef HAVE_STDARG_H +int PDC_CDECL printw( char*,... ); +int PDC_CDECL scanw( char*,... ); +#endif +int PDC_CDECL raw( void ); +int PDC_CDECL refresh( void ); +int PDC_CDECL reset_prog_mode( void ); +int PDC_CDECL reset_shell_mode( void ); +int PDC_CDECL resetty( void ); +int PDC_CDECL ripoffline(int, int (*)(WINDOW *, int)); +int PDC_CDECL savetty( void ); +int PDC_CDECL sb_init(void); +int PDC_CDECL sb_set_horz(int, int, int); +int PDC_CDECL sb_set_vert(int, int, int); +int PDC_CDECL sb_get_horz(int *, int *, int *); +int PDC_CDECL sb_get_vert(int *, int *, int *); +int PDC_CDECL sb_refresh(void); +int PDC_CDECL scroll( WINDOW* ); +SCREEN* PDC_CDECL set_term( SCREEN* ); +int PDC_CDECL setsyx( int, int ); +int PDC_CDECL start_color( void ); +int PDC_CDECL slk_init(int); +int PDC_CDECL slk_set(int, char *, int); +int PDC_CDECL slk_refresh(void); +int PDC_CDECL slk_noutrefresh(void); +char* PDC_CDECL slk_label(int); +int PDC_CDECL slk_clear(void); +int PDC_CDECL slk_restore(void); +int PDC_CDECL slk_touch(void); +int PDC_CDECL slk_attron(attr_t); +int PDC_CDECL slk_attrset(attr_t); +int PDC_CDECL slk_attroff(attr_t); +WINDOW* PDC_CDECL subpad( WINDOW*, int, int, int, int ); +WINDOW* PDC_CDECL subwin( WINDOW*, int, int, int, int ); +int PDC_CDECL syncok(WINDOW*, bool); +attr_t PDC_CDECL termattrs( void ); +char* PDC_CDECL termname( void ); +int PDC_CDECL touchline( WINDOW*, int ,int ); +int PDC_CDECL touchwin( WINDOW* ); +#if !defined (CURSES_LIBRARY) +void PDC_CDECL traceoff( void ); +void PDC_CDECL traceon( void ); +#endif +int PDC_CDECL typeahead( int ); +char* PDC_CDECL unctrl( chtype ); +int PDC_CDECL vline( chtype, int ); +int PDC_CDECL waddchnstr( WINDOW*, chtype*, int ); +int PDC_CDECL waddnstr( WINDOW*, char*, int ); +int PDC_CDECL waddstr( WINDOW*, char* ); +int PDC_CDECL wattroff( WINDOW*, attr_t ); +int PDC_CDECL wattron( WINDOW*, attr_t ); +int PDC_CDECL wattrset( WINDOW*, attr_t ); +int PDC_CDECL wbkgd(WINDOW*, chtype); +void PDC_CDECL wbkgdset(WINDOW*, chtype); +int PDC_CDECL wborder( WINDOW*, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype ); +int PDC_CDECL wclear( WINDOW* ); +int PDC_CDECL wclrtobot( WINDOW* ); +int PDC_CDECL wclrtoeol( WINDOW* ); +void PDC_CDECL wcursyncup(WINDOW*); +int PDC_CDECL wdelch( WINDOW* ); +int PDC_CDECL wdeleteln( WINDOW* ); +int PDC_CDECL werase( WINDOW* ); +int PDC_CDECL wgetch( WINDOW* ); +int PDC_CDECL wgetnstr( WINDOW*, char*, int ); +int PDC_CDECL wgetstr( WINDOW*, char* ); +int PDC_CDECL whline( WINDOW*, chtype, int ); +int PDC_CDECL winchnstr( WINDOW*, chtype*, int ); +int PDC_CDECL winnstr( WINDOW*, char*, int ); +int PDC_CDECL winsch( WINDOW*, chtype ); +int PDC_CDECL winsdelln( WINDOW*, int ); +int PDC_CDECL winsertln( WINDOW* ); +int PDC_CDECL winsnstr( WINDOW*, char*, int ); +int PDC_CDECL wmove( WINDOW*, int, int ); +int PDC_CDECL wnoutrefresh( WINDOW* ); +char PDC_CDECL wordchar( void ); +#ifdef HAVE_STDARG_H +int PDC_CDECL wprintw( WINDOW*, char*,... ); +int PDC_CDECL wscanw( WINDOW*, char*,... ); +#endif +int PDC_CDECL wredrawln( WINDOW*, int ,int ); +int PDC_CDECL wrefresh( WINDOW* ); +int PDC_CDECL wscrl( WINDOW*, int ); +int PDC_CDECL wsetscrreg( WINDOW*, int, int ); +int PDC_CDECL wtimeout( WINDOW *, int ); +int PDC_CDECL wtouchln(WINDOW *, int, int, int); +void PDC_CDECL wsyncdown(WINDOW*); +void PDC_CDECL wsyncup(WINDOW*); +int PDC_CDECL wvline( WINDOW*, chtype, int ); + +#ifdef PDCURSES +int PDC_CDECL raw_output( bool ); +int PDC_CDECL resize_term( int, int ); +WINDOW* PDC_CDECL resize_window( WINDOW*, int, int ); +#endif + +#ifdef OBSOLETE_OR_TBD +char PDC_CDECL breakchar( /* void */ ); +int PDC_CDECL cursoff( /* void */ ); +int PDC_CDECL curson( /* void */ ); +int PDC_CDECL gettmode( /* void */ ); +int PDC_CDECL mvaddrawch( /* int, int, chtype */ ); +int PDC_CDECL mvaddrawstr( /* int, int, char* */ ); +int PDC_CDECL mvwinsrawch( /* WINDOW*, int, int, chtype */ ); +int PDC_CDECL mvinsrawch( /* int, int, chtype */ ); +int PDC_CDECL saveoldterm( /* void */ ); +int PDC_CDECL tabsize( /* int */ ); +int PDC_CDECL waddrawstr( /* WINDOW*, char* */ ); +int PDC_CDECL wtabsize( /* WINDOW*, int */ ); +int PDC_CDECL win_print( /* WINDOW*, int */ ); +#endif + +#ifdef XCURSES +void XCursesExit( void ); +int nocbreak( void ); +int cbreak( void ); +int nocrmode( void ); +int crmode( void ); +int noecho( void ); +int echo( void ); +int nodelay( WINDOW *,bool ); +#endif + +int PDC_CDECL mouse_set( unsigned long ); +int PDC_CDECL mouse_on( unsigned long ); +int PDC_CDECL mouse_off( unsigned long ); +int PDC_CDECL request_mouse_pos( void ); +int PDC_CDECL map_button( unsigned long ); +void PDC_CDECL wmouse_position( WINDOW *, int *, int * ); +unsigned long PDC_CDECL getmouse( void ); +unsigned long PDC_CDECL getbmap( void ); + +/* +* Keep the compiler happy with our macros below... +*/ +int PDC_CDECL PDC_chadd( WINDOW*, chtype, bool, bool ); +int PDC_CDECL PDC_chins( WINDOW*, chtype, bool ); +int PDC_CDECL PDC_ungetch( int ); + +void PDC_CDECL PDC_set_title( char * ); + +int PDC_CDECL PDC_getclipboard( char **, long * ); +int PDC_CDECL PDC_setclipboard( char *, long ); + +int PDC_CDECL PDC_get_input_fd( void ); +unsigned long PDC_CDECL PDC_get_key_modifiers( void ); + +#else + +int PDC_CDECL addchnstr( /* chtype *, int */ ); +int PDC_CDECL baudrate( /* void */ ); +int PDC_CDECL beep( /* void */ ); +int PDC_CDECL border( /* chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype */ ); +int PDC_CDECL can_change_color ( /* void */ ); +int PDC_CDECL clearok( /* WINDOW*, bool */ ); +int PDC_CDECL color_content( /* int, short*, short*, short* */ ); +int PDC_CDECL copywin( /* WINDOW*, WINDOW*, int, int, int, int, int, int, int */ ); +int PDC_CDECL curs_set( /* int */ ); +int PDC_CDECL def_prog_mode( /* void */ ); +int PDC_CDECL def_shell_mode( /* void */ ); +int PDC_CDECL delay_output( /* int */ ); +int PDC_CDECL delwin( /* WINDOW* */ ); +WINDOW* PDC_CDECL derwin( /* WINDOW*, int, int, int, int */ ); +int PDC_CDECL doupdate( /* void */ ); +WINDOW* PDC_CDECL dupwin( /* WINDOW* */ ); +int PDC_CDECL endwin( /* void */ ); +int PDC_CDECL erase( /* void */ ); +char PDC_CDECL erasechar( /* void */ ); +int PDC_CDECL flash( /* void */ ); +int PDC_CDECL flushinp( /* void */ ); +int PDC_CDECL getsyx( /* int*, int* */ ); +int PDC_CDECL halfdelay( /* int */ ); +bool PDC_CDECL has_colors( /* void */ ); +int PDC_CDECL hline( /* chtype, int */ ); +int PDC_CDECL immedok( /* WINDOW*, bool */ ); +int PDC_CDECL inchnstr( /* chtype *, int */ ); +int PDC_CDECL init_color( /* short, short, short, short */ ); +int PDC_CDECL init_pair( /* short, short, short */ ); +WINDOW* PDC_CDECL initscr( /* void */ ); +#ifdef XCURSES +WINDOW* PDC_CDECL Xinitscr( /* int, char ** */ ); +#endif +int PDC_CDECL intrflush( /* WINDOW*, bool */ ); +int PDC_CDECL is_linetouched( /*WINDOW *,int*/ ); +int PDC_CDECL is_wintouched( /*WINDOW **/ ); +char* PDC_CDECL keyname( /* int */ ); +char PDC_CDECL killchar( /* void */ ); +char* PDC_CDECL longname( /* void */ ); +int PDC_CDECL meta( /* WINDOW*, bool */ ); +int PDC_CDECL mvcur( /* int, int, int, int */ ); +int PDC_CDECL mvderwin( /* WINDOW*, int, int */ ); +int PDC_CDECL mvprintw( /* int, int, char*,... */ ); +int PDC_CDECL mvscanw( /* int, int, char*,... */ ); +int PDC_CDECL mvwaddnstr(/* WINDOW*,int,int,char*,int */ ); +int PDC_CDECL mvwin( /* WINDOW*, int, int */ ); +int PDC_CDECL mvwinsertln( /* WINDOW*, int, int */ ); +int PDC_CDECL mvwprintw( /* WINDOW*, int, int, char*,... */ ); +int PDC_CDECL mvwscanw( /* WINDOW*, int, int, char*,... */ ); +WINDOW* PDC_CDECL newpad( /* int, int */ ); +SCREEN* PDC_CDECL newterm( /* char*, FILE*, FILE* */ ); +WINDOW* PDC_CDECL newwin( /* int, int, int, int */ ); +int PDC_CDECL noraw( /* void */ ); +int PDC_CDECL notimeout( /* WINDOW *, bool */ ); +int PDC_CDECL overlay( /* WINDOW*, WINDOW* */ ); +int PDC_CDECL overwrite( /* WINDOW*, WINDOW* */ ); +int PDC_CDECL pair_content( /* int, short*, short* */ ); +int PDC_CDECL pnoutrefresh( /* WINDOW*, int, int, int, int, int, int */ ); +int PDC_CDECL prefresh( /* WINDOW*, int, int, int, int, int, int */ ); +int PDC_CDECL printw( /* char*,... */ ); +int PDC_CDECL raw( /* void */ ); +int PDC_CDECL refresh( /* void */ ); +int PDC_CDECL reset_prog_mode( /* void */ ); +int PDC_CDECL reset_shell_mode( /* void */ ); +int PDC_CDECL resetty( /* void */ ); +int PDC_CDECL ripoffline( /* int, int (*)(WINDOW *, int) */); +int PDC_CDECL savetty( /* void */ ); +int PDC_CDECL sb_init( /* void */ ); +int PDC_CDECL sb_set_horz( /* int, int, int */ ); +int PDC_CDECL sb_set_vert( /* int, int, int */ ); +int PDC_CDECL sb_get_horz( /* int *, int *, int * */ ); +int PDC_CDECL sb_get_vert( /* int *, int *, int * */ ); +int PDC_CDECL sb_refresh( /* void */ ); +int PDC_CDECL scanw( /* char*,... */ ); +int PDC_CDECL scroll( /* WINDOW* */ ); +int PDC_CDECL setsyx( /* int, int */ ); +SCREEN* PDC_CDECL set_term( /* SCREEN* */ ); +int PDC_CDECL slk_init(/* int */); +int PDC_CDECL slk_set(/* int, char *, int */); +int PDC_CDECL slk_refresh(/* void */); +int PDC_CDECL slk_noutrefresh(/* void */); +char* PDC_CDECL slk_label(/* int */); +int PDC_CDECL slk_clear(/* void */); +int PDC_CDECL slk_restore(/* void */); +int PDC_CDECL slk_touch(/* void */); +int PDC_CDECL slk_attron(/* attr_t */); +int PDC_CDECL slk_attrset(/* attr_t */); +int PDC_CDECL slk_attroff(/* attr_t */); +int PDC_CDECL start_color( /* void */ ); +WINDOW* PDC_CDECL subpad( /* WINDOW*, int, int, int, int */ ); +WINDOW* PDC_CDECL subwin( /* WINDOW*, int, int, int, int */ ); +int PDC_CDECL syncok(/* WINDOW*, bool */); +attr_t PDC_CDECL termattrs( /* void */ ); +char* PDC_CDECL termname( /* void */ ); +int PDC_CDECL touchline( /* WINDOW*, int ,int */ ); +int PDC_CDECL touchwin( /* WINDOW* */ ); +#if !defined (CURSES_LIBRARY) +void PDC_CDECL traceoff(/* void */); +void PDC_CDECL traceon(/* void */); +#endif +int PDC_CDECL typeahead( /* int */ ); +char* PDC_CDECL unctrl( /* chtype */ ); +int PDC_CDECL vline( /* chtype, int */ ); +int PDC_CDECL waddchnstr( /* WINDOW*, chtype*, int */ ); +int PDC_CDECL waddnstr( /* WINDOW*, char*, int */ ); +int PDC_CDECL waddstr( /* WINDOW*, char* */ ); +int PDC_CDECL wattroff( /* WINDOW*, attr_t */ ); +int PDC_CDECL wattron( /* WINDOW*, attr_t */ ); +int PDC_CDECL wattrset( /* WINDOW*, attr_t */ ); +int PDC_CDECL wbkgd( /*WINDOW*, chtype*/ ); +void PDC_CDECL wbkgdset( /*WINDOW*, chtype*/ ); +int PDC_CDECL wborder( /* WINDOW*, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype */ ); +int PDC_CDECL wclear( /* WINDOW* */ ); +int PDC_CDECL wclrtobot( /* WINDOW* */ ); +int PDC_CDECL wclrtoeol( /* WINDOW* */ ); +void PDC_CDECL wcursyncup(/* WINDOW* */); +int PDC_CDECL wdelch( /* WINDOW* */ ); +int PDC_CDECL wdeleteln( /* WINDOW* */ ); +int PDC_CDECL werase( /* WINDOW* */ ); +int PDC_CDECL wgetch( /* WINDOW* */ ); +int PDC_CDECL wgetnstr( /* WINDOW*, char*, int */ ); +int PDC_CDECL wgetstr( /* WINDOW*, char* */ ); +int PDC_CDECL whline( /* WINDOW*, chtype, int */ ); +int PDC_CDECL winchnstr( /* WINDOW*, chtype*, int */ ); +int PDC_CDECL winnstr( /* WINDOW*, char*, int */ ); +int PDC_CDECL winsch( /* WINDOW*, chtype */ ); +int PDC_CDECL winsdelln( /* WINDOW*, int */ ); +int PDC_CDECL winsertln( /* WINDOW* */ ); +int PDC_CDECL winsnstr( /* WINDOW*, char*, int */ ); +int PDC_CDECL wmove( /* WINDOW*, int, int */ ); +int PDC_CDECL wnoutrefresh( /* WINDOW* */ ); +char PDC_CDECL wordchar( /* void */ ); +int PDC_CDECL wprintw( /* WINDOW*, char*,... */ ); +int PDC_CDECL wredrawln( /* WINDOW*, int ,int */ ); +int PDC_CDECL wrefresh( /* WINDOW* */ ); +int PDC_CDECL wscanw( /* WINDOW*, char*,... */ ); +int PDC_CDECL wscrl( /* WINDOW*, int */ ); +int PDC_CDECL wsetscrreg( /* WINDOW*, int, int */ ); +int PDC_CDECL wtimeout( /* WINDOW *, int */ ); +int PDC_CDECL wtouchln( /*WINDOW *, int, int, int*/ ); +void PDC_CDECL wsyncdown(/* WINDOW* */); +void PDC_CDECL wsyncup(/* WINDOW* */); +int PDC_CDECL wvline( /* WINDOW*, chtype, int */ ); + +#ifdef PDCURSES +int PDC_CDECL raw_output( /* bool */ ); +int PDC_CDECL resize_term( /* int, int */ ); +WINDOW* PDC_CDECL resize_window( /* WINDOW*, int, int */ ); +#endif + +#ifdef OBSOLETE_OR_TBD +char PDC_CDECL breakchar( /* void */ ); +int PDC_CDECL cursoff( /* void */ ); +int PDC_CDECL curson( /* void */ ); +int PDC_CDECL gettmode( /* void */ ); +int PDC_CDECL mvaddrawch( /* int, int, chtype */ ); +int PDC_CDECL mvaddrawstr( /* int, int, char* */ ); +int PDC_CDECL mvwinsrawch( /* WINDOW*, int, int, chtype */ ); +int PDC_CDECL mvinsrawch( /* int, int, chtype */ ); +int PDC_CDECL saveoldterm( /* void */ ); +int PDC_CDECL tabsize( /* int */ ); +int PDC_CDECL waddrawstr( /* WINDOW*, char* */ ); +int PDC_CDECL wtabsize( /* WINDOW*, int */ ); +int PDC_CDECL win_print( /* WINDOW*, int */ ); +#endif + +#ifdef XCURSES +void XCursesExit(/* void */); +int nocbreak( /* void */ ); +int cbreak( /* void */ ); +int nocrmode( /* void */ ); +int crmode( /* void */ ); +int noecho( /* void */ ); +int echo( /* void */ ); +int nodelay( /* WINDOW *,bool */ ); +#endif + +int PDC_CDECL mouse_set( /* long */ ); +int PDC_CDECL mouse_on( /* long */ ); +int PDC_CDECL mouse_off( /* long */ ); +int PDC_CDECL request_mouse_pos( /* void */ ); +int PDC_CDECL map_button( /* unsigned long */ ); +void PDC_CDECL wmouse_position( /* WINDOW *, int *, int * */ ); +unsigned long PDC_CDECL getmouse( /* void */ ); +unsigned long PDC_CDECL getbmap( /* void */ ); + +/* +* Keep the compiler happy with our macros below... +*/ +int PDC_CDECL PDC_chadd( /* WINDOW*, chtype, bool, bool */ ); +int PDC_CDECL PDC_chins( /* WINDOW*, chtype, bool */ ); +int PDC_CDECL PDC_ungetch( /* int */ ); + +void PDC_CDECL PDC_set_title( /* char * */ ); +int PDC_CDECL PDC_getclipboard( /* char **, long * */ ); +int PDC_CDECL PDC_setclipboard( /* char *, long */ ); + +int PDC_CDECL PDC_get_input_fd( /* void */ ); +unsigned long PDC_CDECL PDC_get_key_modifiers( /* void */ ); + +#endif + + +#ifndef max +# define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif +#ifndef min +# define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +/* +* Functions defined as macros +*/ + +#define addch( c ) waddch( stdscr, c ) +#define addchstr( c ) addchnstr( c, -1 ) +#define addstr(str) waddstr( stdscr, str ) +#define addnstr(str, n) waddnstr( stdscr, str, n ) +#define attroff(attr) wattroff( stdscr, attr ) +#define attron(attr) wattron( stdscr, attr ) +#define attrset(attr) wattrset( stdscr, attr ) +#define bkgd(c) wbkgd(stdscr,c) +#define bkgdset(c) wbkgdset(stdscr,c) +#define border(ls,rs,ts,bs,tl,tr,bl,br) wborder(stdscr,ls,rs,ts,bs,tl,tr,bl,br) +#define box( w, v, h ) wborder( w, v, v, h, h, 0, 0, 0, 0 ) +#define clear() wclear( stdscr ) +#define clrtobot() wclrtobot( stdscr ) +#define clrtoeol() wclrtoeol( stdscr ) +#define delch() wdelch( stdscr ) +#define deleteln() wdeleteln( stdscr ) +#define derwin(w,nl,nc,by,bx) subwin((w),(nl),(nc),(by+(w)->_begy),(bx+(w)->_begx)) +#define draino(ms) delay_output(ms) +#define echochar(c) (addch((chtype)c)==ERR?ERR:refresh()) +#define erase() werase( stdscr ) +#define fixterm() reset_prog_mode() +#define getbegx(w) (w)->_begx +#define getbegy(w) (w)->_begy +#define getbegyx(w,y,x) ( y = (w)->_begy, x = (w)->_begx ) +#define getch() wgetch(stdscr) +#define getmaxx(w) (w)->_maxx +#define getmaxy(w) (w)->_maxy +#define getmaxyx(w,y,x) ( y = (w)->_maxy, x = (w)->_maxx ) +#define getparx(w) (w)->_parx +#define getpary(w) (w)->_pary +#define getparyx(w,y,x) ( y = (w)->_pary, x = (w)->_parx ) +#define getstr(str) wgetstr( stdscr, str ) +#define getnstr(str) wgetnstr( stdscr, str, num ) +#define getyx(w,y,x) ( y = (w)->_cury, x = (w)->_curx ) +#define has_colors() ((SP->mono) ? FALSE : TRUE) +#define idcok(w,flag) OK +#define idlok(w,flag) OK +#define inch() (stdscr->_y[stdscr->_cury][stdscr->_curx]) +#define inchstr( c ) inchnstr( c, stdscr->_maxx-stdscr->_curx ) +#define innstr(str,n) winnstr(stdscr,(str),(n)) +#define insch( c ) winsch( stdscr, c ) +#define insdelln(n) winsdelln(stdscr,n) +#define insertln() winsertln( stdscr ) +#define insnstr(s,n) winsnstr(stdscr,s,n) +#define insstr(s) winsnstr(stdscr,s,(-1)) +#define instr(str) winnstr(stdscr,(str),stdscr->_maxx) +#define isendwin() ((SP->alive) ? FALSE : TRUE) +#define is_termresized() (SP->resized) +#define keypad(w,flag) (w->_use_keypad = flag) +#define leaveok(w,flag) (w->_leaveit = flag) +#define move(y,x) wmove( stdscr, y, x ) +#define mvaddch(y,x,c) (move( y, x )==ERR?ERR:addch( c )) +#define mvaddchstr(y,x,c) (move( y, x )==ERR?ERR:addchnstr( c, -1 )) +#define mvaddchnstr(y,x,c,n) (move( y, x )==ERR?ERR:addchnstr( c, n )) +#define mvaddstr(y,x,str) (move( y, x )==ERR?ERR:addstr( str )) +#define mvaddnstr(y,x,str,n) (move( y, x )==ERR?ERR:addnstr( str, n )) +#define mvdelch(y,x) (move( y, x )==ERR?ERR:wdelch( stdscr )) +#define mvgetch(y,x) (move( y, x )==ERR?ERR:wgetch(stdscr)) +#define mvgetstr(y,x,str) (move( y, x )==ERR?ERR:wgetstr( stdscr, str )) +#define mvinch(y,x) (move( y, x )==ERR?ERR:(stdscr->_y[y][x])) +#define mvinchstr(y,x,c) (move( y, x )==ERR?ERR:inchnstr( c, stdscr->_maxx-stdscr->_curx )) +#define mvinchnstr(y,x,c,n) (move( y, x )==ERR?ERR:inchnstr( c, n )) +#define mvinsch(y,x,c) (move( y, x )==ERR?ERR:winsch( stdscr, c )) +#define mvinsnstr(y,x,s,n) (move( y, x )==ERR?ERR:winsnstr(stdscr,s,n)) +#define mvinsstr(y,x,s) (move( y, x )==ERR?ERR:winsnstr(stdscr,s,(-1))) +#define mvinstr(y,x,str) (move( y, x )==ERR?ERR:winnstr(stdscr,(str),stdscr->_maxx)) +#define mvinnstr(y,x,str,n) (move( y, x )==ERR?ERR:winnstr(stdscr,(str),(n))) +#define mvwaddch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddch( w, c )) +#define mvwaddchstr(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddchnstr( w, c, -1 )) +#define mvwaddchnstr(w,y,x,c,n) (wmove( w, y, x )==ERR?ERR:waddchnstr( w, c, n )) +#define mvwaddrawch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:waddrawch( w, c )) +#define mvwaddrawstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:waddrawstr( w, str )) +#define mvwaddstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:waddstr( w, str )) +#define mvwdelch(w,y,x) (wmove( w, y, x )==ERR?ERR:wdelch( w )) +#define mvwgetch(w,y,x) (wmove( w, y, x )==ERR?ERR:wgetch( w )) +#define mvwgetstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:wgetstr( w, str )) +#define mvwinch(w,y,x) (wmove( w, y, x )==ERR?ERR:((w)->_y[y][x])) +#define mvwinchstr(w,y,x,c) (wmove( w, y, x )==ERR?ERR:winchnstr( w, c, (w)->_maxx-(w)->_curx )) +#define mvwinchnstr(w,y,x,c,n) (wmove( w, y, x )==ERR?ERR:winchnstr( w, c, n )) +#define mvwinsch(w,y,x,c) (wmove( w, y, x )==ERR?ERR:winsch( w, c )) +#define mvwinstr(w,y,x,str) (wmove( w, y, x )==ERR?ERR:winnstr(w,str,(w)->_maxx)) +#define mvwinnstr(w,y,x,str,n) (wmove( w, y, x )==ERR?ERR:winnstr(w,str,n)) +#define mvwinsnstr(w,y,x,s,n) (wmove( w, y, x )==ERR?ERR:winsnstr(w,s,n)) +#define mvwinsstr(w,y,x,s) (wmove( w, y, x )==ERR?ERR:winsnstr(w,s,(-1))) +#define napms(ms) delay_output(ms) +#define nl() (SP->autocr = TRUE) +#define nonl() (SP->autocr = FALSE) +#define pechochar(w,c) (waddch(w,(chtype)c)==ERR?ERR:prefresh(w)) +#define redrawwin(w) wredrawln((w),0,(win)->_maxy) +#define refresh() wrefresh( stdscr ) +#define resetterm() reset_shell_mode() +#define saveterm() def_prog_mode() +#define scrl(n) wscrl(stdscr,n) +#define scroll(w) wscrl((w),1) +#define scrollok(w,flag) ((w)->_scroll = flag) +#define setscrreg(top, bot) wsetscrreg( stdscr, top, bot ) +#define standend() wattrset(stdscr, A_NORMAL) +#define standout() wattrset(stdscr, A_STANDOUT) +#define timeout(n) wtimeout( stdscr, n ) +#define touchline(w,y,n) wtouchln((w),(y),(n),TRUE) +#define touchwin(w) wtouchln((w),0,(w)->_maxy,TRUE) +#if defined (CURSES_LIBRARY) +# define traceoff() {trace_on = FALSE;} +# define traceon() {trace_on = TRUE;} +#endif +#define ungetch(ch) PDC_ungetch(ch) +#define untouchwin(w) wtouchln((w),0,((w)->_maxy),FALSE) +#define waddch(w, c) PDC_chadd( w, (chtype)c, (bool)!(SP->raw_out), TRUE ) +#define waddchstr(w, c) (waddchnstr( w, c, -1 )) +#define werase(w) (wmove((w),0,0), wclrtobot(w)) +#define wclear(w) ((w)->_clear = TRUE , werase(w)) +#define wechochar(w,c) (waddch(w,(chtype)c)==ERR?ERR:wrefresh(w)) +#define winch(w) ((w)->_y[(w)->_cury][(w)->_curx]) +#define winchstr(w, c) (winchnstr( w, c, (w)->_maxx-(w)->_curx ) ) +#define winsstr(w,str) winsnstr((w),(str),(-1)) +#define winstr(w,str) winnstr((w),str,(w)->_maxx) +#define wstandend(w) wattrset(w, A_NORMAL) +#define wstandout(w) wattrset(w, A_STANDOUT) + +#if !defined(UNIX) && !defined(XCURSES) +# define nocbreak() (SP->cbreak = FALSE) +# define cbreak() (SP->cbreak = TRUE) +# define nocrmode() (SP->cbreak = FALSE) +# define crmode() (SP->cbreak = TRUE) +# define noecho() (SP->echo = FALSE) +# define echo() (SP->echo = TRUE) +# define nodelay(w,flag) (w->_nodelay = flag) +#endif + +#if defined(PDCURSES) +# define addrawch( c ) waddrawch( stdscr, c ) +# define addrawstr(str) waddrawstr( stdscr, str ) +# define insrawch( c ) winsrawch( stdscr, c ) +# define waddrawch(w, c) PDC_chadd( w, (chtype)c, FALSE, TRUE ) +# define winsrawch(w, c) PDC_chins( w, (chtype)c, FALSE ) +# define PDC_save_key_modifiers(flag) (SP->save_key_modifiers = flag) +# define PDC_return_key_modifiers(flag) (SP->return_key_modifiers = flag) + +/* + * FYI: Need to document these functions... + */ +# define title(s,a) wtitle( stdscr, s, (chtype)a ) +# define titleofs(ofs) wtitleofs( stdscr, ofs ) +# define wtitle(w,s,a) (w->_title = s, w->_title_attr = (chtype)a) +# define wtitleofs(w,ofs) (w->_title_ofs = ofs) +#endif + +/* + * return codes from PDC_getclipboard() and PDC_setclipboard() calls. + */ +#define PDC_CLIP_SUCCESS 0 +#define PDC_CLIP_ACCESS_ERROR 1 +#define PDC_CLIP_EMPTY 2 +#define PDC_CLIP_MEMORY_ERROR 3 + +/* + * PDCurses key modifier masks + */ +#define PDC_KEY_MODIFIER_SHIFT (1 << 0) +#define PDC_KEY_MODIFIER_CONTROL (1 << 1) +#define PDC_KEY_MODIFIER_ALT (1 << 2) +#define PDC_KEY_MODIFIER_NUMLOCK (1 << 3) + +/* + * Load up curspriv.h. This should be in the same place as + * stdlib.h. We allow anyone who defines CURSES_LIBRARY to have + * access to our internal routines. This provides quick + * PC applications at the expense of portability. + */ +#if defined(CURSES_LIBRARY) +# include +#endif + +#include + +#endif /* __PDCURSES__ */ + +#if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS) +# undef bool + } +#endif diff --git a/curspriv.h b/curspriv.h index 54dc5561..c7039f7d 100644 --- a/curspriv.h +++ b/curspriv.h @@ -1,593 +1,593 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -/* -$Id: curspriv.h,v 1.1 2001/01/10 08:31:35 mark Exp $ -*/ -/* -* -* CURSPRIV.H -* -* Header file for definitions and declarations for the -* PDCurses package. These definitions should not be generally -* accessible to programmers, but are provided if the applications -* programmer decides to make the decision in favor of speed on a -* PC over portability. -* -* Revision History: -* Frotz 1.5Beta 900714 Added many levels of compiler support. -* Added mixed prototypes for all "internal" routines. -* Removed all assembly language. Added EGA/VGA -* support. Converted all #ifdef to #if in all -* modules except CURSES.H and CURSPRIV.H. -* Always include ASSERT.H. Added support for an -* external malloc(), calloc() and free(). -* Added support for FAST_VIDEO (direct-memory writes). -* Added various memory model support (for FAST_VIDEO). -* Added much of the December 1988 X/Open Curses -* specification. -* bl 1.3 881005 All modules lint-checked with MSC '-W3' and turbo'C' -* '-w -w-pro' switches. -* bl 1.2 881002 Support (by #ifdef UCMASM) for uppercase-only -* assembly routine names. If UCMASM if defined, -* all assembler names are #defined as upper case. -* Not needed if you do "MASM /MX. Also missing -* declaration of cursesscroll(). Fixes thanks to -* N.D. Pentcheff -* bl 1.1 880306 Add _chadd() for raw output routines. -* bl 1.0 870515 Release. -* -*/ - -#ifndef __CURSES_INTERNALS__ -#define __CURSES_INTERNALS__ - -/* Always include... */ -#include - -#if defined(HAVE_STDARG_H) && defined(HAVE_PROTO) -# include -# define HAVE_STDARG_H_HAVE_PROTO -#else -# include -#endif - -/*---------------------------------------------------------------------- -* MEMORY MODEL SUPPORT: -* -* MODELS -* TINY cs,ds,ss all in 1 segment (not enough memory!) -* SMALL cs:1 segment, ds:1 segment -* MEDIUM cs:many segments ds:1 segment -* COMPACT cs:1 segment, ds:many segments -* LARGE cs:many segments ds:many segments -* HUGE cs:many segments ds:segments > 64K -*/ -#ifdef __TINY__ -# define SMALL 1 -#endif -#ifdef __SMALL__ -# define SMALL 1 -#endif -#ifdef __MEDIUM__ -# define MEDIUM 1 -#endif -#ifdef __COMPACT__ -# define COMPACT 1 -#endif -#ifdef __LARGE__ -# define LARGE 1 -#endif -#ifdef __HUGE__ -# define HUGE 1 -#endif - - -/*---------------------------------------------------------------------- -* OPERATING SYSTEM SUPPORT: -* -* DOS The one we all know and love:-} -* OS/2 The new kid on the block. -* FLEXOS A Real-time, protected-mode OS from -* Digital Research, Inc. -* (AKA, the 4680 from IBM...) -*/ - -/*----------------------------------------*/ -#ifdef DOS -# define FAST_VIDEO 1 /* We can write directly to the screen. */ -# ifdef NDP - typedef union REGS16 Regs; -# else - typedef union REGS Regs; -# endif - extern Regs regs; -# ifdef GO32 /* Note: works only in plain DOS... */ -# if DJGPP == 2 -# define _FAR_POINTER(s,o) ((((int)(s))<<4) + ((int)(o))) -# else -# define _FAR_POINTER(s,o) (0xe0000000 + (((int)(s))<<4) + ((int)(o))) -# endif -# define _FP_SEGMENT(p) (unsigned short)((((long)fp) >> 4) & 0xffff) -# define _FP_OFFSET(p) ((unsigned short)fp & 0x000f) -# else -# ifdef __TURBOC__ -# define _FAR_POINTER(s,o) MK_FP(s,o) -# else -# if defined(NDP) -# define _FAR_POINTER(s,o) ((((int)(s))<<4) + ((int)(o))) -# else -# if defined(WATCOMC) && defined(__FLAT__) -# define _FAR_POINTER(s,o) ((((int)(s))<<4) + ((int)(o))) -# else -# define _FAR_POINTER(s,o) (((long)s << 16) | (long)o) -# endif -# endif -# endif -# define _FP_SEGMENT(p) (unsigned short)(((long)fp) >> 4) -# define _FP_OFFSET(p) ((unsigned short)fp & 0x000f) -# endif - -# ifdef GO32 - unsigned char getdosmembyte (int offs); /* see: private\_dosmem.c */ - unsigned short getdosmemword (int offs); - void setdosmembyte (int offs, unsigned char b); - void setdosmemword (int offs, unsigned short w); -# else -# if SMALL || MEDIUM || MSC -# define getdosmembyte(offs) (*((unsigned char far *) _FAR_POINTER(0,offs))) -# define getdosmemword(offs) (*((unsigned short far *) _FAR_POINTER(0,offs))) -# define setdosmembyte(offs,x) (*((unsigned char far *) _FAR_POINTER(0,offs)) = (x)) -# define setdosmemword(offs,x) (*((unsigned short far *) _FAR_POINTER(0,offs)) = (x)) -# else -# define getdosmembyte(offs) (*((unsigned char *) _FAR_POINTER(0,offs))) -# define getdosmemword(offs) (*((unsigned short *) _FAR_POINTER(0,offs))) -# define setdosmembyte(offs,x) (*((unsigned char *) _FAR_POINTER(0,offs)) = (x)) -# define setdosmemword(offs,x) (*((unsigned short *) _FAR_POINTER(0,offs)) = (x)) -# endif -# endif -#endif - -/*----------------------------------------*/ -#ifdef FLEXOS -# define FAST_VIDEO 1 /* We can use scopy() */ -# define GMODE 0 /* KLUDGE ALERT! - * GMODE == 0 defines character mode structures in FLEXTAB.H. - * GMODE == 1 defines graphics mode structures in FLEXTAB.H. - */ -#include -extern VIRCON vir; -#endif - - - - -/*---------------------------------------------------------------------- -* MALLOC DEBUGGING SUPPORT: -* -* Set EMALLOC and EMALLOC_MAGIC in order to use your private -* versions of malloc(), calloc(), and free(). This can help, -* but not solve, your malloc problems when debugging... -* -*/ -#if defined(INTERNAL) || defined(CURSES_LIBRARY) -# define EMALLOC 0 /* Enable/Disable External Malloc */ -# define EMALLOC_MAGIC 0x0C0C /* Our magic indicator that we should */ - /* use our external malloc rather than */ - /* the runtime's malloc. */ -#else -# define EMALLOC 0 /* Disable External Malloc */ -#endif - - -/*----------------------------------------------------------------------*/ -/* window properties */ -#define _SUBWIN 0x01 /* window is a subwindow */ -#define _ENDLINE 0x02 /* last winline is last screen line */ -#define _FULLWIN 0x04 /* window fills screen */ -#define _SCROLLWIN 0x08 /* window lwr rgt is screen lwr rgt */ -#define _PAD 0x10 /* X/Open Pad. */ -#define _SUBPAD 0x20 /* X/Open subpad. */ - - - - -/*----------------------------------------------------------------------*/ -/* Miscellaneous */ -#define _INBUFSIZ 512 /* size of terminal input buffer */ -#define _NO_CHANGE -1 /* flags line edge unchanged */ - - - - -/* @@@ THESE SHOULD BE INDIVIDUAL FUNCTIONS, NOT MACROS! */ -#define _BCHAR 0x03 /* Break char (^C) */ -#define _ECHAR 0x08 /* Erase char (^H) */ -#define _DWCHAR 0x17 /* Delete Word char (^W) */ -#define _DLCHAR 0x15 /* Delete Line char (^U) */ -#define _GOCHAR 0x11 /* ^Q character */ -#define _PRINTCHAR 0x10 /* ^P character */ -#define _STOPCHAR 0x13 /* ^S character */ -#define NUNGETCH 20 /* max # chars to ungetch() */ - - - - -/* Setmode stuff */ -struct cttyset -{ - bool been_set; - SCREEN saved; -}; - -extern struct cttyset c_sh_tty; /* tty modes for shell_mode */ -extern struct cttyset c_pr_tty; /* tty modes for prog_mode */ -extern struct cttyset c_save_tty; -extern struct cttyset c_save_trm; - -/* Printscan stuff */ -extern char c_printscanbuf[]; /* buffer used during I/O */ - -/* tracing flag */ -extern bool trace_on; - -/* Strget stuff */ -extern char* c_strbeg; - -/* doupdate stuff */ -extern WINDOW* twin; /* used by many routines */ - - -/* Monitor (terminal) type information */ -#define _NONE 0x00 -#define _MDA 0x01 -#define _CGA 0x02 -#define _EGACOLOR 0x04 -#define _EGAMONO 0x05 -#define _VGACOLOR 0x07 -#define _VGAMONO 0x08 -#define _MCGACOLOR 0x0a -#define _MCGAMONO 0x0b -#define _FLEXOS 0x20 /* A Flexos console */ -#define _MDS_GENIUS 0x30 -#define _UNIX_COLOR 0x40 -#define _UNIX_MONO 0x41 - -/* Text-mode font size information */ -#define _FONT8 8 -#define _FONT14 14 -#define _FONT15 15 /* GENIUS */ -#define _FONT16 16 - - -/*---------------------------------------------------------------------- -* ANSI C prototypes. Be sure that your compiler conditional -* compilation definitions above define HAVE_PROTO if your compiler -* supports prototypes. -*/ -#ifdef HAVE_PROTO -void PDC_beep( void ); -int PDC_backchar( WINDOW*, char*, int* ); -bool PDC_breakout( void ); -int PDC_chadd( WINDOW*, chtype, bool, bool ); -bool PDC_check_bios_key( void ); -int PDC_chg_attr( WINDOW*, chtype, int, int, int, int ); -int PDC_chins( WINDOW*, chtype, bool ); -int PDC_clr_scrn( WINDOW* ); -int PDC_clr_update( WINDOW* ); -int PDC_copy_win( WINDOW *,WINDOW *,int,int,int,int,int,int,int,int,bool ); -int PDC_cursor_off( void ); -int PDC_cursor_on( void ); -int PDC_curs_set( int ); -int PDC_fix_cursor( int ); -int PDC_gattr( void ); -int PDC_get_bios_key( void ); -int PDC_get_columns( void ); -bool PDC_get_ctrl_break( void ); -int PDC_get_cur_col( void ); -int PDC_get_cur_row( void ); -int PDC_get_cursor_pos( int*, int* ); -int PDC_get_cursor_mode( void ); -int PDC_get_font( void ); -int PDC_get_rows( void ); -int PDC_get_buffer_rows( void ); -int PDC_gotoxy( int, int ); -int PDC_init_atrtab(void); -WINDOW* PDC_makenew( int, int, int, int ); -int PDC_mouse_in_slk( int, int ); -int PDC_newline( WINDOW*, int ); -int PDC_print( int, int, int ); -int PDC_putc( chtype, chtype ); -int PDC_putchar( chtype ); -int PDC_putctty( chtype, chtype ); -int PDC_rawgetch( void ); -int PDC_reset_prog_mode( void ); -int PDC_reset_shell_mode( void ); -int PDC_resize_screen( int, int ); -int PDC_sanity_check( int ); -int PDC_scr_close( void ); -int PDC_scr_open( SCREEN*, bool ); -int PDC_scroll( int, int, int, int, int, chtype ); -int PDC_set_80x25( void ); -int PDC_set_ctrl_break( bool ); -int PDC_set_cursor_mode( int, int ); -int PDC_set_font( int ); -int PDC_set_rows( int ); -int PDC_split_plane( WINDOW*, char*, char*, int, int, int, int ); -void PDC_sync( WINDOW * ); -int PDC_sysgetch( void ); -bool PDC_transform_line( int ); -void PDC_usleep( long ); -int PDC_validchar( int ); -int PDC_vsscanf( char *, const char *, va_list); - -int PDC_query_adapter_type( void ); -int PDC_get_scrn_mode( void ); -void PDC_slk_calc( void ); - - -# if defined( OS2 ) && !defined( EMXVIDEO ) -int PDC_set_scrn_mode( VIOMODEINFO); -bool PDC_scrn_modes_equal (VIOMODEINFO, VIOMODEINFO); -# else -int PDC_set_scrn_mode( int ); -bool PDC_scrn_modes_equal (int, int); -# endif - -# ifdef FLEXOS -int PDC_flexos_8bitmode( void ); -int PDC_flexos_16bitmode( void ); -char* PDC_flexos_gname( void ); -# endif - -# ifdef UNIX -int PDC_kbhit(void); -int PDC_setup_keys(void); -# endif - -# ifdef WIN32 -void PDC_doupdate(void); -# endif - -# if defined (XCURSES) -int XCurses_redraw_curscr(void); -int XCurses_display_cursor(int,int,int,int); -int XCurses_rawgetch(void); -bool XCurses_kbhit(void); -int XCurses_get_input_fd(void); -int XCursesInstruct(int); -int XCursesInstructAndWait(int); -int XCurses_transform_line(chtype*, int , int , int ); -int XCursesInitscr(char *,int, char **); -int XCursesEndwin(void); -void XCursesCleanupCursesProcess(int); -int XCursesResizeScreen( int, int ); -int XCurses_get_cols(void); -int XCurses_get_rows(void); -int XCurses_refresh_scrollbar(void); -void XCurses_set_title(char *); -void XCurses_set_title(char *); -int XCurses_getclipboard( char **, long * ); -int XCurses_setclipboard( char *, long ); -unsigned long XCurses_get_key_modifiers( void ); -# endif - -# ifdef PDCDEBUG -void PDC_debug( char*,... ); -# endif - -# ifdef REGISTERWINDOWS -bool PDC_inswin( WINDOW*, WINDOW* ); -int PDC_addtail( WINDOW* ); -int PDC_addwin( WINDOW*, WINDOW* ); -int PDC_rmwin( WINDOW* ); -WINDS* PDC_findwin( WINDOW* ); -# endif - -#else - -void PDC_beep( /* void */ ); -int PDC_backchar( /* WINDOW*, char*, int* */ ); -bool PDC_breakout( /* void */ ); -int PDC_chadd( /* WINDOW*, chtype, bool, bool */ ); -bool PDC_check_bios_key( /* void */ ); -int PDC_chg_attr( /* WINDOW*, chtype, int, int, int, int */ ); -int PDC_chins( /* WINDOW*, chtype, bool */ ); -int PDC_clr_scrn( /* WINDOW* */ ); -int PDC_clr_update( /* WINDOW* */ ); -int PDC_copy_win( /* WINDOW *,WINDOW *,int,int,int,int,int,int,int,int,bool */ ); -int PDC_cursor_off( /* void */ ); -int PDC_cursor_on( /* void */ ); -int PDC_curs_set( /* int */ ); -int PDC_fix_cursor( /* int */ ); -int PDC_gattr( /* void */ ); -int PDC_get_bios_key( /* void */ ); -int PDC_get_columns( /* void */ ); -bool PDC_get_ctrl_break( /* void */ ); -int PDC_get_cur_col( /* void */ ); -int PDC_get_cur_row( /* void */ ); -int PDC_get_cursor_pos( /* int*, int* */ ); -int PDC_get_cursor_mode( /* void */ ); -int PDC_get_font( /* void */ ); -int PDC_get_rows( /* void */ ); -int PDC_get_buffer_rows( /* void */ ); -int PDC_gotoxy( /* int, int */ ); -int PDC_init_atrtab( /*void*/ ); -WINDOW* PDC_makenew( /* int, int, int, int */ ); -int PDC_mouse_in_slk(/* int, int */ ); -int PDC_newline( /* WINDOW*, int */ ); -int PDC_print( /* int, int, int */ ); -int PDC_putc( /* chtype, chtype */ ); -int PDC_putchar( /* chtype */ ); -int PDC_putctty( /* chtype, chtype */ ); -int PDC_rawgetch( /* void */ ); -int PDC_reset_prog_mode( /* void */ ); -int PDC_reset_shell_mode( /* void */ ); -int PDC_resize_screen( /* int, int */ ); -int PDC_sanity_check( /* int */ ); -int PDC_scr_close( /* void */ ); -int PDC_scr_open( /* SCREEN*, bool */ ); -int PDC_scroll( /* int, int, int, int, int, chtype */ ); -int PDC_set_80x25( /* void */ ); -int PDC_set_ctrl_break( /* bool */ ); -int PDC_set_cursor_mode( /* int, int */ ); -int PDC_set_font( /* int */ ); -int PDC_set_rows( /* int */ ); -int PDC_split_plane( /* WINDOW*, char*, char*, int, int, int, int */ ); -void PDC_sync( /* WINDOW * */ ); -int PDC_sysgetch( /* void */ ); -bool PDC_transform_line( /* int */ ); -void PDC_usleep( /* long */ ); -int PDC_validchar( /* int */ ); -int PDC_vsscanf( /* char *, const char *, ... */); - -int PDC_query_adapter_type( /* void */ ); -int PDC_get_scrn_mode( /* void */ ); -void PDC_slk_calc( /* void */ ); - - -# if defined( OS2 ) && !defined( EMXVIDEO ) -int PDC_set_scrn_mode( /* VIOMODEINFO*/ ); -bool PDC_scrn_modes_equal ( /*VIOMODEINFO, VIOMODEINFO*/ ); -# else -int PDC_set_scrn_mode( /* int */ ); -bool PDC_scrn_modes_equal ( /*int, int*/ ); -# endif - -# ifdef FLEXOS -int PDC_flexos_8bitmode( /* void */ ); -int PDC_flexos_16bitmode( /* void */ ); -char* PDC_flexos_gname( /* void */ ); -# endif - -# ifdef UNIX -int PDC_kbhit( /*void*/ ); -int PDC_setup_keys( /*void*/ ); -# endif - -# ifdef WIN32 -void PDC_doupdate( /*void*/ ); -# endif - -# if defined ( XCURSES ) -int XCurses_redraw_curscr( /*void*/ ); -int XCurses_display_cursor( /*int,int,int,int*/ ); -int XCurses_rawgetch( /*void*/ ); -bool XCurses_kbhit( /*void*/ ); -int XCurses_get_input_fd( /*void*/ ); -int XCursesInstruct( /*int*/ ); -int XCursesInstructAndWait( /*void*/ ); -int XCurses_transform_line( /*chtype*, int , int , int */ ); -int XCursesInitscr( /* char *, int, char ** */ ); -int XCursesEndwin( /*void*/ ); -void XCursesCleanupCursesProcess(/* int */); -int XCursesResizeScreen( /* int, int */ ); -int XCurses_get_cols(/* void */); -int XCurses_get_rows(/* void */); -int XCurses_refresh_scrollbar( /* void */ ); -void XCurses_set_title(/* char * */ ); -int XCurses_getclipboard( /* char **, long * */ ); -int XCurses_setclipboard( /* char *, long */ ); -unsigned long XCurses_get_key_modifiers( /* void */ ); -# endif - -# ifdef PDCDEBUG -void PDC_debug( /* char*,... */ ); -# endif - -# ifdef REGISTERWINDOWS -bool PDC_inswin( /* WINDOW*, WINDOW* */ ); -int PDC_addtail( /* WINDOW* */ ); -int PDC_addwin( /* WINDOW*, WINDOW* */ ); -int PDC_rmwin( /* WINDOW* */ ); -WINDS* PDC_findwin( /* WINDOW* */ ); -# endif -#endif - -#define PDC_COLORS 8 -#define PDC_COLOR_PAIRS 64 - -#if defined(CHTYPE_LONG) -# define PDC_OFFSET 32 -# define MAX_ATRTAB ((PDC_COLOR_PAIRS+1)*PDC_OFFSET) -/* internal macros for attributes */ -# define chtype_attr(ch) (atrtab[((ch >> 19) & 0xFFFF)] << 8) -#else -# define PDC_OFFSET 8 -# define MAX_ATRTAB 272 -/* internal macros for attributes */ -# define chtype_attr(ch) ((atrtab[((ch >> 8) & 0xFF)] << 8) & A_ATTRIBUTES) -#endif -/* - * Internal mouse handling macros - */ -#define TRAPPED_MOUSE_X_POS (Trapped_Mouse_status.x) -#define TRAPPED_MOUSE_Y_POS (Trapped_Mouse_status.y) -#define TRAPPED_A_BUTTON_CHANGED (Trapped_Mouse_status.changes & 7) -#define TRAPPED_MOUSE_MOVED (Trapped_Mouse_status.changes & 8) -#define TRAPPED_MOUSE_POS_REPORT (Trapped_Mouse_status.changes & 16) -#define TRAPPED_BUTTON_CHANGED(x) (Trapped_Mouse_status.changes & (1 << ((x) - 1))) -#define TRAPPED_BUTTON_STATUS(x) (Trapped_Mouse_status.button[(x)-1]) - -#define ACTUAL_MOUSE_X_POS (Actual_Mouse_status.x) -#define ACTUAL_MOUSE_Y_POS (Actual_Mouse_status.y) -#define ACTUAL_A_BUTTON_CHANGED (Actual_Mouse_status.changes & 7) -#define ACTUAL_MOUSE_MOVED (Actual_Mouse_status.changes & 8) -#define ACTUAL_MOUSE_POS_REPORT (Actual_Mouse_status.changes & 16) -#define ACTUAL_BUTTON_CHANGED(x) (Actual_Mouse_status.changes & (1 << ((x) - 1))) -#define ACTUAL_BUTTON_STATUS(x) (Actual_Mouse_status.button[(x)-1]) - -#define TEMP_MOUSE_X_POS (Temp_Mouse_status.x) -#define TEMP_MOUSE_Y_POS (Temp_Mouse_status.y) -#define TEMP_A_BUTTON_CHANGED (Temp_Mouse_status.changes & 7) -#define TEMP_MOUSE_MOVED (Temp_Mouse_status.changes & 8) -#define TEMP_MOUSE_POS_REPORT (Temp_Mouse_status.changes & 16) -#define TEMP_BUTTON_CHANGED(x) (Temp_Mouse_status.changes & (1 << ((x) - 1))) -#define TEMP_BUTTON_STATUS(x) (Temp_Mouse_status.button[(x)-1]) - -#if defined(XCURSES) -#define CURSES_EXIT 999999 -#define CURSES_REFRESH 999998 -#define CURSES_CHILD 999997 -#define CURSES_CURSOR 999996 -#define CURSES_CONTINUE 999995 -#define CURSES_BELL 999994 -#define CURSES_FLASH 999993 -#define CURSES_CLEAR 999992 -#define CURSES_RESIZE 999991 -#define CURSES_REFRESH_SCROLLBAR 999990 -#define CURSES_TITLE 999989 -#define CURSES_GET_SELECTION 999988 -#define CURSES_SET_SELECTION 999987 - -#define XCURSCR_Y_SIZE (XCursesLINES*XCursesCOLS*sizeof(chtype)) -#define XCURSCR_FLAG_SIZE (XCursesLINES*sizeof(int)) -#define XCURSCR_START_SIZE (XCursesLINES*sizeof(int)) -#define XCURSCR_LENGTH_SIZE (XCursesLINES*sizeof(int)) -#define XCURSCR_ATRTAB_SIZE (MAX_ATRTAB*sizeof(unsigned char)) -#define XCURSCR_SIZE (XCURSCR_FLAG_SIZE+XCURSCR_START_SIZE+XCURSCR_LENGTH_SIZE+XCURSCR_Y_SIZE+XCURSCR_ATRTAB_SIZE) - -#define XCURSCR_Y_OFF(y) ((y)*XCursesCOLS*(sizeof(chtype))) -#define XCURSCR_FLAG_OFF (XCURSCR_Y_OFF(0)+XCURSCR_Y_SIZE) -#define XCURSCR_START_OFF (XCURSCR_FLAG_OFF+XCURSCR_FLAG_SIZE) -#define XCURSCR_LENGTH_OFF (XCURSCR_START_OFF+XCURSCR_START_SIZE) -#define XCURSCR_ATRTAB_OFF (XCURSCR_LENGTH_OFF+XCURSCR_LENGTH_SIZE) -#endif - -#endif /* __CURSES_INTERNALS__*/ +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +/* +$Id: curspriv.h,v 1.2 2001/01/10 08:31:36 mark Exp $ +*/ +/* +* +* CURSPRIV.H +* +* Header file for definitions and declarations for the +* PDCurses package. These definitions should not be generally +* accessible to programmers, but are provided if the applications +* programmer decides to make the decision in favor of speed on a +* PC over portability. +* +* Revision History: +* Frotz 1.5Beta 900714 Added many levels of compiler support. +* Added mixed prototypes for all "internal" routines. +* Removed all assembly language. Added EGA/VGA +* support. Converted all #ifdef to #if in all +* modules except CURSES.H and CURSPRIV.H. +* Always include ASSERT.H. Added support for an +* external malloc(), calloc() and free(). +* Added support for FAST_VIDEO (direct-memory writes). +* Added various memory model support (for FAST_VIDEO). +* Added much of the December 1988 X/Open Curses +* specification. +* bl 1.3 881005 All modules lint-checked with MSC '-W3' and turbo'C' +* '-w -w-pro' switches. +* bl 1.2 881002 Support (by #ifdef UCMASM) for uppercase-only +* assembly routine names. If UCMASM if defined, +* all assembler names are #defined as upper case. +* Not needed if you do "MASM /MX. Also missing +* declaration of cursesscroll(). Fixes thanks to +* N.D. Pentcheff +* bl 1.1 880306 Add _chadd() for raw output routines. +* bl 1.0 870515 Release. +* +*/ + +#ifndef __CURSES_INTERNALS__ +#define __CURSES_INTERNALS__ + +/* Always include... */ +#include + +#if defined(HAVE_STDARG_H) && defined(HAVE_PROTO) +# include +# define HAVE_STDARG_H_HAVE_PROTO +#else +# include +#endif + +/*---------------------------------------------------------------------- +* MEMORY MODEL SUPPORT: +* +* MODELS +* TINY cs,ds,ss all in 1 segment (not enough memory!) +* SMALL cs:1 segment, ds:1 segment +* MEDIUM cs:many segments ds:1 segment +* COMPACT cs:1 segment, ds:many segments +* LARGE cs:many segments ds:many segments +* HUGE cs:many segments ds:segments > 64K +*/ +#ifdef __TINY__ +# define SMALL 1 +#endif +#ifdef __SMALL__ +# define SMALL 1 +#endif +#ifdef __MEDIUM__ +# define MEDIUM 1 +#endif +#ifdef __COMPACT__ +# define COMPACT 1 +#endif +#ifdef __LARGE__ +# define LARGE 1 +#endif +#ifdef __HUGE__ +# define HUGE 1 +#endif + + +/*---------------------------------------------------------------------- +* OPERATING SYSTEM SUPPORT: +* +* DOS The one we all know and love:-} +* OS/2 The new kid on the block. +* FLEXOS A Real-time, protected-mode OS from +* Digital Research, Inc. +* (AKA, the 4680 from IBM...) +*/ + +/*----------------------------------------*/ +#ifdef DOS +# define FAST_VIDEO 1 /* We can write directly to the screen. */ +# ifdef NDP + typedef union REGS16 Regs; +# else + typedef union REGS Regs; +# endif + extern Regs regs; +# ifdef GO32 /* Note: works only in plain DOS... */ +# if DJGPP == 2 +# define _FAR_POINTER(s,o) ((((int)(s))<<4) + ((int)(o))) +# else +# define _FAR_POINTER(s,o) (0xe0000000 + (((int)(s))<<4) + ((int)(o))) +# endif +# define _FP_SEGMENT(p) (unsigned short)((((long)fp) >> 4) & 0xffff) +# define _FP_OFFSET(p) ((unsigned short)fp & 0x000f) +# else +# ifdef __TURBOC__ +# define _FAR_POINTER(s,o) MK_FP(s,o) +# else +# if defined(NDP) +# define _FAR_POINTER(s,o) ((((int)(s))<<4) + ((int)(o))) +# else +# if defined(WATCOMC) && defined(__FLAT__) +# define _FAR_POINTER(s,o) ((((int)(s))<<4) + ((int)(o))) +# else +# define _FAR_POINTER(s,o) (((long)s << 16) | (long)o) +# endif +# endif +# endif +# define _FP_SEGMENT(p) (unsigned short)(((long)fp) >> 4) +# define _FP_OFFSET(p) ((unsigned short)fp & 0x000f) +# endif + +# ifdef GO32 + unsigned char getdosmembyte (int offs); /* see: private\_dosmem.c */ + unsigned short getdosmemword (int offs); + void setdosmembyte (int offs, unsigned char b); + void setdosmemword (int offs, unsigned short w); +# else +# if SMALL || MEDIUM || MSC +# define getdosmembyte(offs) (*((unsigned char far *) _FAR_POINTER(0,offs))) +# define getdosmemword(offs) (*((unsigned short far *) _FAR_POINTER(0,offs))) +# define setdosmembyte(offs,x) (*((unsigned char far *) _FAR_POINTER(0,offs)) = (x)) +# define setdosmemword(offs,x) (*((unsigned short far *) _FAR_POINTER(0,offs)) = (x)) +# else +# define getdosmembyte(offs) (*((unsigned char *) _FAR_POINTER(0,offs))) +# define getdosmemword(offs) (*((unsigned short *) _FAR_POINTER(0,offs))) +# define setdosmembyte(offs,x) (*((unsigned char *) _FAR_POINTER(0,offs)) = (x)) +# define setdosmemword(offs,x) (*((unsigned short *) _FAR_POINTER(0,offs)) = (x)) +# endif +# endif +#endif + +/*----------------------------------------*/ +#ifdef FLEXOS +# define FAST_VIDEO 1 /* We can use scopy() */ +# define GMODE 0 /* KLUDGE ALERT! + * GMODE == 0 defines character mode structures in FLEXTAB.H. + * GMODE == 1 defines graphics mode structures in FLEXTAB.H. + */ +#include +extern VIRCON vir; +#endif + + + + +/*---------------------------------------------------------------------- +* MALLOC DEBUGGING SUPPORT: +* +* Set EMALLOC and EMALLOC_MAGIC in order to use your private +* versions of malloc(), calloc(), and free(). This can help, +* but not solve, your malloc problems when debugging... +* +*/ +#if defined(INTERNAL) || defined(CURSES_LIBRARY) +# define EMALLOC 0 /* Enable/Disable External Malloc */ +# define EMALLOC_MAGIC 0x0C0C /* Our magic indicator that we should */ + /* use our external malloc rather than */ + /* the runtime's malloc. */ +#else +# define EMALLOC 0 /* Disable External Malloc */ +#endif + + +/*----------------------------------------------------------------------*/ +/* window properties */ +#define _SUBWIN 0x01 /* window is a subwindow */ +#define _ENDLINE 0x02 /* last winline is last screen line */ +#define _FULLWIN 0x04 /* window fills screen */ +#define _SCROLLWIN 0x08 /* window lwr rgt is screen lwr rgt */ +#define _PAD 0x10 /* X/Open Pad. */ +#define _SUBPAD 0x20 /* X/Open subpad. */ + + + + +/*----------------------------------------------------------------------*/ +/* Miscellaneous */ +#define _INBUFSIZ 512 /* size of terminal input buffer */ +#define _NO_CHANGE -1 /* flags line edge unchanged */ + + + + +/* @@@ THESE SHOULD BE INDIVIDUAL FUNCTIONS, NOT MACROS! */ +#define _BCHAR 0x03 /* Break char (^C) */ +#define _ECHAR 0x08 /* Erase char (^H) */ +#define _DWCHAR 0x17 /* Delete Word char (^W) */ +#define _DLCHAR 0x15 /* Delete Line char (^U) */ +#define _GOCHAR 0x11 /* ^Q character */ +#define _PRINTCHAR 0x10 /* ^P character */ +#define _STOPCHAR 0x13 /* ^S character */ +#define NUNGETCH 20 /* max # chars to ungetch() */ + + + + +/* Setmode stuff */ +struct cttyset +{ + bool been_set; + SCREEN saved; +}; + +extern struct cttyset c_sh_tty; /* tty modes for shell_mode */ +extern struct cttyset c_pr_tty; /* tty modes for prog_mode */ +extern struct cttyset c_save_tty; +extern struct cttyset c_save_trm; + +/* Printscan stuff */ +extern char c_printscanbuf[]; /* buffer used during I/O */ + +/* tracing flag */ +extern bool trace_on; + +/* Strget stuff */ +extern char* c_strbeg; + +/* doupdate stuff */ +extern WINDOW* twin; /* used by many routines */ + + +/* Monitor (terminal) type information */ +#define _NONE 0x00 +#define _MDA 0x01 +#define _CGA 0x02 +#define _EGACOLOR 0x04 +#define _EGAMONO 0x05 +#define _VGACOLOR 0x07 +#define _VGAMONO 0x08 +#define _MCGACOLOR 0x0a +#define _MCGAMONO 0x0b +#define _FLEXOS 0x20 /* A Flexos console */ +#define _MDS_GENIUS 0x30 +#define _UNIX_COLOR 0x40 +#define _UNIX_MONO 0x41 + +/* Text-mode font size information */ +#define _FONT8 8 +#define _FONT14 14 +#define _FONT15 15 /* GENIUS */ +#define _FONT16 16 + + +/*---------------------------------------------------------------------- +* ANSI C prototypes. Be sure that your compiler conditional +* compilation definitions above define HAVE_PROTO if your compiler +* supports prototypes. +*/ +#ifdef HAVE_PROTO +void PDC_beep( void ); +int PDC_backchar( WINDOW*, char*, int* ); +bool PDC_breakout( void ); +int PDC_chadd( WINDOW*, chtype, bool, bool ); +bool PDC_check_bios_key( void ); +int PDC_chg_attr( WINDOW*, chtype, int, int, int, int ); +int PDC_chins( WINDOW*, chtype, bool ); +int PDC_clr_scrn( WINDOW* ); +int PDC_clr_update( WINDOW* ); +int PDC_copy_win( WINDOW *,WINDOW *,int,int,int,int,int,int,int,int,bool ); +int PDC_cursor_off( void ); +int PDC_cursor_on( void ); +int PDC_curs_set( int ); +int PDC_fix_cursor( int ); +int PDC_gattr( void ); +int PDC_get_bios_key( void ); +int PDC_get_columns( void ); +bool PDC_get_ctrl_break( void ); +int PDC_get_cur_col( void ); +int PDC_get_cur_row( void ); +int PDC_get_cursor_pos( int*, int* ); +int PDC_get_cursor_mode( void ); +int PDC_get_font( void ); +int PDC_get_rows( void ); +int PDC_get_buffer_rows( void ); +int PDC_gotoxy( int, int ); +int PDC_init_atrtab(void); +WINDOW* PDC_makenew( int, int, int, int ); +int PDC_mouse_in_slk( int, int ); +int PDC_newline( WINDOW*, int ); +int PDC_print( int, int, int ); +int PDC_putc( chtype, chtype ); +int PDC_putchar( chtype ); +int PDC_putctty( chtype, chtype ); +int PDC_rawgetch( void ); +int PDC_reset_prog_mode( void ); +int PDC_reset_shell_mode( void ); +int PDC_resize_screen( int, int ); +int PDC_sanity_check( int ); +int PDC_scr_close( void ); +int PDC_scr_open( SCREEN*, bool ); +int PDC_scroll( int, int, int, int, int, chtype ); +int PDC_set_80x25( void ); +int PDC_set_ctrl_break( bool ); +int PDC_set_cursor_mode( int, int ); +int PDC_set_font( int ); +int PDC_set_rows( int ); +int PDC_split_plane( WINDOW*, char*, char*, int, int, int, int ); +void PDC_sync( WINDOW * ); +int PDC_sysgetch( void ); +bool PDC_transform_line( int ); +void PDC_usleep( long ); +int PDC_validchar( int ); +int PDC_vsscanf( char *, const char *, va_list); + +int PDC_query_adapter_type( void ); +int PDC_get_scrn_mode( void ); +void PDC_slk_calc( void ); + + +# if defined( OS2 ) && !defined( EMXVIDEO ) +int PDC_set_scrn_mode( VIOMODEINFO); +bool PDC_scrn_modes_equal (VIOMODEINFO, VIOMODEINFO); +# else +int PDC_set_scrn_mode( int ); +bool PDC_scrn_modes_equal (int, int); +# endif + +# ifdef FLEXOS +int PDC_flexos_8bitmode( void ); +int PDC_flexos_16bitmode( void ); +char* PDC_flexos_gname( void ); +# endif + +# ifdef UNIX +int PDC_kbhit(void); +int PDC_setup_keys(void); +# endif + +# ifdef WIN32 +void PDC_doupdate(void); +# endif + +# if defined (XCURSES) +int XCurses_redraw_curscr(void); +int XCurses_display_cursor(int,int,int,int); +int XCurses_rawgetch(void); +bool XCurses_kbhit(void); +int XCurses_get_input_fd(void); +int XCursesInstruct(int); +int XCursesInstructAndWait(int); +int XCurses_transform_line(chtype*, int , int , int ); +int XCursesInitscr(char *,int, char **); +int XCursesEndwin(void); +void XCursesCleanupCursesProcess(int); +int XCursesResizeScreen( int, int ); +int XCurses_get_cols(void); +int XCurses_get_rows(void); +int XCurses_refresh_scrollbar(void); +void XCurses_set_title(char *); +void XCurses_set_title(char *); +int XCurses_getclipboard( char **, long * ); +int XCurses_setclipboard( char *, long ); +unsigned long XCurses_get_key_modifiers( void ); +# endif + +# ifdef PDCDEBUG +void PDC_debug( char*,... ); +# endif + +# ifdef REGISTERWINDOWS +bool PDC_inswin( WINDOW*, WINDOW* ); +int PDC_addtail( WINDOW* ); +int PDC_addwin( WINDOW*, WINDOW* ); +int PDC_rmwin( WINDOW* ); +WINDS* PDC_findwin( WINDOW* ); +# endif + +#else + +void PDC_beep( /* void */ ); +int PDC_backchar( /* WINDOW*, char*, int* */ ); +bool PDC_breakout( /* void */ ); +int PDC_chadd( /* WINDOW*, chtype, bool, bool */ ); +bool PDC_check_bios_key( /* void */ ); +int PDC_chg_attr( /* WINDOW*, chtype, int, int, int, int */ ); +int PDC_chins( /* WINDOW*, chtype, bool */ ); +int PDC_clr_scrn( /* WINDOW* */ ); +int PDC_clr_update( /* WINDOW* */ ); +int PDC_copy_win( /* WINDOW *,WINDOW *,int,int,int,int,int,int,int,int,bool */ ); +int PDC_cursor_off( /* void */ ); +int PDC_cursor_on( /* void */ ); +int PDC_curs_set( /* int */ ); +int PDC_fix_cursor( /* int */ ); +int PDC_gattr( /* void */ ); +int PDC_get_bios_key( /* void */ ); +int PDC_get_columns( /* void */ ); +bool PDC_get_ctrl_break( /* void */ ); +int PDC_get_cur_col( /* void */ ); +int PDC_get_cur_row( /* void */ ); +int PDC_get_cursor_pos( /* int*, int* */ ); +int PDC_get_cursor_mode( /* void */ ); +int PDC_get_font( /* void */ ); +int PDC_get_rows( /* void */ ); +int PDC_get_buffer_rows( /* void */ ); +int PDC_gotoxy( /* int, int */ ); +int PDC_init_atrtab( /*void*/ ); +WINDOW* PDC_makenew( /* int, int, int, int */ ); +int PDC_mouse_in_slk(/* int, int */ ); +int PDC_newline( /* WINDOW*, int */ ); +int PDC_print( /* int, int, int */ ); +int PDC_putc( /* chtype, chtype */ ); +int PDC_putchar( /* chtype */ ); +int PDC_putctty( /* chtype, chtype */ ); +int PDC_rawgetch( /* void */ ); +int PDC_reset_prog_mode( /* void */ ); +int PDC_reset_shell_mode( /* void */ ); +int PDC_resize_screen( /* int, int */ ); +int PDC_sanity_check( /* int */ ); +int PDC_scr_close( /* void */ ); +int PDC_scr_open( /* SCREEN*, bool */ ); +int PDC_scroll( /* int, int, int, int, int, chtype */ ); +int PDC_set_80x25( /* void */ ); +int PDC_set_ctrl_break( /* bool */ ); +int PDC_set_cursor_mode( /* int, int */ ); +int PDC_set_font( /* int */ ); +int PDC_set_rows( /* int */ ); +int PDC_split_plane( /* WINDOW*, char*, char*, int, int, int, int */ ); +void PDC_sync( /* WINDOW * */ ); +int PDC_sysgetch( /* void */ ); +bool PDC_transform_line( /* int */ ); +void PDC_usleep( /* long */ ); +int PDC_validchar( /* int */ ); +int PDC_vsscanf( /* char *, const char *, ... */); + +int PDC_query_adapter_type( /* void */ ); +int PDC_get_scrn_mode( /* void */ ); +void PDC_slk_calc( /* void */ ); + + +# if defined( OS2 ) && !defined( EMXVIDEO ) +int PDC_set_scrn_mode( /* VIOMODEINFO*/ ); +bool PDC_scrn_modes_equal ( /*VIOMODEINFO, VIOMODEINFO*/ ); +# else +int PDC_set_scrn_mode( /* int */ ); +bool PDC_scrn_modes_equal ( /*int, int*/ ); +# endif + +# ifdef FLEXOS +int PDC_flexos_8bitmode( /* void */ ); +int PDC_flexos_16bitmode( /* void */ ); +char* PDC_flexos_gname( /* void */ ); +# endif + +# ifdef UNIX +int PDC_kbhit( /*void*/ ); +int PDC_setup_keys( /*void*/ ); +# endif + +# ifdef WIN32 +void PDC_doupdate( /*void*/ ); +# endif + +# if defined ( XCURSES ) +int XCurses_redraw_curscr( /*void*/ ); +int XCurses_display_cursor( /*int,int,int,int*/ ); +int XCurses_rawgetch( /*void*/ ); +bool XCurses_kbhit( /*void*/ ); +int XCurses_get_input_fd( /*void*/ ); +int XCursesInstruct( /*int*/ ); +int XCursesInstructAndWait( /*void*/ ); +int XCurses_transform_line( /*chtype*, int , int , int */ ); +int XCursesInitscr( /* char *, int, char ** */ ); +int XCursesEndwin( /*void*/ ); +void XCursesCleanupCursesProcess(/* int */); +int XCursesResizeScreen( /* int, int */ ); +int XCurses_get_cols(/* void */); +int XCurses_get_rows(/* void */); +int XCurses_refresh_scrollbar( /* void */ ); +void XCurses_set_title(/* char * */ ); +int XCurses_getclipboard( /* char **, long * */ ); +int XCurses_setclipboard( /* char *, long */ ); +unsigned long XCurses_get_key_modifiers( /* void */ ); +# endif + +# ifdef PDCDEBUG +void PDC_debug( /* char*,... */ ); +# endif + +# ifdef REGISTERWINDOWS +bool PDC_inswin( /* WINDOW*, WINDOW* */ ); +int PDC_addtail( /* WINDOW* */ ); +int PDC_addwin( /* WINDOW*, WINDOW* */ ); +int PDC_rmwin( /* WINDOW* */ ); +WINDS* PDC_findwin( /* WINDOW* */ ); +# endif +#endif + +#define PDC_COLORS 8 +#define PDC_COLOR_PAIRS 64 + +#if defined(CHTYPE_LONG) +# define PDC_OFFSET 32 +# define MAX_ATRTAB ((PDC_COLOR_PAIRS+1)*PDC_OFFSET) +/* internal macros for attributes */ +# define chtype_attr(ch) (atrtab[((ch >> 19) & 0xFFFF)] << 8) +#else +# define PDC_OFFSET 8 +# define MAX_ATRTAB 272 +/* internal macros for attributes */ +# define chtype_attr(ch) ((atrtab[((ch >> 8) & 0xFF)] << 8) & A_ATTRIBUTES) +#endif +/* + * Internal mouse handling macros + */ +#define TRAPPED_MOUSE_X_POS (Trapped_Mouse_status.x) +#define TRAPPED_MOUSE_Y_POS (Trapped_Mouse_status.y) +#define TRAPPED_A_BUTTON_CHANGED (Trapped_Mouse_status.changes & 7) +#define TRAPPED_MOUSE_MOVED (Trapped_Mouse_status.changes & 8) +#define TRAPPED_MOUSE_POS_REPORT (Trapped_Mouse_status.changes & 16) +#define TRAPPED_BUTTON_CHANGED(x) (Trapped_Mouse_status.changes & (1 << ((x) - 1))) +#define TRAPPED_BUTTON_STATUS(x) (Trapped_Mouse_status.button[(x)-1]) + +#define ACTUAL_MOUSE_X_POS (Actual_Mouse_status.x) +#define ACTUAL_MOUSE_Y_POS (Actual_Mouse_status.y) +#define ACTUAL_A_BUTTON_CHANGED (Actual_Mouse_status.changes & 7) +#define ACTUAL_MOUSE_MOVED (Actual_Mouse_status.changes & 8) +#define ACTUAL_MOUSE_POS_REPORT (Actual_Mouse_status.changes & 16) +#define ACTUAL_BUTTON_CHANGED(x) (Actual_Mouse_status.changes & (1 << ((x) - 1))) +#define ACTUAL_BUTTON_STATUS(x) (Actual_Mouse_status.button[(x)-1]) + +#define TEMP_MOUSE_X_POS (Temp_Mouse_status.x) +#define TEMP_MOUSE_Y_POS (Temp_Mouse_status.y) +#define TEMP_A_BUTTON_CHANGED (Temp_Mouse_status.changes & 7) +#define TEMP_MOUSE_MOVED (Temp_Mouse_status.changes & 8) +#define TEMP_MOUSE_POS_REPORT (Temp_Mouse_status.changes & 16) +#define TEMP_BUTTON_CHANGED(x) (Temp_Mouse_status.changes & (1 << ((x) - 1))) +#define TEMP_BUTTON_STATUS(x) (Temp_Mouse_status.button[(x)-1]) + +#if defined(XCURSES) +#define CURSES_EXIT 999999 +#define CURSES_REFRESH 999998 +#define CURSES_CHILD 999997 +#define CURSES_CURSOR 999996 +#define CURSES_CONTINUE 999995 +#define CURSES_BELL 999994 +#define CURSES_FLASH 999993 +#define CURSES_CLEAR 999992 +#define CURSES_RESIZE 999991 +#define CURSES_REFRESH_SCROLLBAR 999990 +#define CURSES_TITLE 999989 +#define CURSES_GET_SELECTION 999988 +#define CURSES_SET_SELECTION 999987 + +#define XCURSCR_Y_SIZE (XCursesLINES*XCursesCOLS*sizeof(chtype)) +#define XCURSCR_FLAG_SIZE (XCursesLINES*sizeof(int)) +#define XCURSCR_START_SIZE (XCursesLINES*sizeof(int)) +#define XCURSCR_LENGTH_SIZE (XCursesLINES*sizeof(int)) +#define XCURSCR_ATRTAB_SIZE (MAX_ATRTAB*sizeof(unsigned char)) +#define XCURSCR_SIZE (XCURSCR_FLAG_SIZE+XCURSCR_START_SIZE+XCURSCR_LENGTH_SIZE+XCURSCR_Y_SIZE+XCURSCR_ATRTAB_SIZE) + +#define XCURSCR_Y_OFF(y) ((y)*XCursesCOLS*(sizeof(chtype))) +#define XCURSCR_FLAG_OFF (XCURSCR_Y_OFF(0)+XCURSCR_Y_SIZE) +#define XCURSCR_START_OFF (XCURSCR_FLAG_OFF+XCURSCR_FLAG_SIZE) +#define XCURSCR_LENGTH_OFF (XCURSCR_START_OFF+XCURSCR_START_SIZE) +#define XCURSCR_ATRTAB_OFF (XCURSCR_LENGTH_OFF+XCURSCR_LENGTH_SIZE) +#endif + +#endif /* __CURSES_INTERNALS__*/ diff --git a/dos/README b/dos/README index 6ee4e7eb..caa1396b 100644 --- a/dos/README +++ b/dos/README @@ -1,21 +1,21 @@ - - Welcome to PDCurses - - Contents - -------- - This directory contains core PDCurses source code files specific to - the DOS platform. - - - Distribution Status - ------------------- - - The files in this directory are released to the Public Domain. - - - Acknowlegements - --------------- - - Watcom C port was provided by Pieter Kunst (kunst@prl.philips.nl) - DJGPP 1.x port was provided by David Nugent (davidn@csource.oz.au) - Microway NDP port was provided by ???? + + Welcome to PDCurses + + Contents + -------- + This directory contains core PDCurses source code files specific to + the DOS platform. + + + Distribution Status + ------------------- + + The files in this directory are released to the Public Domain. + + + Acknowlegements + --------------- + + Watcom C port was provided by Pieter Kunst (kunst@prl.philips.nl) + DJGPP 1.x port was provided by David Nugent (davidn@csource.oz.au) + Microway NDP port was provided by ???? diff --git a/dos/bccdos.ini b/dos/bccdos.ini index f612f339..34bd7e67 100644 --- a/dos/bccdos.ini +++ b/dos/bccdos.ini @@ -1,154 +1,154 @@ -# MSDOS DMAKE startup file. Customize to suit your needs. -# Assumes MKS toolkit for the tool commands, and Turbo-C. Change as req'd. -# See the documentation for a description of internally defined macros. -# -# Disable warnings for macros redefined here that were given -# on the command line. -__.SILENT := $(.SILENT) -.SILENT := yes - -# Configuration parameters for DMAKE startup.mk file -# Set these to NON-NULL if you wish to turn the parameter on. -_HAVE_RCS := yes # yes => RCS is installed. -_HAVE_SCCS := # yes => SCCS is installed. - -# Applicable suffix definitions -A := .lib # Libraries -E := .exe # Executables -F := .for # Fortran -O := .obj # Objects -P := .pas # Pascal -S := .asm # Assembler sources -V := # RCS suffix - -# See if these are defined -TMPDIR := $(ROOTDIR)/tmp -.IMPORT .IGNORE : TMPDIR SHELL COMSPEC - -# Recipe execution configurations -# First set SHELL, If it is not defined, use COMSPEC, otherwise -# it is assumed to be MKS Korn SHELL. -.IF $(SHELL) == $(NULL) -.IF $(COMSPEC) == $(NULL) - SHELL := $(ROOTDIR)/bin/sh$E -.ELSE - SHELL := $(COMSPEC) -.END -.END -GROUPSHELL := $(SHELL) - -# Now set remaining arguments depending on which SHELL we -# are going to use. COMSPEC (assumed to be command.com) or -# MKS Korn Shell. -.IF $(SHELL)==$(COMSPEC) - SHELLFLAGS := $(SWITCHAR)c - GROUPFLAGS := $(SHELLFLAGS) - SHELLMETAS := *"?<> - GROUPSUFFIX := .bat - DIRSEPSTR := \\ - DIVFILE = $(TMPFILE:s,/,\) -.ELSE - SHELLFLAGS := -c - GROUPFLAGS := - SHELLMETAS := *"?<>|()&][$$\#`' - GROUPSUFFIX := .ksh - .MKSARGS := yes - DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) - DIVSEP_shell_yes := \\\ - DIVSEP_shell_no := \\ -.END - -# Standard C-language command names and flags - CC := bcc # C-compiler and flags - CFLAGS += - - AS := tasm # Assembler and flags - ASFLAGS += - - LD = tlink # Loader and flags - LDFLAGS += - LDLIBS = - -# Definition of $(MAKE) macro for recursive makes. - MAKE = $(MAKECMD) $(MFLAGS) - -# Language and Parser generation Tools and their flags - YACC := yacc # standard yacc - YFLAGS += - YTAB := ytab # yacc output files name stem. - - LEX := lex # standard lex - LFLAGS += - LEXYY := lex_yy # lex output file - -# Other Compilers, Tools and their flags - PC := tpc # pascal compiler - RC := anyf77 # ratfor compiler - FC := anyf77 # fortran compiler - - CO := co # check out for RCS - COFLAGS += -q - - AR := ar # archiver - ARFLAGS+= ruv - - RM := rm # remove a file command - RMFLAGS += - -# Implicit generation rules for making inferences. -# We don't provide .yr or .ye rules here. They're obsolete. -# Rules for making *$O - %$O .SWAP: %.c ; $(CC) $(CFLAGS) -c $< - %$O .SWAP: %$P ; $(PC) $(PFLAGS) -c $< - %$O .SWAP: %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); - %$O : %.cl ; class -c $< - %$O .SWAP: %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< - -# Executables - %$E .SWAP: %$O ; $(CC) $(LDFLAGS) -e$@ $< - -# lex and yacc rules - %.c .SWAP: %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ - %.c .SWAP: %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ - -# RCS support -.IF $(_HAVE_RCS) - % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@ - .NOINFER : $$(@:d)RCS/$$(@:f)$V -.END - -# SCCS support -.IF $(_HAVE_SCCS) - % : s.% ; get $< - .NOINFER : s.% -.END - -# Recipe to make archive files. -%$A .SWAP: -[ - $(AR) $(ARFLAGS) $@ $? - $(RM) $(RMFLAGS) $? -] - -# DMAKE uses this recipe to remove intermediate targets -.REMOVE :; $(RM) -f $< - -# AUGMAKE extensions for SYSV compatibility -@B = $(@:b) -@D = $(@:d) -@F = $(@:f) -"*B" = $(*:b) -"*D" = $(*:d) -"*F" = $(*:f) - RCS is installed. +_HAVE_SCCS := # yes => SCCS is installed. + +# Applicable suffix definitions +A := .lib # Libraries +E := .exe # Executables +F := .for # Fortran +O := .obj # Objects +P := .pas # Pascal +S := .asm # Assembler sources +V := # RCS suffix + +# See if these are defined +TMPDIR := $(ROOTDIR)/tmp +.IMPORT .IGNORE : TMPDIR SHELL COMSPEC + +# Recipe execution configurations +# First set SHELL, If it is not defined, use COMSPEC, otherwise +# it is assumed to be MKS Korn SHELL. +.IF $(SHELL) == $(NULL) +.IF $(COMSPEC) == $(NULL) + SHELL := $(ROOTDIR)/bin/sh$E +.ELSE + SHELL := $(COMSPEC) +.END +.END +GROUPSHELL := $(SHELL) + +# Now set remaining arguments depending on which SHELL we +# are going to use. COMSPEC (assumed to be command.com) or +# MKS Korn Shell. +.IF $(SHELL)==$(COMSPEC) + SHELLFLAGS := $(SWITCHAR)c + GROUPFLAGS := $(SHELLFLAGS) + SHELLMETAS := *"?<> + GROUPSUFFIX := .bat + DIRSEPSTR := \\ + DIVFILE = $(TMPFILE:s,/,\) +.ELSE + SHELLFLAGS := -c + GROUPFLAGS := + SHELLMETAS := *"?<>|()&][$$\#`' + GROUPSUFFIX := .ksh + .MKSARGS := yes + DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) + DIVSEP_shell_yes := \\\ + DIVSEP_shell_no := \\ +.END + +# Standard C-language command names and flags + CC := bcc # C-compiler and flags + CFLAGS += + + AS := tasm # Assembler and flags + ASFLAGS += + + LD = tlink # Loader and flags + LDFLAGS += + LDLIBS = + +# Definition of $(MAKE) macro for recursive makes. + MAKE = $(MAKECMD) $(MFLAGS) + +# Language and Parser generation Tools and their flags + YACC := yacc # standard yacc + YFLAGS += + YTAB := ytab # yacc output files name stem. + + LEX := lex # standard lex + LFLAGS += + LEXYY := lex_yy # lex output file + +# Other Compilers, Tools and their flags + PC := tpc # pascal compiler + RC := anyf77 # ratfor compiler + FC := anyf77 # fortran compiler + + CO := co # check out for RCS + COFLAGS += -q + + AR := ar # archiver + ARFLAGS+= ruv + + RM := rm # remove a file command + RMFLAGS += + +# Implicit generation rules for making inferences. +# We don't provide .yr or .ye rules here. They're obsolete. +# Rules for making *$O + %$O .SWAP: %.c ; $(CC) $(CFLAGS) -c $< + %$O .SWAP: %$P ; $(PC) $(PFLAGS) -c $< + %$O .SWAP: %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); + %$O : %.cl ; class -c $< + %$O .SWAP: %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< + +# Executables + %$E .SWAP: %$O ; $(CC) $(LDFLAGS) -e$@ $< + +# lex and yacc rules + %.c .SWAP: %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ + %.c .SWAP: %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ + +# RCS support +.IF $(_HAVE_RCS) + % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@ + .NOINFER : $$(@:d)RCS/$$(@:f)$V +.END + +# SCCS support +.IF $(_HAVE_SCCS) + % : s.% ; get $< + .NOINFER : s.% +.END + +# Recipe to make archive files. +%$A .SWAP: +[ + $(AR) $(ARFLAGS) $@ $? + $(RM) $(RMFLAGS) $? +] + +# DMAKE uses this recipe to remove intermediate targets +.REMOVE :; $(RM) -f $< + +# AUGMAKE extensions for SYSV compatibility +@B = $(@:b) +@D = $(@:d) +@F = $(@:f) +"*B" = $(*:b) +"*D" = $(*:d) +"*F" = $(*:f) + file_id.diz - echo PDCurses - Public Domain Curses >> file_id.diz - echo Version $(VERDOT) for Borland C++ 3.1 PDC$(VER)BCC.ZIP >> file_id.diz - echo ------------------------------------------ >> file_id.diz - echo Public Domain Curses library for >> file_id.diz - echo Borland C/C++ 3.1. >> file_id.diz - echo Source available in PDCURS$(VER).ZIP >> file_id.diz - echo Public Domain. >> file_id.diz - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz - zip pdc$(VER)bcc *.* - cd .. +################################################################################ +# +# Borland MAKE Makefile for PDCurses library - DOS BC++ 3.0+ +# +# Usage: make -f [path\]bccdos.mak [-DDEBUG] [target] +# +# where target can be any of: +# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] +# +################################################################################ +# +# Change these for your environment... +# +################################################################################ +PDCURSES_HOME =c:\curses +CC_HOME =c:\c +MODEL =l +################################################################################ +# Nothing below here should required changing. +################################################################################ +VER=23 +VERDOT=2.3 + +PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h +PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h +PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PANEL_HEADER =$(PDCURSES_HOME)\panel.h + +CCLIBDIR =$(CC_HOME)\lib +CCINCDIR =$(CC_HOME)\include + +srcdir = $(PDCURSES_HOME)\pdcurses +osdir = $(PDCURSES_HOME)\dos +pandir = $(PDCURSES_HOME)\panel +demodir = $(PDCURSES_HOME)\demos + +CC = bcc + +!if $d(DEBUG) +CFLAGS = -N -v -y -DPDCDEBUG +LDFLAGS = /c /v /s /l /e +!else +CFLAGS = -O +LDFLAGS = +!endif + +CPPFLAGS = -I$(PDCURSES_HOME) -I$(CCINCDIR) + +CCFLAGS = -c +$(osdir)\bccdos.rsp -m$(MODEL) $(CFLAGS) $(CPPFLAGS) + +LINK = tlink + +CCLIBS =$(CCLIBDIR)\c$(MODEL).lib +STARTUP =$(CCLIBDIR)\c0$(MODEL).obj + +LIBEXE = tlib /C /E + +LIBCURSES = pdcurses.lib +LIBPANEL = panel.lib + +PDCLIBS = $(LIBCURSES) $(LIBPANEL) +DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe + +################################################################################ +all: $(PDCLIBS) $(DEMOS) + +clean: + -del *.obj + -del curses.lib + -del panel.lib + -del *.exe + +demos: $(DEMOS) + +#------------------------------------------------------------------------ + +LIBOBJS = \ +addch.obj \ +addchstr.obj \ +addstr.obj \ +attr.obj \ +beep.obj \ +bkgd.obj \ +border.obj \ +clear.obj \ +color.obj \ +delch.obj \ +deleteln.obj \ +getch.obj \ +getstr.obj \ +getyx.obj \ +inch.obj \ +inchstr.obj \ +initscr.obj \ +inopts.obj \ +insch.obj \ +insstr.obj \ +instr.obj \ +kernel.obj \ +mouse.obj \ +move.obj \ +outopts.obj \ +overlay.obj \ +pad.obj \ +printw.obj \ +refresh.obj \ +scanw.obj \ +scroll.obj \ +slk.obj \ +termattr.obj \ +terminfo.obj \ +touch.obj \ +util.obj \ +window.obj + +PDCOBJS = \ +pdcdebug.obj \ +pdcdisp.obj \ +pdcgetsc.obj \ +pdckbd.obj \ +pdcprint.obj \ +pdcscrn.obj \ +pdcsetsc.obj \ +pdcutil.obj \ +pdcwin.obj + +PANOBJS = \ +panel.obj + +pdcurses.lib : $(LIBOBJS) $(PDCOBJS) + $(LIBEXE) $@ @$(osdir)\bccdos.lrf + +panel.lib : $(PANOBJS) + $(LIBEXE) $@ -+$(PANOBJS) + +addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\addch.c + +addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\addchstr.c + +addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\addstr.c + +attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\attr.c + +beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\beep.c + +bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\bkgd.c + +border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\border.c + +clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\clear.c + +color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\color.c + +delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\delch.c + +deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\deleteln.c + +getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\getch.c + +getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\getstr.c + +getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\getyx.c + +inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\inch.c + +inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\inchstr.c + +initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\initscr.c + +inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\inopts.c + +insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\insch.c + +insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\insstr.c + +instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\instr.c + +kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\kernel.c + +mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\mouse.c + +move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\move.c + +outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\outopts.c + +overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\overlay.c + +pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pad.c + +printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\printw.c + +refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\refresh.c + +scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\scanw.c + +scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\scroll.c + +slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\slk.c + +termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\termattr.c + +terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\terminfo.c + +touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\touch.c + +util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\util.c + +window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\window.c + + +pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcdebug.c + +pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcdisp.c + +pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcgetsc.c + +pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdckbd.c + +pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcprint.c + +pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcscrn.c + +pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcsetsc.c + +pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcutil.c + +pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcwin.c + +#------------------------------------------------------------------------ + +panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) + $(CC) $(CCFLAGS) -o$@ $(pandir)\panel.c + +#------------------------------------------------------------------------ + +firework.exe: firework.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj,$*,,$(LIBCURSES)+$(CCLIBS); + +newdemo.exe: newdemo.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj,$*,,$(LIBCURSES)+$(CCLIBS); + +ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj,$*,,$(LIBPANEL)+$(LIBCURSES)+$(CCLIBS); + +testcurs.exe: testcurs.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj,$*,,$(LIBCURSES)+$(CCLIBS); + +tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj+tui.obj,$*,,$(LIBCURSES)+$(CCLIBS); + +xmas.exe: xmas.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj,$*,,$(LIBCURSES)+$(CCLIBS); + + +firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\firework.c + +newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\newdemo.c + +ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\ptest.c + +testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\testcurs.c + +tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) -o$@ $(demodir)\tui.c + +tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) -o$@ $(demodir)\tuidemo.c + +xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\xmas.c + +dist: pdcurses.lib panel.lib + -mkdir tmp + cd tmp + copy $(PDCURSES_HOME)\README README + copy $(PDCURSES_HOME)\readme.?? . + copy $(PDCURSES_HOME)\curses.h . + copy $(PDCURSES_HOME)\curspriv.h . + copy $(PDCURSES_HOME)\maintain.er . + copy ..\pdcurses.lib . + copy ..\panel.lib . + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz + echo PDCurses - Public Domain Curses >> file_id.diz + echo Version $(VERDOT) for Borland C++ 3.1 PDC$(VER)BCC.ZIP >> file_id.diz + echo ------------------------------------------ >> file_id.diz + echo Public Domain Curses library for >> file_id.diz + echo Borland C/C++ 3.1. >> file_id.diz + echo Source available in PDCURS$(VER).ZIP >> file_id.diz + echo Public Domain. >> file_id.diz + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz + zip pdc$(VER)bcc *.* + cd .. diff --git a/dos/bccdos.rsp b/dos/bccdos.rsp index a3b0847c..b14d754f 100644 --- a/dos/bccdos.rsp +++ b/dos/bccdos.rsp @@ -1,10 +1,10 @@ --1- --K --G --rd --d --V --w-eff --j0 --c --P- +-1- +-K +-G +-rd +-d +-V +-w-eff +-j0 +-c +-P- diff --git a/dos/dos-bcc.rsp b/dos/dos-bcc.rsp index a3b0847c..b14d754f 100644 --- a/dos/dos-bcc.rsp +++ b/dos/dos-bcc.rsp @@ -1,10 +1,10 @@ --1- --K --G --rd --d --V --w-eff --j0 --c --P- +-1- +-K +-G +-rd +-d +-V +-w-eff +-j0 +-c +-P- diff --git a/dos/dos-tcc.rsp b/dos/dos-tcc.rsp index a3b0847c..b14d754f 100644 --- a/dos/dos-tcc.rsp +++ b/dos/dos-tcc.rsp @@ -1,10 +1,10 @@ --1- --K --G --rd --d --V --w-eff --j0 --c --P- +-1- +-K +-G +-rd +-d +-V +-w-eff +-j0 +-c +-P- diff --git a/dos/gccdos.lrf b/dos/gccdos.lrf index 560df808..43d39c31 100644 --- a/dos/gccdos.lrf +++ b/dos/gccdos.lrf @@ -1,48 +1,48 @@ --+addch.o & --+addchstr.o & --+addstr.o & --+attr.o & --+beep.o & --+bkgd.o & --+border.o & --+clear.o & --+color.o & --+delch.o & --+deleteln.o & --+getch.o & --+getstr.o & --+getyx.o & --+inch.o & --+inchstr.o & --+initscr.o & --+inopts.o & --+insch.o & --+insstr.o & --+instr.o & --+kernel.o & --+mouse.o & --+move.o & --+outopts.o & --+overlay.o & --+pad.o & --+printw.o & --+refresh.o & --+scanw.o & --+scroll.o & --+slk.o & --+termattr.o & --+terminfo.o & --+touch.o & --+util.o & --+window.o & --+pdcclip.o & --+pdcdebug.o & --+pdcdisp.o & --+pdcgetsc.o & --+pdckbd.o & --+pdcprint.o & --+pdcscrn.o & --+pdcsetsc.o & --+pdcutil.o & --+pdcwin.o & -,lib.map +-+addch.o & +-+addchstr.o & +-+addstr.o & +-+attr.o & +-+beep.o & +-+bkgd.o & +-+border.o & +-+clear.o & +-+color.o & +-+delch.o & +-+deleteln.o & +-+getch.o & +-+getstr.o & +-+getyx.o & +-+inch.o & +-+inchstr.o & +-+initscr.o & +-+inopts.o & +-+insch.o & +-+insstr.o & +-+instr.o & +-+kernel.o & +-+mouse.o & +-+move.o & +-+outopts.o & +-+overlay.o & +-+pad.o & +-+printw.o & +-+refresh.o & +-+scanw.o & +-+scroll.o & +-+slk.o & +-+termattr.o & +-+terminfo.o & +-+touch.o & +-+util.o & +-+window.o & +-+pdcclip.o & +-+pdcdebug.o & +-+pdcdisp.o & +-+pdcgetsc.o & +-+pdckbd.o & +-+pdcprint.o & +-+pdcscrn.o & +-+pdcsetsc.o & +-+pdcutil.o & +-+pdcwin.o & +,lib.map diff --git a/dos/gccdos.mak b/dos/gccdos.mak index bb72cb13..b43c6519 100644 --- a/dos/gccdos.mak +++ b/dos/gccdos.mak @@ -1,361 +1,361 @@ -################################################################################ -# -# GNU MAKE (3.7.3) Makefile for PDCurses library - DOS DJGPP V2.0 -# -# Usage: make -f [path\]gccdos.mak [-DDEBUG] [target] -# -# where target can be any of: -# [all|demos|pdcurses.a|panel.a|testcurs.exe...] -# -################################################################################ -# -# Change these for your environment... -# -################################################################################ -PDCURSES_HOME =c:/curses -PDC_HOME =c:\curses -CC_HOME =d:/djgpp -################################################################################ -# Nothing below here should required changing. -################################################################################ -VER=23 -VERDOT=2.3 - -PDCURSES_CURSES_H =$(PDCURSES_HOME)/curses.h -PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)/curspriv.h -PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) -PANEL_HEADER =$(PDCURSES_HOME)/panel.h - -CCLIBDIR =$(CC_HOME)/lib -CCINCDIR =$(CC_HOME)/include - -srcdir = $(PDCURSES_HOME)/pdcurses -osdir = $(PDCURSES_HOME)/dos -pandir = $(PDCURSES_HOME)/panel -demodir = $(PDCURSES_HOME)/demos - -CC = gcc - -ifeq ($(DEBUG),Y) - CFLAGS = -c -g -Wall -DPDCDEBUG - LDFLAGS = -g -else - CFLAGS = -c -O -Wall - LDFLAGS = -endif - -CPPFLAGS = -I$(PDCURSES_HOME) -I$(CCINCDIR) -D_NAIVE_DOS_REGS - -CCFLAGS = $(CFLAGS) $(CPPFLAGS) - -LINK = gcc -COFF2EXE =coff2exe - -LIBEXE = ar -LIBFLAGS =rcv - -LIBCURSES = pdcurses.a -LIBPANEL = panel.a - -PDCLIBS = $(LIBCURSES) $(LIBPANEL) -DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe - -################################################################################ -all: $(PDCLIBS) $(DEMOS) - -clean: - -del *.o - -del curses.lib - -del panel.lib - -del *.exe - -demos: $(DEMOS) - -#------------------------------------------------------------------------ - -LIBOBJS = \ -addch.o \ -addchstr.o \ -addstr.o \ -attr.o \ -beep.o \ -bkgd.o \ -border.o \ -clear.o \ -color.o \ -delch.o \ -deleteln.o \ -getch.o \ -getstr.o \ -getyx.o \ -inch.o \ -inchstr.o \ -initscr.o \ -inopts.o \ -insch.o \ -insstr.o \ -instr.o \ -kernel.o \ -mouse.o \ -move.o \ -outopts.o \ -overlay.o \ -pad.o \ -printw.o \ -refresh.o \ -scanw.o \ -scroll.o \ -slk.o \ -termattr.o \ -terminfo.o \ -touch.o \ -util.o \ -window.o - -PDCOBJS = \ -pdcclip.o \ -pdcdebug.o \ -pdcdisp.o \ -pdcgetsc.o \ -pdcgo32.o \ -pdckbd.o \ -pdcprint.o \ -pdcscrn.o \ -pdcsetsc.o \ -pdcutil.o \ -pdcwin.o - -PANOBJS = \ -panel.o - -pdcurses.a : $(LIBOBJS) $(PDCOBJS) - $(LIBEXE) $(LIBFLAGS) $@ $(LIBOBJS) $(PDCOBJS) - -panel.a : $(PANOBJS) - $(LIBEXE) $(LIBFLAGS) $@ $(PANOBJS) - -addch.o: $(srcdir)/addch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/addch.c - -addchstr.o: $(srcdir)/addchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/addchstr.c - -addstr.o: $(srcdir)/addstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/addstr.c - -attr.o: $(srcdir)/attr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/attr.c - -beep.o: $(srcdir)/beep.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/beep.c - -bkgd.o: $(srcdir)/bkgd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/bkgd.c - -border.o: $(srcdir)/border.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/border.c - -clear.o: $(srcdir)/clear.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/clear.c - -color.o: $(srcdir)/color.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/color.c - -delch.o: $(srcdir)/delch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/delch.c - -deleteln.o: $(srcdir)/deleteln.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/deleteln.c - -getch.o: $(srcdir)/getch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/getch.c - -getstr.o: $(srcdir)/getstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/getstr.c - -getyx.o: $(srcdir)/getyx.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/getyx.c - -inch.o: $(srcdir)/inch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/inch.c - -inchstr.o: $(srcdir)/inchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/inchstr.c - -initscr.o: $(srcdir)/initscr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/initscr.c - -inopts.o: $(srcdir)/inopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/inopts.c - -insch.o: $(srcdir)/insch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/insch.c - -insstr.o: $(srcdir)/insstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/insstr.c - -instr.o: $(srcdir)/instr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/instr.c - -kernel.o: $(srcdir)/kernel.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/kernel.c - -mouse.o: $(srcdir)/mouse.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/mouse.c - -move.o: $(srcdir)/move.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/move.c - -outopts.o: $(srcdir)/outopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/outopts.c - -overlay.o: $(srcdir)/overlay.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/overlay.c - -pad.o: $(srcdir)/pad.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/pad.c - -printw.o: $(srcdir)/printw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/printw.c - -refresh.o: $(srcdir)/refresh.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/refresh.c - -scanw.o: $(srcdir)/scanw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/scanw.c - -scroll.o: $(srcdir)/scroll.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/scroll.c - -slk.o: $(srcdir)/slk.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/slk.c - -termattr.o: $(srcdir)/termattr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/termattr.c - -terminfo.o: $(srcdir)/terminfo.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/terminfo.c - -touch.o: $(srcdir)/touch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/touch.c - -util.o: $(srcdir)/util.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/util.c - -window.o: $(srcdir)/window.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/window.c - - -pdcclip.o: $(osdir)/pdcclip.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcclip.c - -pdcdebug.o: $(srcdir)/pdcdebug.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/pdcdebug.c - -pdcdisp.o: $(osdir)/pdcdisp.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcdisp.c - -pdcgetsc.o: $(osdir)/pdcgetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcgetsc.c - -pdcgo32.o: $(osdir)/pdcgo32.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcgo32.c - -pdckbd.o: $(osdir)/pdckbd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)/pdckbd.c - -pdcprint.o: $(osdir)/pdcprint.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcprint.c - -pdcscrn.o: $(osdir)/pdcscrn.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcscrn.c - -pdcsetsc.o: $(osdir)/pdcsetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcsetsc.c - -pdcutil.o: $(srcdir)/pdcutil.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/pdcutil.c - -pdcwin.o: $(srcdir)/pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)/pdcwin.c - -#------------------------------------------------------------------------ - -panel.o: $(pandir)/panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) - $(CC) $(CCFLAGS) -o$@ $(pandir)/panel.c - -#------------------------------------------------------------------------ - -firework.exe: firework.o $(LIBCURSES) - $(LINK) $(LDFLAGS) -o firework firework.o $(LIBCURSES) - $(COFF2EXE) firework - strip $@ - -newdemo.exe: newdemo.o $(LIBCURSES) - $(LINK) $(LDFLAGS) -o newdemo newdemo.o $(LIBCURSES) - $(COFF2EXE) newdemo - strip $@ - -ptest.exe: ptest.o $(LIBCURSES) $(LIBPANEL) - $(LINK) $(LDFLAGS) -o ptest ptest.o $(LIBCURSES) $(LIBPANEL) - $(COFF2EXE) ptest - strip $@ - -testcurs.exe: testcurs.o $(LIBCURSES) - $(LINK) $(LDFLAGS) -o testcurs testcurs.o $(LIBCURSES) - $(COFF2EXE) testcurs - strip $@ - -tuidemo.exe: tuidemo.o tui.o $(LIBCURSES) - $(LINK) $(LDFLAGS) -o tuidemo tuidemo.o tui.o $(LIBCURSES) - $(COFF2EXE) tuidemo - strip $@ - -xmas.exe: xmas.o $(LIBCURSES) - $(LINK) $(LDFLAGS) -o xmas xmas.o $(LIBCURSES) - $(COFF2EXE) xmas - strip $@ - - -firework.o: $(demodir)/firework.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o$@ $(demodir)/firework.c - -newdemo.o: $(demodir)/newdemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o$@ $(demodir)/newdemo.c - -ptest.o: $(demodir)/ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o$@ $(demodir)/ptest.c - -testcurs.o: $(demodir)/testcurs.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o$@ $(demodir)/testcurs.c - -tui.o: $(demodir)/tui.c $(demodir)/tui.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -I$(demodir) -o $@ $(demodir)/tui.c - -tuidemo.o: $(demodir)/tuidemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -I$(demodir) -o $@ $(demodir)/tuidemo.c - -xmas.o: $(demodir)/xmas.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o$@ $(demodir)/xmas.c - -dist: pdcurses.a panel.a - -mkdir tmp - cd tmp - copy $(PDC_HOME)\README README - copy $(PDC_HOME)\readme.?? . - copy $(PDC_HOME)\curses.h . - copy $(PDC_HOME)\curspriv.h . - copy $(PDC_HOME)\maintain.er . - copy ..\pdcurses.a . - copy ..\panel.a . - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz - echo PDCurses - Public Domain Curses >> file_id.diz - echo Version $(VERDOT) for DJGPP 2.0 PDC$(VER)DJG.ZIP >> file_id.diz - echo ------------------------------------------ >> file_id.diz - echo Public Domain Curses library for >> file_id.diz - echo DJGPP 2.0. >> file_id.diz - echo Source available in PDCURS$(VER).ZIP >> file_id.diz - echo Public Domain. >> file_id.diz - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz - zip pdc$(VER)djg *.* - cd .. +################################################################################ +# +# GNU MAKE (3.7.3) Makefile for PDCurses library - DOS DJGPP V2.0 +# +# Usage: make -f [path\]gccdos.mak [-DDEBUG] [target] +# +# where target can be any of: +# [all|demos|pdcurses.a|panel.a|testcurs.exe...] +# +################################################################################ +# +# Change these for your environment... +# +################################################################################ +PDCURSES_HOME =c:/curses +PDC_HOME =c:\curses +CC_HOME =d:/djgpp +################################################################################ +# Nothing below here should required changing. +################################################################################ +VER=23 +VERDOT=2.3 + +PDCURSES_CURSES_H =$(PDCURSES_HOME)/curses.h +PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)/curspriv.h +PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PANEL_HEADER =$(PDCURSES_HOME)/panel.h + +CCLIBDIR =$(CC_HOME)/lib +CCINCDIR =$(CC_HOME)/include + +srcdir = $(PDCURSES_HOME)/pdcurses +osdir = $(PDCURSES_HOME)/dos +pandir = $(PDCURSES_HOME)/panel +demodir = $(PDCURSES_HOME)/demos + +CC = gcc + +ifeq ($(DEBUG),Y) + CFLAGS = -c -g -Wall -DPDCDEBUG + LDFLAGS = -g +else + CFLAGS = -c -O -Wall + LDFLAGS = +endif + +CPPFLAGS = -I$(PDCURSES_HOME) -I$(CCINCDIR) -D_NAIVE_DOS_REGS + +CCFLAGS = $(CFLAGS) $(CPPFLAGS) + +LINK = gcc +COFF2EXE =coff2exe + +LIBEXE = ar +LIBFLAGS =rcv + +LIBCURSES = pdcurses.a +LIBPANEL = panel.a + +PDCLIBS = $(LIBCURSES) $(LIBPANEL) +DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe + +################################################################################ +all: $(PDCLIBS) $(DEMOS) + +clean: + -del *.o + -del curses.lib + -del panel.lib + -del *.exe + +demos: $(DEMOS) + +#------------------------------------------------------------------------ + +LIBOBJS = \ +addch.o \ +addchstr.o \ +addstr.o \ +attr.o \ +beep.o \ +bkgd.o \ +border.o \ +clear.o \ +color.o \ +delch.o \ +deleteln.o \ +getch.o \ +getstr.o \ +getyx.o \ +inch.o \ +inchstr.o \ +initscr.o \ +inopts.o \ +insch.o \ +insstr.o \ +instr.o \ +kernel.o \ +mouse.o \ +move.o \ +outopts.o \ +overlay.o \ +pad.o \ +printw.o \ +refresh.o \ +scanw.o \ +scroll.o \ +slk.o \ +termattr.o \ +terminfo.o \ +touch.o \ +util.o \ +window.o + +PDCOBJS = \ +pdcclip.o \ +pdcdebug.o \ +pdcdisp.o \ +pdcgetsc.o \ +pdcgo32.o \ +pdckbd.o \ +pdcprint.o \ +pdcscrn.o \ +pdcsetsc.o \ +pdcutil.o \ +pdcwin.o + +PANOBJS = \ +panel.o + +pdcurses.a : $(LIBOBJS) $(PDCOBJS) + $(LIBEXE) $(LIBFLAGS) $@ $(LIBOBJS) $(PDCOBJS) + +panel.a : $(PANOBJS) + $(LIBEXE) $(LIBFLAGS) $@ $(PANOBJS) + +addch.o: $(srcdir)/addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/addch.c + +addchstr.o: $(srcdir)/addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/addchstr.c + +addstr.o: $(srcdir)/addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/addstr.c + +attr.o: $(srcdir)/attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/attr.c + +beep.o: $(srcdir)/beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/beep.c + +bkgd.o: $(srcdir)/bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/bkgd.c + +border.o: $(srcdir)/border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/border.c + +clear.o: $(srcdir)/clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/clear.c + +color.o: $(srcdir)/color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/color.c + +delch.o: $(srcdir)/delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/delch.c + +deleteln.o: $(srcdir)/deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/deleteln.c + +getch.o: $(srcdir)/getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/getch.c + +getstr.o: $(srcdir)/getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/getstr.c + +getyx.o: $(srcdir)/getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/getyx.c + +inch.o: $(srcdir)/inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/inch.c + +inchstr.o: $(srcdir)/inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/inchstr.c + +initscr.o: $(srcdir)/initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/initscr.c + +inopts.o: $(srcdir)/inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/inopts.c + +insch.o: $(srcdir)/insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/insch.c + +insstr.o: $(srcdir)/insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/insstr.c + +instr.o: $(srcdir)/instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/instr.c + +kernel.o: $(srcdir)/kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/kernel.c + +mouse.o: $(srcdir)/mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/mouse.c + +move.o: $(srcdir)/move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/move.c + +outopts.o: $(srcdir)/outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/outopts.c + +overlay.o: $(srcdir)/overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/overlay.c + +pad.o: $(srcdir)/pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/pad.c + +printw.o: $(srcdir)/printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/printw.c + +refresh.o: $(srcdir)/refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/refresh.c + +scanw.o: $(srcdir)/scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/scanw.c + +scroll.o: $(srcdir)/scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/scroll.c + +slk.o: $(srcdir)/slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/slk.c + +termattr.o: $(srcdir)/termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/termattr.c + +terminfo.o: $(srcdir)/terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/terminfo.c + +touch.o: $(srcdir)/touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/touch.c + +util.o: $(srcdir)/util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/util.c + +window.o: $(srcdir)/window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/window.c + + +pdcclip.o: $(osdir)/pdcclip.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcclip.c + +pdcdebug.o: $(srcdir)/pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/pdcdebug.c + +pdcdisp.o: $(osdir)/pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcdisp.c + +pdcgetsc.o: $(osdir)/pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcgetsc.c + +pdcgo32.o: $(osdir)/pdcgo32.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcgo32.c + +pdckbd.o: $(osdir)/pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)/pdckbd.c + +pdcprint.o: $(osdir)/pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcprint.c + +pdcscrn.o: $(osdir)/pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcscrn.c + +pdcsetsc.o: $(osdir)/pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)/pdcsetsc.c + +pdcutil.o: $(srcdir)/pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/pdcutil.c + +pdcwin.o: $(srcdir)/pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)/pdcwin.c + +#------------------------------------------------------------------------ + +panel.o: $(pandir)/panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) + $(CC) $(CCFLAGS) -o$@ $(pandir)/panel.c + +#------------------------------------------------------------------------ + +firework.exe: firework.o $(LIBCURSES) + $(LINK) $(LDFLAGS) -o firework firework.o $(LIBCURSES) + $(COFF2EXE) firework + strip $@ + +newdemo.exe: newdemo.o $(LIBCURSES) + $(LINK) $(LDFLAGS) -o newdemo newdemo.o $(LIBCURSES) + $(COFF2EXE) newdemo + strip $@ + +ptest.exe: ptest.o $(LIBCURSES) $(LIBPANEL) + $(LINK) $(LDFLAGS) -o ptest ptest.o $(LIBCURSES) $(LIBPANEL) + $(COFF2EXE) ptest + strip $@ + +testcurs.exe: testcurs.o $(LIBCURSES) + $(LINK) $(LDFLAGS) -o testcurs testcurs.o $(LIBCURSES) + $(COFF2EXE) testcurs + strip $@ + +tuidemo.exe: tuidemo.o tui.o $(LIBCURSES) + $(LINK) $(LDFLAGS) -o tuidemo tuidemo.o tui.o $(LIBCURSES) + $(COFF2EXE) tuidemo + strip $@ + +xmas.exe: xmas.o $(LIBCURSES) + $(LINK) $(LDFLAGS) -o xmas xmas.o $(LIBCURSES) + $(COFF2EXE) xmas + strip $@ + + +firework.o: $(demodir)/firework.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)/firework.c + +newdemo.o: $(demodir)/newdemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)/newdemo.c + +ptest.o: $(demodir)/ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)/ptest.c + +testcurs.o: $(demodir)/testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)/testcurs.c + +tui.o: $(demodir)/tui.c $(demodir)/tui.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) -o $@ $(demodir)/tui.c + +tuidemo.o: $(demodir)/tuidemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) -o $@ $(demodir)/tuidemo.c + +xmas.o: $(demodir)/xmas.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)/xmas.c + +dist: pdcurses.a panel.a + -mkdir tmp + cd tmp + copy $(PDC_HOME)\README README + copy $(PDC_HOME)\readme.?? . + copy $(PDC_HOME)\curses.h . + copy $(PDC_HOME)\curspriv.h . + copy $(PDC_HOME)\maintain.er . + copy ..\pdcurses.a . + copy ..\panel.a . + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz + echo PDCurses - Public Domain Curses >> file_id.diz + echo Version $(VERDOT) for DJGPP 2.0 PDC$(VER)DJG.ZIP >> file_id.diz + echo ------------------------------------------ >> file_id.diz + echo Public Domain Curses library for >> file_id.diz + echo DJGPP 2.0. >> file_id.diz + echo Source available in PDCURS$(VER).ZIP >> file_id.diz + echo Public Domain. >> file_id.diz + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz + zip pdc$(VER)djg *.* + cd .. diff --git a/dos/mscdos.ini b/dos/mscdos.ini index e405934f..a1ea0f2b 100644 --- a/dos/mscdos.ini +++ b/dos/mscdos.ini @@ -1,154 +1,154 @@ -# MSDOS DMAKE startup file. Customize to suit your needs. -# Assumes MKS toolkit for the tool commands, and Microsoft C. Change as req'd. -# See the documentation for a description of internally defined macros. -# -# Disable warnings for macros redefined here that were given -# on the command line. -__.SILENT := $(.SILENT) -.SILENT := yes - -# Configuration parameters for DMAKE startup.mk file -# Set these to NON-NULL if you wish to turn the parameter on. -_HAVE_RCS := yes # yes => RCS is installed. -_HAVE_SCCS := # yes => SCCS is installed. - -# Applicable suffix definitions -A := .lib # Libraries -E := .exe # Executables -F := .for # Fortran -O := .obj # Objects -P := .pas # Pascal -S := .asm # Assembler sources -V := # RCS suffix - -# See if these are defined -TMPDIR := $(ROOTDIR)/tmp -.IMPORT .IGNORE : TMPDIR SHELL COMSPEC - -# Recipe execution configurations -# First set SHELL, If it is not defined, use COMSPEC, otherwise -# it is assumed to be MKS Korn SHELL. -.IF $(SHELL) == $(NULL) -.IF $(COMSPEC) == $(NULL) - SHELL := $(ROOTDIR)/bin/sh$E -.ELSE - SHELL := $(COMSPEC) -.END -.END -GROUPSHELL := $(SHELL) - -# Now set remaining arguments depending on which SHELL we -# are going to use. COMSPEC (assumed to be command.com) or -# MKS Korn Shell. -.IF $(SHELL)==$(COMSPEC) - SHELLFLAGS := $(SWITCHAR)c - GROUPFLAGS := $(SHELLFLAGS) - SHELLMETAS := *"?<> - GROUPSUFFIX := .bat - DIRSEPSTR := \\ - DIVFILE = $(TMPFILE:s,/,\) -.ELSE - SHELLFLAGS := -c - GROUPFLAGS := - SHELLMETAS := *"?<>|()&][$$\#`' - GROUPSUFFIX := .ksh - .MKSARGS := yes - DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) - DIVSEP_shell_yes := \\\ - DIVSEP_shell_no := \\ -.END - -# Standard C-language command names and flags - CC := cl # C-compiler and flags - CFLAGS += - - AS := masm # Assembler and flags - ASFLAGS += - - LD = link # Loader and flags - LDFLAGS += - LDLIBS = - -# Definition of $(MAKE) macro for recursive makes. - MAKE = $(MAKECMD) $(MFLAGS) - -# Language and Parser generation Tools and their flags - YACC := yacc # standard yacc - YFLAGS += - YTAB := ytab # yacc output files name stem. - - LEX := lex # standard lex - LFLAGS += - LEXYY := lex_yy # lex output file - -# Other Compilers, Tools and their flags - PC := any_pc # pascal compiler - RC := anyf77 # ratfor compiler - FC := anyf77 # fortran compiler - - CO := co # check out for RCS - COFLAGS += -q - - AR := ar # archiver - ARFLAGS+= ruv - - RM := rm # remove a file command - RMFLAGS += - -# Implicit generation rules for making inferences. -# We don't provide .yr or .ye rules here. They're obsolete. -# Rules for making *$O - %$O : %.c ; $(CC) $(CFLAGS) -c $< - %$O : %$P ; $(PC) $(PFLAGS) -c $< - %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); - %$O : %.cl ; class -c $< - %$O : %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< - -# Executables - %$E : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS) - -# lex and yacc rules - %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ - %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ - -# RCS support -.IF $(_HAVE_RCS) - % : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V;- $(CO) $(COFLAGS) $@ - .NOINFER : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V -.END - -# SCCS support -.IF $(_HAVE_SCCS) - % : s.% ; get $< - .NOINFER : s.% -.END - -# Recipe to make archive files. -%$A : -[ - $(AR) $(ARFLAGS) $@ $? - $(RM) $(RMFLAGS) $? -] - -# DMAKE uses this recipe to remove intermediate targets -.REMOVE :; $(RM) -f $< - -# AUGMAKE extensions for SYSV compatibility -@B = $(@:b) -@D = $(@:d) -@F = $(@:f) -"*B" = $(*:b) -"*D" = $(*:d) -"*F" = $(*:f) - RCS is installed. +_HAVE_SCCS := # yes => SCCS is installed. + +# Applicable suffix definitions +A := .lib # Libraries +E := .exe # Executables +F := .for # Fortran +O := .obj # Objects +P := .pas # Pascal +S := .asm # Assembler sources +V := # RCS suffix + +# See if these are defined +TMPDIR := $(ROOTDIR)/tmp +.IMPORT .IGNORE : TMPDIR SHELL COMSPEC + +# Recipe execution configurations +# First set SHELL, If it is not defined, use COMSPEC, otherwise +# it is assumed to be MKS Korn SHELL. +.IF $(SHELL) == $(NULL) +.IF $(COMSPEC) == $(NULL) + SHELL := $(ROOTDIR)/bin/sh$E +.ELSE + SHELL := $(COMSPEC) +.END +.END +GROUPSHELL := $(SHELL) + +# Now set remaining arguments depending on which SHELL we +# are going to use. COMSPEC (assumed to be command.com) or +# MKS Korn Shell. +.IF $(SHELL)==$(COMSPEC) + SHELLFLAGS := $(SWITCHAR)c + GROUPFLAGS := $(SHELLFLAGS) + SHELLMETAS := *"?<> + GROUPSUFFIX := .bat + DIRSEPSTR := \\ + DIVFILE = $(TMPFILE:s,/,\) +.ELSE + SHELLFLAGS := -c + GROUPFLAGS := + SHELLMETAS := *"?<>|()&][$$\#`' + GROUPSUFFIX := .ksh + .MKSARGS := yes + DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) + DIVSEP_shell_yes := \\\ + DIVSEP_shell_no := \\ +.END + +# Standard C-language command names and flags + CC := cl # C-compiler and flags + CFLAGS += + + AS := masm # Assembler and flags + ASFLAGS += + + LD = link # Loader and flags + LDFLAGS += + LDLIBS = + +# Definition of $(MAKE) macro for recursive makes. + MAKE = $(MAKECMD) $(MFLAGS) + +# Language and Parser generation Tools and their flags + YACC := yacc # standard yacc + YFLAGS += + YTAB := ytab # yacc output files name stem. + + LEX := lex # standard lex + LFLAGS += + LEXYY := lex_yy # lex output file + +# Other Compilers, Tools and their flags + PC := any_pc # pascal compiler + RC := anyf77 # ratfor compiler + FC := anyf77 # fortran compiler + + CO := co # check out for RCS + COFLAGS += -q + + AR := ar # archiver + ARFLAGS+= ruv + + RM := rm # remove a file command + RMFLAGS += + +# Implicit generation rules for making inferences. +# We don't provide .yr or .ye rules here. They're obsolete. +# Rules for making *$O + %$O : %.c ; $(CC) $(CFLAGS) -c $< + %$O : %$P ; $(PC) $(PFLAGS) -c $< + %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); + %$O : %.cl ; class -c $< + %$O : %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< + +# Executables + %$E : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS) + +# lex and yacc rules + %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ + %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ + +# RCS support +.IF $(_HAVE_RCS) + % : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V;- $(CO) $(COFLAGS) $@ + .NOINFER : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V +.END + +# SCCS support +.IF $(_HAVE_SCCS) + % : s.% ; get $< + .NOINFER : s.% +.END + +# Recipe to make archive files. +%$A : +[ + $(AR) $(ARFLAGS) $@ $? + $(RM) $(RMFLAGS) $? +] + +# DMAKE uses this recipe to remove intermediate targets +.REMOVE :; $(RM) -f $< + +# AUGMAKE extensions for SYSV compatibility +@B = $(@:b) +@D = $(@:d) +@F = $(@:f) +"*B" = $(*:b) +"*D" = $(*:d) +"*F" = $(*:f) + file_id.diz - echo PDCurses - Public Domain Curses >> file_id.diz - echo Version $(VERDOT) for Microsoft C++ 6.0 PDC$(VER)MSC.ZIP >> file_id.diz - echo ------------------------------------------ >> file_id.diz - echo Public Domain Curses library for >> file_id.diz - echo Microsoft C/C++ 6.0. >> file_id.diz - echo Source available in PDCURS$(VER).ZIP >> file_id.diz - echo Public Domain. >> file_id.diz - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz - zip pdc$(VER)msc *.* - cd .. +################################################################################ +# +# NMAKE Makefile for PDCurses library - DOS MSC +# +# Usage: nmake -f [path\]dosmsc.mak [DEBUG=1] [target] +# +# where target can be any of: +# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] +# +################################################################################ +# +# Change these for your environment... +# +################################################################################ +PDCURSES_HOME =c:\curses +CC_HOME =c:\c600 +MODEL =L # one of L, S, M, T, H, C +SIZE =LARGE # one of LARGE, SMALL, MEDIUM, TINY, HUGE, COMPACT +################################################################################ +# Nothing below here should required changing. +################################################################################ +VER=23 +VERDOT=2.3 + + +PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h +PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h +PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PANEL_HEADER =$(PDCURSES_HOME)\panel.h + +CCLIBDIR =$(ICC_HOME)\lib + +srcdir = $(PDCURSES_HOME)\pdcurses +osdir = $(PDCURSES_HOME)\dos +pandir = $(PDCURSES_HOME)\panel +demodir = $(PDCURSES_HOME)\demos + +CC = cl + +!ifdef DEBUG +CFLAGS = /nologo /Od /Zi /DPDCDEBUG +LDFLAGS = /CO /NOE /SE:160 +!else +CFLAGS = /Ox +LDFLAGS = /NOE /SE:160 +!endif + +CPPFLAGS = -I$(PDCURSES_HOME) + +CCFLAGS = /J /nologo /c /EM /D$(SIZE) /A$(MODEL) $(CFLAGS) $(CPPFLAGS) + +LINK = link + +CCLIBS = + +LIBEXE = lib + +LIBCURSES = pdcurses.lib +LIBPANEL = panel.lib + +LIBRARIES = $(LIBCURSES) $(LIBPANEL) +DEMOS = testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe + +################################################################################ +all: $(LIBRARIES) $(DEMOS) + +clean: + -del *.obj + -del curses.lib + -del panel.lib + -del *.exe + +demos: $(DEMOS) + +#------------------------------------------------------------------------ + +LIBOBJS = \ +addch.obj \ +addchstr.obj \ +addstr.obj \ +attr.obj \ +beep.obj \ +bkgd.obj \ +border.obj \ +clear.obj \ +color.obj \ +delch.obj \ +deleteln.obj \ +getch.obj \ +getstr.obj \ +getyx.obj \ +inch.obj \ +inchstr.obj \ +initscr.obj \ +inopts.obj \ +insch.obj \ +insstr.obj \ +instr.obj \ +kernel.obj \ +mouse.obj \ +move.obj \ +outopts.obj \ +overlay.obj \ +pad.obj \ +printw.obj \ +refresh.obj \ +scanw.obj \ +scroll.obj \ +slk.obj \ +termattr.obj \ +terminfo.obj \ +touch.obj \ +util.obj \ +window.obj + +PDCOBJS = \ +pdcclip.obj \ +pdcdebug.obj \ +pdcdisp.obj \ +pdcgetsc.obj \ +pdckbd.obj \ +pdcprint.obj \ +pdcscrn.obj \ +pdcsetsc.obj \ +pdcutil.obj \ +pdcwin.obj + +PANOBJS = \ +panel.obj + +pdcurses.lib : $(LIBOBJS) $(PDCOBJS) + $(LIBEXE) $@ @$(osdir)\mscdos.lrf + +panel.lib : $(PANOBJS) + $(LIBEXE) $@ -+$(PANOBJS); + +addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addch.c + +addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addchstr.c + +addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addstr.c + +attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\attr.c + +beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\beep.c + +bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\bkgd.c + +border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\border.c + +clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\clear.c + +color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\color.c + +delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\delch.c + +deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\deleteln.c + +getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getch.c + +getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getstr.c + +getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getyx.c + +inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inch.c + +inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inchstr.c + +initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\initscr.c + +inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inopts.c + +insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\insch.c + +insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\insstr.c + +instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\instr.c + +kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\kernel.c + +mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\mouse.c + +move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\move.c + +outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\outopts.c + +overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\overlay.c + +pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pad.c + +printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\printw.c + +refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\refresh.c + +scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\scanw.c + +scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\scroll.c + +slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\slk.c + +termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\termattr.c + +terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\terminfo.c + +touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\touch.c + +util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\util.c + +window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\window.c + + +pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcclip.c + +pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcdebug.c + +pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcdisp.c + +pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcgetsc.c + +pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdckbd.c + +pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcprint.c + +pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcscrn.c + +pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcsetsc.c + +pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcutil.c + +pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcwin.c + +#------------------------------------------------------------------------ + +panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) + $(CC) $(CCFLAGS) -Fo$@ $(pandir)\panel.c + +#------------------------------------------------------------------------ +# DLFLAGS = $(LDEBUG) $*$(OBJ),$*,,$(PDCLIB); +# PANFLAGS = $(LDEBUG) $*$(OBJ),$*,,$(PDCLIB)+$(PANLIB); +# $(LINK) $*.obj,$*.exe,$*.map,$(CCLIBS)+$(LIBCURSES) $(LDFLAGS); + +firework.exe: firework.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + +newdemo.exe: newdemo.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + +ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBPANEL)+$(LIBCURSES); + +testcurs.exe: testcurs.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + +tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj+tui.obj,$*,,$(LIBCURSES); + +xmas.exe: xmas.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + + +firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\firework.c + +newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\newdemo.c + +ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\ptest.c + +testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\testcurs.c + +tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\tui.c + +tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\tuidemo.c + +xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\xmas.c + +dist: pdcurses.lib panel.lib + -mkdir tmp + cd tmp + copy $(PDCURSES_HOME)\README README + copy $(PDCURSES_HOME)\readme.?? . + copy $(PDCURSES_HOME)\curses.h . + copy $(PDCURSES_HOME)\curspriv.h . + copy $(PDCURSES_HOME)\maintain.er . + copy ..\pdcurses.lib . + copy ..\panel.lib . + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz + echo PDCurses - Public Domain Curses >> file_id.diz + echo Version $(VERDOT) for Microsoft C++ 6.0 PDC$(VER)MSC.ZIP >> file_id.diz + echo ------------------------------------------ >> file_id.diz + echo Public Domain Curses library for >> file_id.diz + echo Microsoft C/C++ 6.0. >> file_id.diz + echo Source available in PDCURS$(VER).ZIP >> file_id.diz + echo Public Domain. >> file_id.diz + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz + zip pdc$(VER)msc *.* + cd .. diff --git a/dos/msvcdos.mak b/dos/msvcdos.mak index a144cfa0..90107a63 100644 --- a/dos/msvcdos.mak +++ b/dos/msvcdos.mak @@ -1,348 +1,348 @@ -################################################################################ -# -# NMAKE Makefile for PDCurses library - DOS MS Visual C++ 1.0 -# -# Usage: nmake -f [path\]dosmsc.mak [DEBUG=1] [target] -# -# where target can be any of: -# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] -# -################################################################################ -# -# Change these for your environment... -# -################################################################################ -PDCURSES_HOME =c:\curses -CC_HOME =l:\msvc -MODEL =L # one of L, S, M, T, H, C -SIZE =LARGE # one of LARGE, SMALL, MEDIUM, TINY, HUGE, COMPACT -################################################################################ -# Nothing below here should required changing. -################################################################################ -VER=23 -VERDOT=2.3 - -PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h -PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h -PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) -PANEL_HEADER =$(PDCURSES_HOME)\panel.h - -CCLIBDIR =$(ICC_HOME)\lib - -srcdir = $(PDCURSES_HOME)\pdcurses -osdir = $(PDCURSES_HOME)\dos -pandir = $(PDCURSES_HOME)\panel -demodir = $(PDCURSES_HOME)\demos - -CC = cl - -!ifdef DEBUG -CFLAGS = /nologo /Od /Zi /DPDCDEBUG -LDFLAGS = /CO /NOE /SE:160 -!else -CFLAGS = /Ox -LDFLAGS = /NOE /SE:160 -!endif - -CPPFLAGS = -I$(PDCURSES_HOME) - -CCFLAGS = /J /nologo /c /D$(SIZE) /A$(MODEL) $(CFLAGS) $(CPPFLAGS) - -LINK = link - -CCLIBS = - -LIBEXE = lib - -LIBCURSES = pdcurses.lib -LIBPANEL = panel.lib - -LIBRARIES = $(LIBCURSES) $(LIBPANEL) -DEMOS = testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe - -################################################################################ -all: $(LIBRARIES) $(DEMOS) - -clean: - -del *.obj - -del curses.lib - -del panel.lib - -del *.exe - -demos: $(DEMOS) - -#------------------------------------------------------------------------ - -LIBOBJS = \ -addch.obj \ -addchstr.obj \ -addstr.obj \ -attr.obj \ -beep.obj \ -bkgd.obj \ -border.obj \ -clear.obj \ -color.obj \ -delch.obj \ -deleteln.obj \ -getch.obj \ -getstr.obj \ -getyx.obj \ -inch.obj \ -inchstr.obj \ -initscr.obj \ -inopts.obj \ -insch.obj \ -insstr.obj \ -instr.obj \ -kernel.obj \ -mouse.obj \ -move.obj \ -outopts.obj \ -overlay.obj \ -pad.obj \ -printw.obj \ -refresh.obj \ -scanw.obj \ -scroll.obj \ -slk.obj \ -termattr.obj \ -terminfo.obj \ -touch.obj \ -util.obj \ -window.obj - -PDCOBJS = \ -pdcclip.obj \ -pdcdebug.obj \ -pdcdisp.obj \ -pdcgetsc.obj \ -pdckbd.obj \ -pdcprint.obj \ -pdcscrn.obj \ -pdcsetsc.obj \ -pdcutil.obj \ -pdcwin.obj - -PANOBJS = \ -panel.obj - -pdcurses.lib : $(LIBOBJS) $(PDCOBJS) - $(LIBEXE) $@ @$(osdir)\mscdos.lrf - -panel.lib : $(PANOBJS) - $(LIBEXE) $@ -+$(PANOBJS); - -addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addch.c - -addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addchstr.c - -addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addstr.c - -attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\attr.c - -beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\beep.c - -bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\bkgd.c - -border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\border.c - -clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\clear.c - -color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\color.c - -delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\delch.c - -deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\deleteln.c - -getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getch.c - -getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getstr.c - -getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getyx.c - -inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inch.c - -inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inchstr.c - -initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\initscr.c - -inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inopts.c - -insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\insch.c - -insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\insstr.c - -instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\instr.c - -kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\kernel.c - -mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\mouse.c - -move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\move.c - -outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\outopts.c - -overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\overlay.c - -pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pad.c - -printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\printw.c - -refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\refresh.c - -scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\scanw.c - -scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\scroll.c - -slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\slk.c - -termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\termattr.c - -terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\terminfo.c - -touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\touch.c - -util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\util.c - -window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\window.c - - -pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcclip.c - -pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcdebug.c - -pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcdisp.c - -pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcgetsc.c - -pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdckbd.c - -pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcprint.c - -pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcscrn.c - -pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcsetsc.c - -pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcutil.c - -pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcwin.c - -#------------------------------------------------------------------------ - -panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) - $(CC) $(CCFLAGS) -Fo$@ $(pandir)\panel.c - -#------------------------------------------------------------------------ -# DLFLAGS = $(LDEBUG) $*$(OBJ),$*,,$(PDCLIB); -# PANFLAGS = $(LDEBUG) $*$(OBJ),$*,,$(PDCLIB)+$(PANLIB); -# $(LINK) $*.obj,$*.exe,$*.map,$(CCLIBS)+$(LIBCURSES) $(LDFLAGS); - -firework.exe: firework.obj $(LIBCURSES) - $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); - -newdemo.exe: newdemo.obj $(LIBCURSES) - $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); - -ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) - $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBPANEL)+$(LIBCURSES); - -testcurs.exe: testcurs.obj $(LIBCURSES) - $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); - -tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) - $(LINK) $(LDFLAGS) $*.obj+tui.obj,$*,,$(LIBCURSES); - -xmas.exe: xmas.obj $(LIBCURSES) - $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); - - -firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -Fo$@ $(demodir)\firework.c - -newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -Fo$@ $(demodir)\newdemo.c - -ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -Fo$@ $(demodir)\ptest.c - -testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -Fo$@ $(demodir)\testcurs.c - -tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -Fo$@ $(demodir)\tui.c - -tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -Fo$@ $(demodir)\tuidemo.c - -xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -Fo$@ $(demodir)\xmas.c - -dist: pdcurses.lib panel.lib - -mkdir tmp - cd tmp - copy $(PDCURSES_HOME)\README README - copy $(PDCURSES_HOME)\readme.?? . - copy $(PDCURSES_HOME)\curses.h . - copy $(PDCURSES_HOME)\curspriv.h . - copy $(PDCURSES_HOME)\maintain.er . - copy ..\pdcurses.lib . - copy ..\panel.lib . - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz - echo PDCurses - Public Domain Curses >> file_id.diz - echo Version $(VERDOT) for Microsoft Visual C++ 1.0 PDC$(VER)VCD.ZIP >> file_id.diz - echo ------------------------------------------ >> file_id.diz - echo Public Domain Curses library for >> file_id.diz - echo Microsoft Visual C/C++ 1.0 for DOS. >> file_id.diz - echo Source available in PDCURS$(VER).ZIP >> file_id.diz - echo Public Domain. >> file_id.diz - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz - zip pdc$(VER)vcd *.* - cd .. +################################################################################ +# +# NMAKE Makefile for PDCurses library - DOS MS Visual C++ 1.0 +# +# Usage: nmake -f [path\]dosmsc.mak [DEBUG=1] [target] +# +# where target can be any of: +# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] +# +################################################################################ +# +# Change these for your environment... +# +################################################################################ +PDCURSES_HOME =c:\curses +CC_HOME =l:\msvc +MODEL =L # one of L, S, M, T, H, C +SIZE =LARGE # one of LARGE, SMALL, MEDIUM, TINY, HUGE, COMPACT +################################################################################ +# Nothing below here should required changing. +################################################################################ +VER=23 +VERDOT=2.3 + +PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h +PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h +PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PANEL_HEADER =$(PDCURSES_HOME)\panel.h + +CCLIBDIR =$(ICC_HOME)\lib + +srcdir = $(PDCURSES_HOME)\pdcurses +osdir = $(PDCURSES_HOME)\dos +pandir = $(PDCURSES_HOME)\panel +demodir = $(PDCURSES_HOME)\demos + +CC = cl + +!ifdef DEBUG +CFLAGS = /nologo /Od /Zi /DPDCDEBUG +LDFLAGS = /CO /NOE /SE:160 +!else +CFLAGS = /Ox +LDFLAGS = /NOE /SE:160 +!endif + +CPPFLAGS = -I$(PDCURSES_HOME) + +CCFLAGS = /J /nologo /c /D$(SIZE) /A$(MODEL) $(CFLAGS) $(CPPFLAGS) + +LINK = link + +CCLIBS = + +LIBEXE = lib + +LIBCURSES = pdcurses.lib +LIBPANEL = panel.lib + +LIBRARIES = $(LIBCURSES) $(LIBPANEL) +DEMOS = testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe + +################################################################################ +all: $(LIBRARIES) $(DEMOS) + +clean: + -del *.obj + -del curses.lib + -del panel.lib + -del *.exe + +demos: $(DEMOS) + +#------------------------------------------------------------------------ + +LIBOBJS = \ +addch.obj \ +addchstr.obj \ +addstr.obj \ +attr.obj \ +beep.obj \ +bkgd.obj \ +border.obj \ +clear.obj \ +color.obj \ +delch.obj \ +deleteln.obj \ +getch.obj \ +getstr.obj \ +getyx.obj \ +inch.obj \ +inchstr.obj \ +initscr.obj \ +inopts.obj \ +insch.obj \ +insstr.obj \ +instr.obj \ +kernel.obj \ +mouse.obj \ +move.obj \ +outopts.obj \ +overlay.obj \ +pad.obj \ +printw.obj \ +refresh.obj \ +scanw.obj \ +scroll.obj \ +slk.obj \ +termattr.obj \ +terminfo.obj \ +touch.obj \ +util.obj \ +window.obj + +PDCOBJS = \ +pdcclip.obj \ +pdcdebug.obj \ +pdcdisp.obj \ +pdcgetsc.obj \ +pdckbd.obj \ +pdcprint.obj \ +pdcscrn.obj \ +pdcsetsc.obj \ +pdcutil.obj \ +pdcwin.obj + +PANOBJS = \ +panel.obj + +pdcurses.lib : $(LIBOBJS) $(PDCOBJS) + $(LIBEXE) $@ @$(osdir)\mscdos.lrf + +panel.lib : $(PANOBJS) + $(LIBEXE) $@ -+$(PANOBJS); + +addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addch.c + +addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addchstr.c + +addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addstr.c + +attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\attr.c + +beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\beep.c + +bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\bkgd.c + +border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\border.c + +clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\clear.c + +color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\color.c + +delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\delch.c + +deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\deleteln.c + +getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getch.c + +getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getstr.c + +getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getyx.c + +inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inch.c + +inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inchstr.c + +initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\initscr.c + +inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inopts.c + +insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\insch.c + +insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\insstr.c + +instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\instr.c + +kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\kernel.c + +mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\mouse.c + +move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\move.c + +outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\outopts.c + +overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\overlay.c + +pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pad.c + +printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\printw.c + +refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\refresh.c + +scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\scanw.c + +scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\scroll.c + +slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\slk.c + +termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\termattr.c + +terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\terminfo.c + +touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\touch.c + +util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\util.c + +window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\window.c + + +pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcclip.c + +pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcdebug.c + +pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcdisp.c + +pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcgetsc.c + +pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdckbd.c + +pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcprint.c + +pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcscrn.c + +pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcsetsc.c + +pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcutil.c + +pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcwin.c + +#------------------------------------------------------------------------ + +panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) + $(CC) $(CCFLAGS) -Fo$@ $(pandir)\panel.c + +#------------------------------------------------------------------------ +# DLFLAGS = $(LDEBUG) $*$(OBJ),$*,,$(PDCLIB); +# PANFLAGS = $(LDEBUG) $*$(OBJ),$*,,$(PDCLIB)+$(PANLIB); +# $(LINK) $*.obj,$*.exe,$*.map,$(CCLIBS)+$(LIBCURSES) $(LDFLAGS); + +firework.exe: firework.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + +newdemo.exe: newdemo.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + +ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBPANEL)+$(LIBCURSES); + +testcurs.exe: testcurs.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + +tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj+tui.obj,$*,,$(LIBCURSES); + +xmas.exe: xmas.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + + +firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\firework.c + +newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\newdemo.c + +ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\ptest.c + +testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\testcurs.c + +tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\tui.c + +tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\tuidemo.c + +xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\xmas.c + +dist: pdcurses.lib panel.lib + -mkdir tmp + cd tmp + copy $(PDCURSES_HOME)\README README + copy $(PDCURSES_HOME)\readme.?? . + copy $(PDCURSES_HOME)\curses.h . + copy $(PDCURSES_HOME)\curspriv.h . + copy $(PDCURSES_HOME)\maintain.er . + copy ..\pdcurses.lib . + copy ..\panel.lib . + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz + echo PDCurses - Public Domain Curses >> file_id.diz + echo Version $(VERDOT) for Microsoft Visual C++ 1.0 PDC$(VER)VCD.ZIP >> file_id.diz + echo ------------------------------------------ >> file_id.diz + echo Public Domain Curses library for >> file_id.diz + echo Microsoft Visual C/C++ 1.0 for DOS. >> file_id.diz + echo Source available in PDCURS$(VER).ZIP >> file_id.diz + echo Public Domain. >> file_id.diz + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz + zip pdc$(VER)vcd *.* + cd .. diff --git a/dos/pdcclip.c b/dos/pdcclip.c index c51a6eb6..908a7604 100644 --- a/dos/pdcclip.c +++ b/dos/pdcclip.c @@ -1,87 +1,87 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ - -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCclip = "$Id: pdcclip.c,v 1.1 2001/01/10 08:28:31 mark Exp $"; -#endif - - -/*man-start********************************************************************* - - PDC_getclipboard() - Gets the contents of the clipboard - - PDCurses Description: - This is a PDCurses only routine. - - Gets the textual contents of the system's clipboard. This - function returns the contents of the clipboard in the contents - argument. It is the responsibilitiy of the caller to free the - memory returned with the free() system call. The length of the - clipboard contents is returned in the length argument. - - PDCurses Return Value: - indicator of success/failure of call. - PDC_CLIP_ACCESS_ERROR no clipboard support - - Portability: - PDCurses int PDC_getclipboard( char **contents, long *length ); - -**man-end**********************************************************************/ -int PDC_CDECL PDC_getclipboard(char **contents, long *length) -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_getclipboard() - called\n"); -#endif - - return PDC_CLIP_ACCESS_ERROR; -} - -/*man-start********************************************************************* - - PDC_setclipboard() - Sets the contents of the clipboard - - PDCurses Description: - This is a PDCurses only routine. - - Copies the supplied text into the system's clipboard, emptying - the clipboard prior to the copy. - - PDCurses Return Value: - indicator of success/failure of call. - PDC_CLIP_ACCESS_ERROR no clipboard support - - Portability: - PDCurses int PDC_getclipboard( char *contents, long length ); - -**man-end**********************************************************************/ - -int PDC_CDECL PDC_setclipboard(char *contents, long length) -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_setclipboard() - called\n"); -#endif - return PDC_CLIP_ACCESS_ERROR; -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ + +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#ifdef PDCDEBUG +char *rcsid_PDCclip = "$Id: pdcclip.c,v 1.2 2001/01/10 08:28:32 mark Exp $"; +#endif + + +/*man-start********************************************************************* + + PDC_getclipboard() - Gets the contents of the clipboard + + PDCurses Description: + This is a PDCurses only routine. + + Gets the textual contents of the system's clipboard. This + function returns the contents of the clipboard in the contents + argument. It is the responsibilitiy of the caller to free the + memory returned with the free() system call. The length of the + clipboard contents is returned in the length argument. + + PDCurses Return Value: + indicator of success/failure of call. + PDC_CLIP_ACCESS_ERROR no clipboard support + + Portability: + PDCurses int PDC_getclipboard( char **contents, long *length ); + +**man-end**********************************************************************/ +int PDC_CDECL PDC_getclipboard(char **contents, long *length) +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_getclipboard() - called\n"); +#endif + + return PDC_CLIP_ACCESS_ERROR; +} + +/*man-start********************************************************************* + + PDC_setclipboard() - Sets the contents of the clipboard + + PDCurses Description: + This is a PDCurses only routine. + + Copies the supplied text into the system's clipboard, emptying + the clipboard prior to the copy. + + PDCurses Return Value: + indicator of success/failure of call. + PDC_CLIP_ACCESS_ERROR no clipboard support + + Portability: + PDCurses int PDC_getclipboard( char *contents, long length ); + +**man-end**********************************************************************/ + +int PDC_CDECL PDC_setclipboard(char *contents, long length) +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_setclipboard() - called\n"); +#endif + return PDC_CLIP_ACCESS_ERROR; +} diff --git a/dos/pdcdisp.c b/dos/pdcdisp.c index f6c52db7..36d3e8fe 100644 --- a/dos/pdcdisp.c +++ b/dos/pdcdisp.c @@ -1,721 +1,721 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#include - -#ifdef HAVE_MEMORY_H -# include -#endif - -#ifndef HAVE_MEMMOVE -# define memmove PDC_memmove -#endif - -#ifdef PDCDEBUG -char *rcsid_PDCdisp = "$Id: pdcdisp.c,v 1.1 2001/01/10 08:28:35 mark Exp $"; -#endif - -/*man-start********************************************************************* - - PDC_clr_update() - Updates the screen with a full redraw. - - PDCurses Description: - Updates the screen by clearing it and then redraw it in its - entirety. If SP->refrbrk is TRUE, and there is pending - input characters, the update will be prematurely terminated. - - PDCurses Return Value: - This routine returns ERR if it is unable to accomplish it's task. - This return value is ONLY under FLEXOS. - - The return value OK is returned if there were no errors. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_clr_update( WINDOW* s ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_clr_update(WINDOW *s) -#else -int PDC_clr_update(s) -WINDOW *s; -#endif -/***********************************************************************/ -{ -register int i=0,j=0; - WINDOW* w=NULL; - unsigned short* ch; - bool rc=FALSE; - -#if SMALL || MEDIUM -struct SREGS segregs; -int ds=0; -#endif - -#if defined(NDP) - int *VIDPOINT; -#endif - - extern unsigned char atrtab[MAX_ATRTAB]; - -/* the next two variables have been changed from chtype to unsigned short */ -/* as this is the correct datatype for a physical character/attribute */ - unsigned short temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ - unsigned short chr; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_clr_update() - called\n"); -#endif - - w = curscr; - if (w == (WINDOW *)NULL) - return( ERR ); -/* if (SP->full_redraw) - PDC_clr_scrn(s); *//* clear physical screen */ - - s->_clear = FALSE; - for (i = 0; i < LINES; i++) /* update physical screen */ - { - if (s != w) /* copy s to curscr */ - memcpy(w->_y[i], s->_y[i], COLS * sizeof(chtype)); - - ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */ - - - for (j=0;j_y[i][j] & A_CHARTEXT); - temp_line[j] = chtype_attr(s->_y[i][j]) | chr; - } - - if (SP->direct_video) - { - -#ifdef GO32 - dosmemput (ch, COLS * sizeof(unsigned short), - (unsigned long)_FAR_POINTER(SP->video_seg, - SP->video_ofs + (i * COLS * sizeof(unsigned short)))); -#else -# if (SMALL || MEDIUM) - segread(&segregs); - ds = segregs.ds; - movedata(ds, (int)ch, - SP->video_seg, - SP->video_ofs + (i*COLS*sizeof(unsigned short)), - (COLS * sizeof(unsigned short))); -# else -/* -# ifdef NDP - VIDPOINT = (int *) mapdev(MK_FP(SP->video_seg, - SP->video_ofs + (i * COLS * sizeof(unsigned short))), - (COLS * sizeof(unsigned short))); - memcpy(VIDPOINT, (int *) ch, (COLS * sizeof(unsigned short))); -*/ - memcpy((void *)_FAR_POINTER(SP->video_seg, - SP->video_ofs + (i * COLS * sizeof(unsigned short))), - ch, (COLS * sizeof(unsigned short))); -# endif -#endif - - } - else - { - - for (j = 0; j < COLS; j++) - { - PDC_gotoxy(i, j); - PDC_putc( (*ch & 0x00FF), (*ch & 0xFF00) >> 8 ); - ch++; - } - - } - - if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) - { - rc = PDC_breakout(); - if(rc) - break; - } - w->_firstch[i] = _NO_CHANGE; - w->_lastch[i] = _NO_CHANGE; - } - return( OK ); -} - -/*man-start********************************************************************* - - PDC_cursor_on() - Turns on the hardware cursor. - - PDCurses Description: - Turns on the hardware curses, it does nothing if it is already on. - - PDCurses Return Value: - Returns OK upon success, ERR upon failure. - - Portability: - PDCurses int PDC_cursor_on( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_cursor_on(void) -#else -int PDC_cursor_on() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_cursor_on() - called\n"); -#endif - - if (!SP->visible_cursor) - { - SP->visible_cursor = TRUE; -/* PDC_fix_cursor(SP->orig_emulation);*/ - if (SP->bogus_adapter) - { - PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, - (SP->cursor & 0x00ff)); - } - else - { - switch (SP->adapter) { - case _MDA: - case _CGA: - case _EGACOLOR: - case _EGAMONO: - case _VGACOLOR: - case _VGAMONO: - case _MDS_GENIUS: -/* PDC_set_cursor_mode(SP->font - 2, SP->font - 1);*/ - PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, - (SP->cursor & 0x00ff)); - break; - case _MCGACOLOR: - case _MCGAMONO: -/* PDC_set_cursor_mode(SP->font - 1, SP->font - 2);*/ - PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, - (SP->cursor & 0x00ff)); - break; - case _FLEXOS: - PDC_set_cursor_mode(SP->visible_cursor, 0); - break; - default: - break; - } - } - } - return( OK ); -} - -/*man-start********************************************************************* - - PDC_cursor_off() - Turns off the hardware cursor. - - PDCurses Description: - Turns off the hardware curses, it does nothing if it is already off. - - PDCurses Return Value: - Returns OK upon success, ERR upon failure. - - PDCurses Errors: - ERR will be returned (in the case of FLEXOS) if the hardware cursor - can not be disabled. - - Portability: - PDCurses int PDC_cursor_off( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_cursor_off(void) -#else -int PDC_cursor_off() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_cursor_off() - called\n"); -#endif - - if (SP->visible_cursor) - { - SP->visible_cursor = FALSE; - switch (SP->adapter) - { - case _FLEXOS: - PDC_set_cursor_mode(SP->visible_cursor, 0); - break; - default: - PDC_set_cursor_mode(32, 33); /* turn it off */ - break; - } - } - return( OK ); -} - -/*man-start********************************************************************* - - PDC_fix_cursor() - Fix the cursor start and stop scan lines (if necessary) - - PDCurses Description: - This is a private PDCurses routine. - - This routine will fix the cursor shape for certain video adapters. - Normally, the values used are correct, but some adapters choke. - The most noticable choke is on a monochrome adapter. The "correct" - scan lines will result in the cursor being set in the middle of the - character cell, rather than at the bottom. - - The passed flag indicates whether the cursor is visible or not. - - This only applies to the DOS platform. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_fix_cursor( int flag ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_fix_cursor(int flag) -#else -int PDC_fix_cursor(flag) -int flag; -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_fix_cursor() - called\n"); -#endif - - if (SP->bogus_adapter) - return( OK ); - - switch (SP->adapter) - { - case _EGACOLOR: - case _EGAMONO: - case _MDS_GENIUS: /* Some clones look like a Genius;-) */ - if (flag & 0x01) - setdosmembyte (0x487, getdosmembyte (0x487) | 0x01); /* Enable emulation */ - else - setdosmembyte (0x487, getdosmembyte (0x487) & ~0x01); /* Disable emulation */ - break; - - case _VGACOLOR: - case _VGAMONO: - if (flag & 0x01) -#ifdef WATCOMC - regs.w.ax = 0x1200; /* Enable emulation */ -#else - regs.x.ax = 0x1200; /* Enable emulation */ -#endif - else -#ifdef WATCOMC - regs.w.ax = 0x1201; /* Disable emulation */ -#else - regs.x.ax = 0x1201; /* Disable emulation */ -#endif - regs.h.bl = 0x34; - int86(0x10, ®s, ®s); - - break; - - case _MCGACOLOR: - case _MCGAMONO: - case _MDA: - case _CGA: - case _NONE: - default: - break; - } - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_gotoxy() - position hardware cursor at (x, y) - - PDCurses Description: - This is a private PDCurses routine. - - Moves the physical cursor to the desired address on the - screen. We don't optimize here -- on a PC, it takes more time - to optimize than to do things directly. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_gotoxy( int row, int col ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_gotoxy(int row, int col) -#else -int PDC_gotoxy(row,col) -int row; -int col; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_gotoxy() - called: row %d col %d\n",row,col); -#endif - - if ((SP->cursrow == row) && (SP->curscol == col)) - return( OK ); - - regs.h.ah = 0x02; - regs.h.bh = SP->video_page; - regs.h.dh = (unsigned char) row; - regs.h.dl = (unsigned char) col; - int86(0x10, ®s, ®s); - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_putc() - Output a character in the current attribute. - - PDCurses Description: - This is a private PDCurses routine. - - Outputs character 'chr' to screen in tty fashion. If a colour - mode is active, the character is written with colour 'colour'. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_putc( chtype character, chtype color ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_putc( chtype character, chtype color ) -#else -int PDC_putc(character,color) -chtype character; -chtype color; -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_putc() - called:char=%c attrib=0x%x color=0x%x\n",character & A_CHARTEXT,character & A_ATTRIBUTES,color); -#endif - - regs.h.ah = 0x09; /* Avoid screen wrap. Don't advance cursor. */ - regs.h.al = (unsigned char) (character & 0x00FF); - regs.h.bh = SP->video_page; - regs.h.bl = (unsigned char) (color); -#ifdef WATCOMC - regs.w.cx = 1; -#else - regs.x.cx = 1; -#endif - int86(0x10, ®s, ®s); - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_putctty() - Output a character and attribute in TTY fashion. - - PDCurses Description: - This is a private PDCurses routine. - - Outputs character 'chr' to screen in tty fashion. If a colour - mode is active, the character is written with colour 'colour'. - - This function moves the physical cursor after writing so the - screen will scroll if necessary. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_putctty( chtype character, chtype color ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_putctty( chtype character, chtype color ) -#else -int PDC_putctty(character,color) -chtype character; -chtype color; -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_putctty() - called\n"); -#endif - - regs.h.ah = 0x0e; /* Write in TTY fashion, advance cursor. */ - regs.h.al = (unsigned char) (character & 0x00FF); - regs.h.bh = SP->video_page; - regs.h.bl = (unsigned char) ((color & 0xFF00) >> 8); - int86(0x10, ®s, ®s); - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_scroll() - low level screen scroll - - PDCurses Description: - Scrolls a window in the current page up or down. Urow, lcol, - lrow, rcol are the window coordinates. Lines is the number of - lines to scroll. If 0, clears the window, if < 0 scrolls down, - if > 0 scrolls up. Blanks areas that are left, and sets - character attributes to attr. If in a colour graphics mode, - fills them with the colour 'attr' instead. - - PDCurses Return Value: - The PDC_scroll() function returns OK on success otherwise ERR is returned. - - PDCurses Errors: - An error will only be returned on the Flexos platform if s_copy() - fails. - - Portability: - PDCurses int PDC_scroll( int urow, int lcol, int rcol, - int nlines, chtype attr ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_scroll(int urow, int lcol, int lrow, int rcol, int nlines, chtype attr) -#else -int PDC_scroll(urow,lcol,lrow,rcol,nlines,attr) -int urow; -int lcol; -int lrow; -int rcol; -int nlines; -chtype attr; -#endif -/***********************************************************************/ -{ - extern unsigned char atrtab[MAX_ATRTAB]; - int phys_attr=chtype_attr(attr); - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scroll() - called: urow %d lcol %d lrow %d rcol %d nlines %d\n",urow,lcol,lrow,rcol,nlines); -#endif - - if (nlines >= 0) - { - regs.h.ah = 0x06; - regs.h.al = (unsigned char) nlines; - } - else - { - regs.h.ah = 0x07; - regs.h.al = (unsigned char) (-nlines); - } - regs.h.bh = (unsigned char)(phys_attr >> 8); - regs.h.ch = (unsigned char) urow; - regs.h.cl = (unsigned char) lcol; - regs.h.dh = (unsigned char) lrow; - regs.h.dl = (unsigned char) rcol; - int86(0x10, ®s, ®s); - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_transform_line() - display a physical line of the screen - - PDCurses Description: - This is a private PDCurses function. - - Updates the given physical line to look like the corresponding - line in _curscr. - - PDCurses Return Value: - This routine returns TRUE if a premature refresh end - is allowed, and there is an input character pending. Otherwise, - FALSE is returned. - - PDCurses Errors: - No errors are defined for this routine. - - Portability: - PDCurses bool PDC_transform_line( int lineno ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_transform_line(register int lineno) -#else -bool PDC_transform_line(lineno) -register int lineno; -#endif -/***********************************************************************/ -{ -#if defined (MSC) -chtype* dstp=NULL; -chtype* srcp=NULL; -#else -register chtype* dstp=NULL; -register chtype* srcp=NULL; -#endif - -#if SMALL || MEDIUM -struct SREGS segregs; -int ds=0; -#endif - - int x=0; - int endx=0; - int len=0; - -#if defined(NDP) - int *VIDPOINT; -#endif - - extern unsigned char atrtab[MAX_ATRTAB]; - - unsigned short temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ - unsigned short chr=0; - unsigned short* ch=NULL; - - register int j=0; - bool rc=FALSE; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_transform_line() - called: line %d\n",lineno); -#endif - - if (curscr == (WINDOW *)NULL) - return( FALSE ); - - memset(temp_line,' ',sizeof(temp_line)); - - x = curscr->_firstch[lineno]; - endx = curscr->_lastch[lineno]; - dstp = curscr->_y[lineno] + x; - srcp = curscr->_y[lineno] + x; - len = endx-x+1; - - ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */ - -/* replace the attribute part of the chtype with the actual colour value */ -/* replacing the number that points to the actual colour value. */ - - for (j=0;jdirect_video) - { - -#if IS_THIS_REALLY_NEEDED - memcpy(dstp, srcp, len * sizeof(chtype)); -#endif - -#ifdef GO32 - dosmemput (ch, len * sizeof(unsigned short), - (unsigned long)_FAR_POINTER(SP->video_seg, - SP->video_ofs + (((lineno * curscr->_maxx) + x) * sizeof(unsigned short)))); -#else -# if SMALL || MEDIUM - segread(&segregs); - ds = segregs.ds; - movedata(ds,(int)ch, - SP->video_seg, - SP->video_ofs+(((lineno*curscr->_maxx)+x)*sizeof(unsigned short)), - len * sizeof(unsigned short)); -# else - memcpy((void *)_FAR_POINTER(SP->video_seg, - SP->video_ofs + (((lineno * curscr->_maxx) + x) * sizeof(unsigned short))), - ch, len * sizeof(unsigned short)); -# endif -#endif - - } - else - { - - for (; x <= endx; x++) - { - PDC_gotoxy(lineno, x); - PDC_putc( (*ch & 0x00FF),(*ch & 0xFF00) >> 8 ); - ch++; - } - - } - curscr->_firstch[lineno] = _NO_CHANGE; - curscr->_lastch[lineno] = _NO_CHANGE; - - if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) - { - rc = PDC_breakout(); - if(rc) - return(TRUE); - } - return(FALSE); -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#include + +#ifdef HAVE_MEMORY_H +# include +#endif + +#ifndef HAVE_MEMMOVE +# define memmove PDC_memmove +#endif + +#ifdef PDCDEBUG +char *rcsid_PDCdisp = "$Id: pdcdisp.c,v 1.2 2001/01/10 08:28:36 mark Exp $"; +#endif + +/*man-start********************************************************************* + + PDC_clr_update() - Updates the screen with a full redraw. + + PDCurses Description: + Updates the screen by clearing it and then redraw it in its + entirety. If SP->refrbrk is TRUE, and there is pending + input characters, the update will be prematurely terminated. + + PDCurses Return Value: + This routine returns ERR if it is unable to accomplish it's task. + This return value is ONLY under FLEXOS. + + The return value OK is returned if there were no errors. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_clr_update( WINDOW* s ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_clr_update(WINDOW *s) +#else +int PDC_clr_update(s) +WINDOW *s; +#endif +/***********************************************************************/ +{ +register int i=0,j=0; + WINDOW* w=NULL; + unsigned short* ch; + bool rc=FALSE; + +#if SMALL || MEDIUM +struct SREGS segregs; +int ds=0; +#endif + +#if defined(NDP) + int *VIDPOINT; +#endif + + extern unsigned char atrtab[MAX_ATRTAB]; + +/* the next two variables have been changed from chtype to unsigned short */ +/* as this is the correct datatype for a physical character/attribute */ + unsigned short temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ + unsigned short chr; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_clr_update() - called\n"); +#endif + + w = curscr; + if (w == (WINDOW *)NULL) + return( ERR ); +/* if (SP->full_redraw) + PDC_clr_scrn(s); *//* clear physical screen */ + + s->_clear = FALSE; + for (i = 0; i < LINES; i++) /* update physical screen */ + { + if (s != w) /* copy s to curscr */ + memcpy(w->_y[i], s->_y[i], COLS * sizeof(chtype)); + + ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */ + + + for (j=0;j_y[i][j] & A_CHARTEXT); + temp_line[j] = chtype_attr(s->_y[i][j]) | chr; + } + + if (SP->direct_video) + { + +#ifdef GO32 + dosmemput (ch, COLS * sizeof(unsigned short), + (unsigned long)_FAR_POINTER(SP->video_seg, + SP->video_ofs + (i * COLS * sizeof(unsigned short)))); +#else +# if (SMALL || MEDIUM) + segread(&segregs); + ds = segregs.ds; + movedata(ds, (int)ch, + SP->video_seg, + SP->video_ofs + (i*COLS*sizeof(unsigned short)), + (COLS * sizeof(unsigned short))); +# else +/* +# ifdef NDP + VIDPOINT = (int *) mapdev(MK_FP(SP->video_seg, + SP->video_ofs + (i * COLS * sizeof(unsigned short))), + (COLS * sizeof(unsigned short))); + memcpy(VIDPOINT, (int *) ch, (COLS * sizeof(unsigned short))); +*/ + memcpy((void *)_FAR_POINTER(SP->video_seg, + SP->video_ofs + (i * COLS * sizeof(unsigned short))), + ch, (COLS * sizeof(unsigned short))); +# endif +#endif + + } + else + { + + for (j = 0; j < COLS; j++) + { + PDC_gotoxy(i, j); + PDC_putc( (*ch & 0x00FF), (*ch & 0xFF00) >> 8 ); + ch++; + } + + } + + if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) + { + rc = PDC_breakout(); + if(rc) + break; + } + w->_firstch[i] = _NO_CHANGE; + w->_lastch[i] = _NO_CHANGE; + } + return( OK ); +} + +/*man-start********************************************************************* + + PDC_cursor_on() - Turns on the hardware cursor. + + PDCurses Description: + Turns on the hardware curses, it does nothing if it is already on. + + PDCurses Return Value: + Returns OK upon success, ERR upon failure. + + Portability: + PDCurses int PDC_cursor_on( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_cursor_on(void) +#else +int PDC_cursor_on() +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_cursor_on() - called\n"); +#endif + + if (!SP->visible_cursor) + { + SP->visible_cursor = TRUE; +/* PDC_fix_cursor(SP->orig_emulation);*/ + if (SP->bogus_adapter) + { + PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, + (SP->cursor & 0x00ff)); + } + else + { + switch (SP->adapter) { + case _MDA: + case _CGA: + case _EGACOLOR: + case _EGAMONO: + case _VGACOLOR: + case _VGAMONO: + case _MDS_GENIUS: +/* PDC_set_cursor_mode(SP->font - 2, SP->font - 1);*/ + PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, + (SP->cursor & 0x00ff)); + break; + case _MCGACOLOR: + case _MCGAMONO: +/* PDC_set_cursor_mode(SP->font - 1, SP->font - 2);*/ + PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, + (SP->cursor & 0x00ff)); + break; + case _FLEXOS: + PDC_set_cursor_mode(SP->visible_cursor, 0); + break; + default: + break; + } + } + } + return( OK ); +} + +/*man-start********************************************************************* + + PDC_cursor_off() - Turns off the hardware cursor. + + PDCurses Description: + Turns off the hardware curses, it does nothing if it is already off. + + PDCurses Return Value: + Returns OK upon success, ERR upon failure. + + PDCurses Errors: + ERR will be returned (in the case of FLEXOS) if the hardware cursor + can not be disabled. + + Portability: + PDCurses int PDC_cursor_off( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_cursor_off(void) +#else +int PDC_cursor_off() +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_cursor_off() - called\n"); +#endif + + if (SP->visible_cursor) + { + SP->visible_cursor = FALSE; + switch (SP->adapter) + { + case _FLEXOS: + PDC_set_cursor_mode(SP->visible_cursor, 0); + break; + default: + PDC_set_cursor_mode(32, 33); /* turn it off */ + break; + } + } + return( OK ); +} + +/*man-start********************************************************************* + + PDC_fix_cursor() - Fix the cursor start and stop scan lines (if necessary) + + PDCurses Description: + This is a private PDCurses routine. + + This routine will fix the cursor shape for certain video adapters. + Normally, the values used are correct, but some adapters choke. + The most noticable choke is on a monochrome adapter. The "correct" + scan lines will result in the cursor being set in the middle of the + character cell, rather than at the bottom. + + The passed flag indicates whether the cursor is visible or not. + + This only applies to the DOS platform. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_fix_cursor( int flag ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_fix_cursor(int flag) +#else +int PDC_fix_cursor(flag) +int flag; +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_fix_cursor() - called\n"); +#endif + + if (SP->bogus_adapter) + return( OK ); + + switch (SP->adapter) + { + case _EGACOLOR: + case _EGAMONO: + case _MDS_GENIUS: /* Some clones look like a Genius;-) */ + if (flag & 0x01) + setdosmembyte (0x487, getdosmembyte (0x487) | 0x01); /* Enable emulation */ + else + setdosmembyte (0x487, getdosmembyte (0x487) & ~0x01); /* Disable emulation */ + break; + + case _VGACOLOR: + case _VGAMONO: + if (flag & 0x01) +#ifdef WATCOMC + regs.w.ax = 0x1200; /* Enable emulation */ +#else + regs.x.ax = 0x1200; /* Enable emulation */ +#endif + else +#ifdef WATCOMC + regs.w.ax = 0x1201; /* Disable emulation */ +#else + regs.x.ax = 0x1201; /* Disable emulation */ +#endif + regs.h.bl = 0x34; + int86(0x10, ®s, ®s); + + break; + + case _MCGACOLOR: + case _MCGAMONO: + case _MDA: + case _CGA: + case _NONE: + default: + break; + } + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_gotoxy() - position hardware cursor at (x, y) + + PDCurses Description: + This is a private PDCurses routine. + + Moves the physical cursor to the desired address on the + screen. We don't optimize here -- on a PC, it takes more time + to optimize than to do things directly. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_gotoxy( int row, int col ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_gotoxy(int row, int col) +#else +int PDC_gotoxy(row,col) +int row; +int col; +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_gotoxy() - called: row %d col %d\n",row,col); +#endif + + if ((SP->cursrow == row) && (SP->curscol == col)) + return( OK ); + + regs.h.ah = 0x02; + regs.h.bh = SP->video_page; + regs.h.dh = (unsigned char) row; + regs.h.dl = (unsigned char) col; + int86(0x10, ®s, ®s); + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_putc() - Output a character in the current attribute. + + PDCurses Description: + This is a private PDCurses routine. + + Outputs character 'chr' to screen in tty fashion. If a colour + mode is active, the character is written with colour 'colour'. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_putc( chtype character, chtype color ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_putc( chtype character, chtype color ) +#else +int PDC_putc(character,color) +chtype character; +chtype color; +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_putc() - called:char=%c attrib=0x%x color=0x%x\n",character & A_CHARTEXT,character & A_ATTRIBUTES,color); +#endif + + regs.h.ah = 0x09; /* Avoid screen wrap. Don't advance cursor. */ + regs.h.al = (unsigned char) (character & 0x00FF); + regs.h.bh = SP->video_page; + regs.h.bl = (unsigned char) (color); +#ifdef WATCOMC + regs.w.cx = 1; +#else + regs.x.cx = 1; +#endif + int86(0x10, ®s, ®s); + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_putctty() - Output a character and attribute in TTY fashion. + + PDCurses Description: + This is a private PDCurses routine. + + Outputs character 'chr' to screen in tty fashion. If a colour + mode is active, the character is written with colour 'colour'. + + This function moves the physical cursor after writing so the + screen will scroll if necessary. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_putctty( chtype character, chtype color ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_putctty( chtype character, chtype color ) +#else +int PDC_putctty(character,color) +chtype character; +chtype color; +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_putctty() - called\n"); +#endif + + regs.h.ah = 0x0e; /* Write in TTY fashion, advance cursor. */ + regs.h.al = (unsigned char) (character & 0x00FF); + regs.h.bh = SP->video_page; + regs.h.bl = (unsigned char) ((color & 0xFF00) >> 8); + int86(0x10, ®s, ®s); + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_scroll() - low level screen scroll + + PDCurses Description: + Scrolls a window in the current page up or down. Urow, lcol, + lrow, rcol are the window coordinates. Lines is the number of + lines to scroll. If 0, clears the window, if < 0 scrolls down, + if > 0 scrolls up. Blanks areas that are left, and sets + character attributes to attr. If in a colour graphics mode, + fills them with the colour 'attr' instead. + + PDCurses Return Value: + The PDC_scroll() function returns OK on success otherwise ERR is returned. + + PDCurses Errors: + An error will only be returned on the Flexos platform if s_copy() + fails. + + Portability: + PDCurses int PDC_scroll( int urow, int lcol, int rcol, + int nlines, chtype attr ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_scroll(int urow, int lcol, int lrow, int rcol, int nlines, chtype attr) +#else +int PDC_scroll(urow,lcol,lrow,rcol,nlines,attr) +int urow; +int lcol; +int lrow; +int rcol; +int nlines; +chtype attr; +#endif +/***********************************************************************/ +{ + extern unsigned char atrtab[MAX_ATRTAB]; + int phys_attr=chtype_attr(attr); + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_scroll() - called: urow %d lcol %d lrow %d rcol %d nlines %d\n",urow,lcol,lrow,rcol,nlines); +#endif + + if (nlines >= 0) + { + regs.h.ah = 0x06; + regs.h.al = (unsigned char) nlines; + } + else + { + regs.h.ah = 0x07; + regs.h.al = (unsigned char) (-nlines); + } + regs.h.bh = (unsigned char)(phys_attr >> 8); + regs.h.ch = (unsigned char) urow; + regs.h.cl = (unsigned char) lcol; + regs.h.dh = (unsigned char) lrow; + regs.h.dl = (unsigned char) rcol; + int86(0x10, ®s, ®s); + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_transform_line() - display a physical line of the screen + + PDCurses Description: + This is a private PDCurses function. + + Updates the given physical line to look like the corresponding + line in _curscr. + + PDCurses Return Value: + This routine returns TRUE if a premature refresh end + is allowed, and there is an input character pending. Otherwise, + FALSE is returned. + + PDCurses Errors: + No errors are defined for this routine. + + Portability: + PDCurses bool PDC_transform_line( int lineno ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +bool PDC_transform_line(register int lineno) +#else +bool PDC_transform_line(lineno) +register int lineno; +#endif +/***********************************************************************/ +{ +#if defined (MSC) +chtype* dstp=NULL; +chtype* srcp=NULL; +#else +register chtype* dstp=NULL; +register chtype* srcp=NULL; +#endif + +#if SMALL || MEDIUM +struct SREGS segregs; +int ds=0; +#endif + + int x=0; + int endx=0; + int len=0; + +#if defined(NDP) + int *VIDPOINT; +#endif + + extern unsigned char atrtab[MAX_ATRTAB]; + + unsigned short temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ + unsigned short chr=0; + unsigned short* ch=NULL; + + register int j=0; + bool rc=FALSE; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_transform_line() - called: line %d\n",lineno); +#endif + + if (curscr == (WINDOW *)NULL) + return( FALSE ); + + memset(temp_line,' ',sizeof(temp_line)); + + x = curscr->_firstch[lineno]; + endx = curscr->_lastch[lineno]; + dstp = curscr->_y[lineno] + x; + srcp = curscr->_y[lineno] + x; + len = endx-x+1; + + ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */ + +/* replace the attribute part of the chtype with the actual colour value */ +/* replacing the number that points to the actual colour value. */ + + for (j=0;jdirect_video) + { + +#if IS_THIS_REALLY_NEEDED + memcpy(dstp, srcp, len * sizeof(chtype)); +#endif + +#ifdef GO32 + dosmemput (ch, len * sizeof(unsigned short), + (unsigned long)_FAR_POINTER(SP->video_seg, + SP->video_ofs + (((lineno * curscr->_maxx) + x) * sizeof(unsigned short)))); +#else +# if SMALL || MEDIUM + segread(&segregs); + ds = segregs.ds; + movedata(ds,(int)ch, + SP->video_seg, + SP->video_ofs+(((lineno*curscr->_maxx)+x)*sizeof(unsigned short)), + len * sizeof(unsigned short)); +# else + memcpy((void *)_FAR_POINTER(SP->video_seg, + SP->video_ofs + (((lineno * curscr->_maxx) + x) * sizeof(unsigned short))), + ch, len * sizeof(unsigned short)); +# endif +#endif + + } + else + { + + for (; x <= endx; x++) + { + PDC_gotoxy(lineno, x); + PDC_putc( (*ch & 0x00FF),(*ch & 0xFF00) >> 8 ); + ch++; + } + + } + curscr->_firstch[lineno] = _NO_CHANGE; + curscr->_lastch[lineno] = _NO_CHANGE; + + if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) + { + rc = PDC_breakout(); + if(rc) + return(TRUE); + } + return(FALSE); +} diff --git a/dos/pdcgetsc.c b/dos/pdcgetsc.c index d3909358..990d7e34 100644 --- a/dos/pdcgetsc.c +++ b/dos/pdcgetsc.c @@ -1,855 +1,855 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.1 2001/01/10 08:28:37 mark Exp $"; -#endif - -/*man-start********************************************************************* - - PDC_get_cursor_pos() - return current cursor position - - PDCurses Description: - This is a private PDCurses function - - Gets the cursor position in video page 0. 'row' and 'column' - are the cursor address. At this time, there is no support for - use of multiple screen pages. - - PDCurses Return Value: - This routine will return OK upon success and otherwise ERR will be - returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_cursor_pos( int* row, int* col ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_cursor_pos(int *row, int *col) -#else -int PDC_get_cursor_pos(row,col) -int *row; -int *col; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cursor_pos() - called\n"); -#endif - - regs.h.ah = 0x03; - regs.h.bh = SP->video_page; - int86(0x10, ®s, ®s); - *row = regs.h.dh; - *col = regs.h.dl; - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_get_cur_col() - get current column position of cursor - - PDCurses Description: - This is a private PDCurses function - - This routine returns the current column position of the cursor on - screen. - - PDCurses Return Value: - This routine returns the current column position of the cursor. No - error is returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_cur_col( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_cur_col(void) -#else -int PDC_get_cur_col() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cur_col() - called\n"); -#endif - -#ifdef WATCOMC - regs.w.ax = 0x0003; -#else - regs.x.ax = 0x0003; -#endif - regs.h.bh = SP->video_page; - int86(0x10, ®s, ®s); - return((int) regs.h.dl); - -} - -/*man-start********************************************************************* - - PDC_get_cur_row() - get current row position of cursor - - PDCurses Description: - This is a private PDCurses function - - This routine returns the current row position of the cursor on - screen. - - PDCurses Return Value: - This routine returns the current row position of the cursor. No - error is returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_cur_row( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_cur_row(void) -#else -int PDC_get_cur_row() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cur_row() - called\n"); -#endif - -#ifdef WATCOMC - regs.w.ax = 0x0003; -#else - regs.x.ax = 0x0003; -#endif - regs.h.bh = SP->video_page; - int86(0x10, ®s, ®s); - return ((int) regs.h.dh); - -} - -/*man-start********************************************************************* - - PDC_get_attribute() - Get attribute at current cursor - - PDCurses Description: - This is a private PDCurses function - - Return the current attr at current cursor position on the screen. - - PDCurses Return Value: - This routine will return OK upon success and otherwise ERR will be - returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_attribute( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_attribute(void) -#else -int PDC_get_attribute() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_attribute() - called\n"); -#endif - -#ifdef WATCOMC - regs.w.ax = 0x0800; -#else - regs.x.ax = 0x0800; -#endif - regs.h.bh = SP->video_page; - int86(0x10, ®s, ®s); - return ((int) regs.h.ah); - -} - -/*man-start********************************************************************* - - PDC_get_columns() - return width of screen/viewport. - - PDCurses Description: - This is a private PDCurses function - - This function will return the width of the current screen. - - PDCurses Return Value: - This routine will return OK upon success and otherwise ERR will be - returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_columns( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_columns(void) -#else -int PDC_get_columns() -#endif -/***********************************************************************/ -{ - int cols=0; - char *env_cols=NULL; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_columns() - called\n"); -#endif - -/* use the value from COLS environment variable, if set. MH 10-Jun-92 */ -/* and use the minimum of COLS and return from int10h MH 18-Jun-92 */ - regs.h.ah = 0x0f; - int86(0x10, ®s, ®s); - cols = (int)regs.h.ah; - env_cols = (char *)getenv("COLS"); - if (env_cols != (char *)NULL) - { - cols = min(atoi(env_cols),cols); - } -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_columns() - returned: cols %d\n",cols); -#endif - return(cols); - -} - -/*man-start********************************************************************* - - PDC_get_cursor_mode() - Get the cursor start and stop scan lines. - - PDCurses Description: - Gets the cursor type to begin in scan line startrow and end in - scan line endrow. Both values should be 0-31. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_cursor_mode( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_cursor_mode(void) -#else -int PDC_get_cursor_mode() -#endif -/***********************************************************************/ -{ - short cmode=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cursor_mode() - called\n"); -#endif - - cmode = getdosmemword (0x460); - return (cmode); - -} - -/*man-start********************************************************************* - - PDC_get_font() - Get the current font size - - PDCurses Description: - This is a private PDCurses routine. - - This function returns the current font size. This function only - works if the #define FAST_VIDEO is true. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - An ERR will be returned if FAST_VIDEO is not true. - - Portability: - PDCurses int PDC_get_font( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_font(void) -#else -int PDC_get_font() -#endif -/***********************************************************************/ -{ -#if defined (FAST_VIDEO) - int retval=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_font() - called\n"); -#endif - -#if defined (FAST_VIDEO) - retval = getdosmemword (0x485); - if ((retval == 0) && (SP->adapter == _MDS_GENIUS)) - { - retval = _FONT15; /* Assume the MDS Genius is in 66 line mode. */ - } - switch (SP->adapter) - { - case _MDA: - retval = 10; /* POINTS is not certain on MDA/Hercules */ - break; - case _EGACOLOR: - case _EGAMONO: - switch (retval) - { - case _FONT8: - case _FONT14: - break; - default: - retval = _FONT14; - } - break; - - case _VGACOLOR: - case _VGAMONO: - switch (retval) - { - case _FONT8: - case _FONT14: - case _FONT16: - break; - default: - break; - } - break; - case _CGA: - retval = _FONT8; - break; - default: - break; - } - return( retval ); -#endif - -} - -/*man-start********************************************************************* - - PDC_get_rows() - Return number of screen rows. - - PDCurses Description: - This is a private PDCurses routine. - - Returns the maximum number of rows supported by the display. - e.g. 25, 28, 43, 50, 60, 66... - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_rows( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_rows(void) -#else -int PDC_get_rows() -#endif -/***********************************************************************/ -{ - char *env_rows=NULL; - int rows=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_rows() - called\n"); -#endif - -/* use the value from LINES environment variable, if set. MH 10-Jun-92 */ -/* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */ - rows = getdosmembyte(0x484) + 1; - env_rows = (char *)getenv("LINES"); - if (env_rows != (char *)NULL) - rows = min(atoi(env_rows),rows); - - if ((rows == 1) && (SP->adapter == _MDS_GENIUS)) - rows = 66; - if ((rows == 1) && (SP->adapter == _MDA)) - rows = 25; /* new test MH 10-Jun-92 */ - if (rows == 1) - { - rows = _default_lines; /* Allow pre-setting LINES */ - SP->direct_video = FALSE; - } - switch (SP->adapter) - { - case _EGACOLOR: - case _EGAMONO: - switch (rows) - { - case 25: - case 43: - break; - default: - rows = 25; - } - break; - - case _VGACOLOR: - case _VGAMONO: -/* lets be reasonably flexible with VGAs - they could be Super VGAs */ -/* capable of displaying any number of lines. MH 10-Jun-92 */ -/* - switch (rows) - { - case 25: - case 28: - case 50: - break; - default: - rows = 25; - } -*/ - break; - - default: - rows = 25; - break; - } - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_rows() - returned: rows %d\n",rows); -#endif - - return (rows); - -} - -/*man-start********************************************************************* - - PDC_get_scrn_mode() - Return the current BIOS video mode - - PDCurses Description: - This is a private PDCurses routine. - - - PDCurses Return Value: - Returns the current BIOS Video Mode Number. - - PDCurses Errors: - The FLEXOS version of this routine returns an ERR. - The UNIX version of this routine returns an ERR. - The EMXVIDEO version of this routine returns an ERR. - - Portability: - PDCurses int PDC_get_scrn_mode( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_scrn_mode(void) -#else -int PDC_get_scrn_mode() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_scrn_mode() - called\n"); -#endif - - regs.h.ah = 0x0f; - int86(0x10, ®s, ®s); - return ((int) regs.h.al); - -} - -/*man-start********************************************************************* - - PDC_query_adapter_type() - Determine PC video adapter type - - PDCurses Description: - This is a private PDCurses routine. - - Thanks to Jeff Duntemann, K16RA for providing the impetus - (through the Dr. Dobbs Journal, March 1989 issue) for getting - the routines below merged into Bjorn Larsson's PDCurses 1.3... - -- frotz@dri.com 900730 - - PDCurses Return Value: - This function returns a macro identifier indicating the adapter - type. See the list of adapter types in CURSPRIV.H. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_query_adapter_type( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_query_adapter_type(void) -#else -int PDC_query_adapter_type() -#endif -/***********************************************************************/ -{ - int retval = _NONE; - - /* thanks to paganini@ax.apc.org for the GO32 fix */ -# if defined(GO32) && defined(NOW_WORKS) -# include - _go32_dpmi_registers dpmi_regs; -# endif - - int equip; - struct SREGS segs; - short video_base = getdosmemword (0x463); - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_query_adapter_type() - called\n"); -#endif - - /* - * Attempt to call VGA Identify Adapter Function... - */ - regs.h.ah = 0x1a; - regs.h.al = 0; - int86(0x10, ®s, ®s); - if ((regs.h.al == 0x1a) && (retval == _NONE)) - { - /* - * We know that the PS/2 video BIOS is alive and well. - */ - switch (regs.h.al) - { - case 0: - retval = _NONE; - break; - case 1: - retval = _MDA; - break; - case 2: - retval = _CGA; - break; - case 4: - retval = _EGACOLOR; - SP->sizeable = TRUE; - break; - case 5: - retval = _EGAMONO; - break; - case 26: - retval = _VGACOLOR; /* ...alt. VGA BIOS... */ - case 7: - retval = _VGACOLOR; - SP->sizeable = TRUE; - break; - case 8: - retval = _VGAMONO; - break; - case 10: - case 13: - retval = _MCGACOLOR; - break; - case 12: - retval = _MCGAMONO; - break; - default: - retval = _CGA; - break; - } - } - else - { - /* - * No VGA BIOS, check for an EGA BIOS by selecting an - * Alternate Function Service... - * - * bx == 0x0010 --> return EGA information - */ - regs.h.ah = 0x12; -# ifdef WATCOMC - regs.w.bx = 0x10; -# else - regs.x.bx = 0x10; -# endif - int86(0x10, ®s, ®s); - if ((regs.h.bl != 0x10) && (retval == _NONE)) - { - /* - * An EGA BIOS exists... - */ - regs.h.ah = 0x12; - regs.h.bl = 0x10; - int86(0x10, ®s, ®s); - if (regs.h.bh == 0) - retval = _EGACOLOR; - else - retval = _EGAMONO; - } - else - if (retval == _NONE) - { - /* - * Now we know we only have CGA or MDA... - */ - int86(0x11, ®s, ®s); - equip = (regs.h.al & 0x30) >> 4; - switch (equip) - { - case 1: - case 2: - retval = _CGA; - break; - case 3: - retval = _MDA; - break; - default: - retval = _NONE; - break; - } - } - } - if (video_base == 0x3d4) - { - SP->video_seg = 0xb800; - switch (retval) - { - case _EGAMONO: - retval = _EGACOLOR; - break; - case _VGAMONO: - retval = _VGACOLOR; - break; - default: - break; - } - } - if (video_base == 0x3b4) - { - SP->video_seg = 0xb000; - switch (retval) - { - case _EGACOLOR: - retval = _EGAMONO; - break; - case _VGACOLOR: - retval = _VGAMONO; - break; - default: - break; - } - } - if ((retval == _NONE) -#ifndef CGA_DIRECT - || (retval == _CGA) -#endif - ) - { - SP->direct_video = FALSE; - } - if ((unsigned int) SP->video_seg == 0xb000) - SP->mono = TRUE; - else - SP->mono = FALSE; - - /* Check for DESQview shadow buffer */ - /* thanks to paganini@ax.apc.org for the GO32 fix */ -#if defined(GO32) && defined(NOW_WORKS) - dpmi_regs.h.ah = 0xfe; - dpmi_regs.h.al = 0; - dpmi_regs.x.di = SP->video_ofs; - dpmi_regs.x.es = SP->video_seg; - _go32_dpmi_simulate_int(0x10, &dpmi_regs); - SP->video_ofs = dpmi_regs.x.di; - SP->video_seg = dpmi_regs.x.es; -#endif - -#if !defined(GO32) && !defined(WATCOMC) - regs.h.ah = 0xfe; - regs.h.al = 0; - regs.x.di = SP->video_ofs; - segs.es = SP->video_seg; - int86x(0x10, ®s, ®s, &segs); - SP->video_ofs = regs.x.di; - SP->video_seg = segs.es; -#endif - - if (!SP->adapter) - SP->adapter = retval; - return (PDC_sanity_check(retval)); - -} - -/*man-start********************************************************************* - - PDC_sanity_check() - A video adapter identification sanity check - - PDCurses Description: - This is a private PDCurses routine. - - This routine will force sane values for various control flags. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_sanity_check( int adapter ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_sanity_check(int adapter) -#else -int PDC_sanity_check(adapter) -int adapter; -#endif -/***********************************************************************/ -{ - int fontsize = PDC_get_font(); - int rows = PDC_get_rows(); - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_sanity_check() - called: Adapter %d\n",adapter); -#endif - - switch (adapter) - { - case _EGACOLOR: - case _EGAMONO: - switch (rows) - { - case 25: break; - case 43: break; - default: - SP->bogus_adapter = TRUE; - break; - } - - switch (fontsize) - { - case _FONT8: break; - case _FONT14: break; - default: - SP->bogus_adapter = TRUE; - break; - } - break; - - case _VGACOLOR: - case _VGAMONO: - -/* */ -/* lets be reasonably flexible with VGAs - they could be Super VGAs */ -/* capable of displaying any number of lines. MH 10-Jun-92 */ -/* This also applies to font size. MH 16-Jun-92 */ -/* - switch (rows) - { - case 25: break; - case 43: break; - case 50: break; - default: - SP->bogus_adapter = TRUE; - break; - } - - switch (fontsize) - { - case _FONT8: break; - case _FONT14: break; - case _FONT16: break; - default: - SP->bogus_adapter = TRUE; - break; - } -*/ - break; - - case _CGA: - case _MDA: - case _MCGACOLOR: - case _MCGAMONO: - switch (rows) - { - case 25: break; - default: - SP->bogus_adapter = TRUE; - break; - } - break; - - default: - SP->bogus_adapter = TRUE; - break; - } - if (SP->bogus_adapter) - { - SP->sizeable = FALSE; - SP->direct_video = FALSE; - } - return (adapter); -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#ifdef PDCDEBUG +char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.2 2001/01/10 08:28:39 mark Exp $"; +#endif + +/*man-start********************************************************************* + + PDC_get_cursor_pos() - return current cursor position + + PDCurses Description: + This is a private PDCurses function + + Gets the cursor position in video page 0. 'row' and 'column' + are the cursor address. At this time, there is no support for + use of multiple screen pages. + + PDCurses Return Value: + This routine will return OK upon success and otherwise ERR will be + returned. + + PDCurses Errors: + There are no defined errors for this routine. + + Portability: + PDCurses int PDC_get_cursor_pos( int* row, int* col ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_cursor_pos(int *row, int *col) +#else +int PDC_get_cursor_pos(row,col) +int *row; +int *col; +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_cursor_pos() - called\n"); +#endif + + regs.h.ah = 0x03; + regs.h.bh = SP->video_page; + int86(0x10, ®s, ®s); + *row = regs.h.dh; + *col = regs.h.dl; + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_get_cur_col() - get current column position of cursor + + PDCurses Description: + This is a private PDCurses function + + This routine returns the current column position of the cursor on + screen. + + PDCurses Return Value: + This routine returns the current column position of the cursor. No + error is returned. + + PDCurses Errors: + There are no defined errors for this routine. + + Portability: + PDCurses int PDC_get_cur_col( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_cur_col(void) +#else +int PDC_get_cur_col() +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_cur_col() - called\n"); +#endif + +#ifdef WATCOMC + regs.w.ax = 0x0003; +#else + regs.x.ax = 0x0003; +#endif + regs.h.bh = SP->video_page; + int86(0x10, ®s, ®s); + return((int) regs.h.dl); + +} + +/*man-start********************************************************************* + + PDC_get_cur_row() - get current row position of cursor + + PDCurses Description: + This is a private PDCurses function + + This routine returns the current row position of the cursor on + screen. + + PDCurses Return Value: + This routine returns the current row position of the cursor. No + error is returned. + + PDCurses Errors: + There are no defined errors for this routine. + + Portability: + PDCurses int PDC_get_cur_row( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_cur_row(void) +#else +int PDC_get_cur_row() +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_cur_row() - called\n"); +#endif + +#ifdef WATCOMC + regs.w.ax = 0x0003; +#else + regs.x.ax = 0x0003; +#endif + regs.h.bh = SP->video_page; + int86(0x10, ®s, ®s); + return ((int) regs.h.dh); + +} + +/*man-start********************************************************************* + + PDC_get_attribute() - Get attribute at current cursor + + PDCurses Description: + This is a private PDCurses function + + Return the current attr at current cursor position on the screen. + + PDCurses Return Value: + This routine will return OK upon success and otherwise ERR will be + returned. + + PDCurses Errors: + There are no defined errors for this routine. + + Portability: + PDCurses int PDC_get_attribute( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_attribute(void) +#else +int PDC_get_attribute() +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_attribute() - called\n"); +#endif + +#ifdef WATCOMC + regs.w.ax = 0x0800; +#else + regs.x.ax = 0x0800; +#endif + regs.h.bh = SP->video_page; + int86(0x10, ®s, ®s); + return ((int) regs.h.ah); + +} + +/*man-start********************************************************************* + + PDC_get_columns() - return width of screen/viewport. + + PDCurses Description: + This is a private PDCurses function + + This function will return the width of the current screen. + + PDCurses Return Value: + This routine will return OK upon success and otherwise ERR will be + returned. + + PDCurses Errors: + There are no defined errors for this routine. + + Portability: + PDCurses int PDC_get_columns( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_columns(void) +#else +int PDC_get_columns() +#endif +/***********************************************************************/ +{ + int cols=0; + char *env_cols=NULL; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_columns() - called\n"); +#endif + +/* use the value from COLS environment variable, if set. MH 10-Jun-92 */ +/* and use the minimum of COLS and return from int10h MH 18-Jun-92 */ + regs.h.ah = 0x0f; + int86(0x10, ®s, ®s); + cols = (int)regs.h.ah; + env_cols = (char *)getenv("COLS"); + if (env_cols != (char *)NULL) + { + cols = min(atoi(env_cols),cols); + } +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_columns() - returned: cols %d\n",cols); +#endif + return(cols); + +} + +/*man-start********************************************************************* + + PDC_get_cursor_mode() - Get the cursor start and stop scan lines. + + PDCurses Description: + Gets the cursor type to begin in scan line startrow and end in + scan line endrow. Both values should be 0-31. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_get_cursor_mode( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_cursor_mode(void) +#else +int PDC_get_cursor_mode() +#endif +/***********************************************************************/ +{ + short cmode=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_cursor_mode() - called\n"); +#endif + + cmode = getdosmemword (0x460); + return (cmode); + +} + +/*man-start********************************************************************* + + PDC_get_font() - Get the current font size + + PDCurses Description: + This is a private PDCurses routine. + + This function returns the current font size. This function only + works if the #define FAST_VIDEO is true. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + An ERR will be returned if FAST_VIDEO is not true. + + Portability: + PDCurses int PDC_get_font( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_font(void) +#else +int PDC_get_font() +#endif +/***********************************************************************/ +{ +#if defined (FAST_VIDEO) + int retval=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_font() - called\n"); +#endif + +#if defined (FAST_VIDEO) + retval = getdosmemword (0x485); + if ((retval == 0) && (SP->adapter == _MDS_GENIUS)) + { + retval = _FONT15; /* Assume the MDS Genius is in 66 line mode. */ + } + switch (SP->adapter) + { + case _MDA: + retval = 10; /* POINTS is not certain on MDA/Hercules */ + break; + case _EGACOLOR: + case _EGAMONO: + switch (retval) + { + case _FONT8: + case _FONT14: + break; + default: + retval = _FONT14; + } + break; + + case _VGACOLOR: + case _VGAMONO: + switch (retval) + { + case _FONT8: + case _FONT14: + case _FONT16: + break; + default: + break; + } + break; + case _CGA: + retval = _FONT8; + break; + default: + break; + } + return( retval ); +#endif + +} + +/*man-start********************************************************************* + + PDC_get_rows() - Return number of screen rows. + + PDCurses Description: + This is a private PDCurses routine. + + Returns the maximum number of rows supported by the display. + e.g. 25, 28, 43, 50, 60, 66... + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_get_rows( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_rows(void) +#else +int PDC_get_rows() +#endif +/***********************************************************************/ +{ + char *env_rows=NULL; + int rows=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_rows() - called\n"); +#endif + +/* use the value from LINES environment variable, if set. MH 10-Jun-92 */ +/* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */ + rows = getdosmembyte(0x484) + 1; + env_rows = (char *)getenv("LINES"); + if (env_rows != (char *)NULL) + rows = min(atoi(env_rows),rows); + + if ((rows == 1) && (SP->adapter == _MDS_GENIUS)) + rows = 66; + if ((rows == 1) && (SP->adapter == _MDA)) + rows = 25; /* new test MH 10-Jun-92 */ + if (rows == 1) + { + rows = _default_lines; /* Allow pre-setting LINES */ + SP->direct_video = FALSE; + } + switch (SP->adapter) + { + case _EGACOLOR: + case _EGAMONO: + switch (rows) + { + case 25: + case 43: + break; + default: + rows = 25; + } + break; + + case _VGACOLOR: + case _VGAMONO: +/* lets be reasonably flexible with VGAs - they could be Super VGAs */ +/* capable of displaying any number of lines. MH 10-Jun-92 */ +/* + switch (rows) + { + case 25: + case 28: + case 50: + break; + default: + rows = 25; + } +*/ + break; + + default: + rows = 25; + break; + } + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_rows() - returned: rows %d\n",rows); +#endif + + return (rows); + +} + +/*man-start********************************************************************* + + PDC_get_scrn_mode() - Return the current BIOS video mode + + PDCurses Description: + This is a private PDCurses routine. + + + PDCurses Return Value: + Returns the current BIOS Video Mode Number. + + PDCurses Errors: + The FLEXOS version of this routine returns an ERR. + The UNIX version of this routine returns an ERR. + The EMXVIDEO version of this routine returns an ERR. + + Portability: + PDCurses int PDC_get_scrn_mode( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_scrn_mode(void) +#else +int PDC_get_scrn_mode() +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_scrn_mode() - called\n"); +#endif + + regs.h.ah = 0x0f; + int86(0x10, ®s, ®s); + return ((int) regs.h.al); + +} + +/*man-start********************************************************************* + + PDC_query_adapter_type() - Determine PC video adapter type + + PDCurses Description: + This is a private PDCurses routine. + + Thanks to Jeff Duntemann, K16RA for providing the impetus + (through the Dr. Dobbs Journal, March 1989 issue) for getting + the routines below merged into Bjorn Larsson's PDCurses 1.3... + -- frotz@dri.com 900730 + + PDCurses Return Value: + This function returns a macro identifier indicating the adapter + type. See the list of adapter types in CURSPRIV.H. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_query_adapter_type( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_query_adapter_type(void) +#else +int PDC_query_adapter_type() +#endif +/***********************************************************************/ +{ + int retval = _NONE; + + /* thanks to paganini@ax.apc.org for the GO32 fix */ +# if defined(GO32) && defined(NOW_WORKS) +# include + _go32_dpmi_registers dpmi_regs; +# endif + + int equip; + struct SREGS segs; + short video_base = getdosmemword (0x463); + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_query_adapter_type() - called\n"); +#endif + + /* + * Attempt to call VGA Identify Adapter Function... + */ + regs.h.ah = 0x1a; + regs.h.al = 0; + int86(0x10, ®s, ®s); + if ((regs.h.al == 0x1a) && (retval == _NONE)) + { + /* + * We know that the PS/2 video BIOS is alive and well. + */ + switch (regs.h.al) + { + case 0: + retval = _NONE; + break; + case 1: + retval = _MDA; + break; + case 2: + retval = _CGA; + break; + case 4: + retval = _EGACOLOR; + SP->sizeable = TRUE; + break; + case 5: + retval = _EGAMONO; + break; + case 26: + retval = _VGACOLOR; /* ...alt. VGA BIOS... */ + case 7: + retval = _VGACOLOR; + SP->sizeable = TRUE; + break; + case 8: + retval = _VGAMONO; + break; + case 10: + case 13: + retval = _MCGACOLOR; + break; + case 12: + retval = _MCGAMONO; + break; + default: + retval = _CGA; + break; + } + } + else + { + /* + * No VGA BIOS, check for an EGA BIOS by selecting an + * Alternate Function Service... + * + * bx == 0x0010 --> return EGA information + */ + regs.h.ah = 0x12; +# ifdef WATCOMC + regs.w.bx = 0x10; +# else + regs.x.bx = 0x10; +# endif + int86(0x10, ®s, ®s); + if ((regs.h.bl != 0x10) && (retval == _NONE)) + { + /* + * An EGA BIOS exists... + */ + regs.h.ah = 0x12; + regs.h.bl = 0x10; + int86(0x10, ®s, ®s); + if (regs.h.bh == 0) + retval = _EGACOLOR; + else + retval = _EGAMONO; + } + else + if (retval == _NONE) + { + /* + * Now we know we only have CGA or MDA... + */ + int86(0x11, ®s, ®s); + equip = (regs.h.al & 0x30) >> 4; + switch (equip) + { + case 1: + case 2: + retval = _CGA; + break; + case 3: + retval = _MDA; + break; + default: + retval = _NONE; + break; + } + } + } + if (video_base == 0x3d4) + { + SP->video_seg = 0xb800; + switch (retval) + { + case _EGAMONO: + retval = _EGACOLOR; + break; + case _VGAMONO: + retval = _VGACOLOR; + break; + default: + break; + } + } + if (video_base == 0x3b4) + { + SP->video_seg = 0xb000; + switch (retval) + { + case _EGACOLOR: + retval = _EGAMONO; + break; + case _VGACOLOR: + retval = _VGAMONO; + break; + default: + break; + } + } + if ((retval == _NONE) +#ifndef CGA_DIRECT + || (retval == _CGA) +#endif + ) + { + SP->direct_video = FALSE; + } + if ((unsigned int) SP->video_seg == 0xb000) + SP->mono = TRUE; + else + SP->mono = FALSE; + + /* Check for DESQview shadow buffer */ + /* thanks to paganini@ax.apc.org for the GO32 fix */ +#if defined(GO32) && defined(NOW_WORKS) + dpmi_regs.h.ah = 0xfe; + dpmi_regs.h.al = 0; + dpmi_regs.x.di = SP->video_ofs; + dpmi_regs.x.es = SP->video_seg; + _go32_dpmi_simulate_int(0x10, &dpmi_regs); + SP->video_ofs = dpmi_regs.x.di; + SP->video_seg = dpmi_regs.x.es; +#endif + +#if !defined(GO32) && !defined(WATCOMC) + regs.h.ah = 0xfe; + regs.h.al = 0; + regs.x.di = SP->video_ofs; + segs.es = SP->video_seg; + int86x(0x10, ®s, ®s, &segs); + SP->video_ofs = regs.x.di; + SP->video_seg = segs.es; +#endif + + if (!SP->adapter) + SP->adapter = retval; + return (PDC_sanity_check(retval)); + +} + +/*man-start********************************************************************* + + PDC_sanity_check() - A video adapter identification sanity check + + PDCurses Description: + This is a private PDCurses routine. + + This routine will force sane values for various control flags. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_sanity_check( int adapter ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_sanity_check(int adapter) +#else +int PDC_sanity_check(adapter) +int adapter; +#endif +/***********************************************************************/ +{ + int fontsize = PDC_get_font(); + int rows = PDC_get_rows(); + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_sanity_check() - called: Adapter %d\n",adapter); +#endif + + switch (adapter) + { + case _EGACOLOR: + case _EGAMONO: + switch (rows) + { + case 25: break; + case 43: break; + default: + SP->bogus_adapter = TRUE; + break; + } + + switch (fontsize) + { + case _FONT8: break; + case _FONT14: break; + default: + SP->bogus_adapter = TRUE; + break; + } + break; + + case _VGACOLOR: + case _VGAMONO: + +/* */ +/* lets be reasonably flexible with VGAs - they could be Super VGAs */ +/* capable of displaying any number of lines. MH 10-Jun-92 */ +/* This also applies to font size. MH 16-Jun-92 */ +/* + switch (rows) + { + case 25: break; + case 43: break; + case 50: break; + default: + SP->bogus_adapter = TRUE; + break; + } + + switch (fontsize) + { + case _FONT8: break; + case _FONT14: break; + case _FONT16: break; + default: + SP->bogus_adapter = TRUE; + break; + } +*/ + break; + + case _CGA: + case _MDA: + case _MCGACOLOR: + case _MCGAMONO: + switch (rows) + { + case 25: break; + default: + SP->bogus_adapter = TRUE; + break; + } + break; + + default: + SP->bogus_adapter = TRUE; + break; + } + if (SP->bogus_adapter) + { + SP->sizeable = FALSE; + SP->direct_video = FALSE; + } + return (adapter); +} diff --git a/dos/pdcgo32.c b/dos/pdcgo32.c index 2e476e0d..af1d2d56 100644 --- a/dos/pdcgo32.c +++ b/dos/pdcgo32.c @@ -1,59 +1,59 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCgo32 = "$Id: pdcgo32.c,v 1.1 2001/01/10 08:28:40 mark Exp $"; -#endif - - - -#include -#include /* prototypes of dosmemget() and dosmemput() */ - -unsigned char getdosmembyte (int offset) -{ - unsigned char b=0; - - dosmemget (offset, sizeof(unsigned char), &b); - return b; -} - -unsigned short getdosmemword (int offset) -{ - unsigned short w=0; - - dosmemget (offset, sizeof(unsigned short), &w); - return w; -} - -void setdosmembyte (int offset, unsigned char b) -{ - dosmemput (&b, sizeof(unsigned char), offset); -} - -void setdosmemword (int offset, unsigned short w) -{ - dosmemput (&w, sizeof(unsigned short), offset); -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#ifdef PDCDEBUG +char *rcsid_PDCgo32 = "$Id: pdcgo32.c,v 1.2 2001/01/10 08:28:41 mark Exp $"; +#endif + + + +#include +#include /* prototypes of dosmemget() and dosmemput() */ + +unsigned char getdosmembyte (int offset) +{ + unsigned char b=0; + + dosmemget (offset, sizeof(unsigned char), &b); + return b; +} + +unsigned short getdosmemword (int offset) +{ + unsigned short w=0; + + dosmemget (offset, sizeof(unsigned short), &w); + return w; +} + +void setdosmembyte (int offset, unsigned char b) +{ + dosmemput (&b, sizeof(unsigned char), offset); +} + +void setdosmemword (int offset, unsigned short w) +{ + dosmemput (&w, sizeof(unsigned short), offset); +} diff --git a/dos/pdckbd.c b/dos/pdckbd.c index 62325071..05d64082 100644 --- a/dos/pdckbd.c +++ b/dos/pdckbd.c @@ -1,685 +1,685 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ - -#ifdef GO32 -# include -#else -# include -#endif - -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - - -#ifdef PDCDEBUG -char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.1 2001/01/10 08:28:42 mark Exp $"; -#endif - -/******************************************************************************* -* Table for key code translation of function keys in keypad mode -* These values are for strict IBM keyboard compatibles only -*******************************************************************************/ - - -static int kptab[] = -{ - /* Normal Function Keys */ - 0x3b, KEY_F(1), 0x3c, KEY_F(2), 0x3d, KEY_F(3), 0x3e, KEY_F(4), - 0x3f, KEY_F(5), 0x40, KEY_F(6), 0x41, KEY_F(7), 0x42, KEY_F(8), - 0x43, KEY_F(9), 0x44, KEY_F(10), - - /* Normal Keypad */ - 0x47, KEY_HOME, 0x48, KEY_UP, 0x49, KEY_PPAGE, - 0x4b, KEY_LEFT, 0x4c, KEY_B2, 0x4d, KEY_RIGHT, - 0x4f, KEY_END, 0x50, KEY_DOWN, 0x51, KEY_NPAGE, - 0x52, KEY_IC, 0x53, KEY_DC, - - /* Shft-Function Keys */ - 0x54, KEY_F(13), 0x55, KEY_F(14), 0x56, KEY_F(15), 0x57, KEY_F(16), - 0x58, KEY_F(17), 0x59, KEY_F(18), 0x5a, KEY_F(19), 0x5b, KEY_F(20), - 0x5c, KEY_F(21), 0x5d, KEY_F(22), - - /* Ctl-Function Keys */ - 0x5e, KEY_F(25), 0x5f, KEY_F(26), 0x60, KEY_F(27), 0x61, KEY_F(28), - 0x62, KEY_F(29), 0x63, KEY_F(30), 0x64, KEY_F(31), 0x65, KEY_F(32), - 0x66, KEY_F(33), 0x67, KEY_F(34), - - /* Alt-Function Keys */ - 0x68, KEY_F(37), 0x69, KEY_F(38), 0x6a, KEY_F(39), 0x6b, KEY_F(40), - 0x6c, KEY_F(41), 0x6d, KEY_F(42), 0x6e, KEY_F(43), 0x6f, KEY_F(44), - 0x70, KEY_F(45), 0x71, KEY_F(46), - - /* Control-Keypad */ - 0x77, CTL_HOME, 0x84, CTL_PGUP, - 0x73, CTL_LEFT, 0x74, CTL_RIGHT, - 0x75, CTL_END, 0x76, CTL_PGDN, - - /* Alt-Numbers */ - 0x78, ALT_1, 0x79, ALT_2, 0x7a, ALT_3, 0x7b, ALT_4, - 0x7c, ALT_5, 0x7d, ALT_6, 0x7e, ALT_7, 0x7f, ALT_8, - 0x80, ALT_9, 0x81, ALT_0, - - /* Extended codes */ - 0x85, KEY_F(11), 0x86, KEY_F(12), 0x87, KEY_F(23), 0x88, KEY_F(24), - 0x89, KEY_F(35), 0x8a, KEY_F(36), 0x8b, KEY_F(47), 0x8c, KEY_F(48), - 0x03, 0, /* NULL */ - -#if defined(NUMKEYPAD) - 0xff, (int)'/', 0x0d, (int)'\n', - 0xfa, (int)'*', 0xfd, (int)'-', 0xfb, (int)'+', -#else - 0xff, PADSLASH, 0x0d, PADENTER, - 0xfa, PADSTAR, 0xfd, PADMINUS, 0xfb, PADPLUS, -#endif - - 0x0a, CTL_PADENTER, - 0xa6, ALT_PADENTER, 0x53, (int)'.', 0xfc, CTL_ENTER, - 0x93, CTL_DEL, 0x8f, CTL_PADCENTER, 0x90, CTL_PADPLUS, - 0x8e, CTL_PADMINUS, 0x95, CTL_PADSLASH, 0x96, CTL_PADSTAR, - 0x4e, ALT_PADPLUS, 0x4a, ALT_PADMINUS, 0xa4, ALT_PADSLASH, - 0x37, ALT_PADSTAR, 0x92, CTL_INS, 0xa2, ALT_INS, - 0xa3, ALT_DEL, 0x8d, CTL_UP, 0x91, CTL_DOWN, - 0x94, CTL_TAB, 0xa5, ALT_TAB, 0x82, ALT_MINUS, - 0x83, ALT_EQUAL, 0x99, ALT_PGUP, 0xa1, ALT_PGDN, - 0x9f, ALT_END, 0x98, ALT_UP, 0xa0, ALT_DOWN, - 0x9d, ALT_RIGHT, 0x9b, ALT_LEFT, 0x1c, ALT_ENTER, - 0x97, ALT_HOME, 0x01, ALT_ESC, 0x0e, ALT_BKSP, - 0x29, ALT_BQUOTE, 0x1a, ALT_LBRACKET, 0x1b, ALT_RBRACKET, - 0x27, ALT_SEMICOLON,0x28, ALT_FQUOTE, 0x33, ALT_COMMA, - 0x34, ALT_STOP, 0x35, ALT_FSLASH, 0x2b, ALT_BSLASH, - - /* Alt-Alphabet */ - 0x1e, ALT_A, 0x30, ALT_B, 0x2e, ALT_C, 0x20, ALT_D, - 0x12, ALT_E, 0x21, ALT_F, 0x22, ALT_G, 0x23, ALT_H, - 0x17, ALT_I, 0x24, ALT_J, 0x25, ALT_K, 0x26, ALT_L, - 0x32, ALT_M, 0x31, ALT_N, 0x18, ALT_O, 0x19, ALT_P, - 0x10, ALT_Q, 0x13, ALT_R, 0x1f, ALT_S, 0x14, ALT_T, - 0x16, ALT_U, 0x2f, ALT_V, 0x11, ALT_W, 0x2d, ALT_X, - 0x15, ALT_Y, 0x2c, ALT_Z, - 0x0f, KEY_BTAB, - 0x100, (-1) -}; - /* End of kptab[] */ - -static unsigned long pdc_key_modifiers=0L; -MOUSE_STATUS Trapped_Mouse_status; - -/*man-start********************************************************************* - - PDC_breakout() - check for type-ahead - - X/Open Description: - The curses package does the "line-breakout optimisation" by - looking for type-ahead periodically while updating the screen. - If input is found, the current update will be postponed until - refresh() or doupdate() are called again. This allows faster - response to commands typed in advance. Normally, the input FILE - pointer passed to newterm(), or stdin in the case when initscr() - was called, will be used to do this type-ahead checking. This routine - will do the actual check for PDcurses to see if input is pending. - - PDCurses Description: - This routine does what the PDcurses typeahead routine used to do. But - to make that routine consistent with its System V counterpart, all it - does now is set whether or not typeahead checking is performed. - - X/Open Return Value: - The PDC_breakout() routine returns TRUE if keyboard input is pending - otherwise FALSE is returned. - - Portability: - PDCurses bool PD_breakout( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_breakout( void ) -#else -bool PDC_breakout() -#endif -/***********************************************************************/ -{ -extern int c_pindex; /* putter index */ -extern int c_gindex; /* getter index */ -extern int c_ungind; /* wungetch() push index */ -#ifdef TC -# pragma argsused -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_breakout() - called\n"); -#endif - - if (c_ungind) - return (TRUE); /* ungotten char */ - if (c_pindex > c_gindex) - return (TRUE); /* buffered char */ - if (SP->raw_inp) - return((bool)PDC_check_bios_key());/* raw mode test */ - - return((bool)PDC_check_bios_key()); /* normal mode test */ -} - -/*man-start********************************************************************* - - PDC_get_input_fd() - Get file descriptor used for PDCurses input - - PDCurses Description: - This is a private PDCurses routine. - - This routine will return the file descriptor that PDCurses reads - its input from. It can be used for select(). - - PDCurses Return Value: - Returns a file descriptor. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_input_fd( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_input_fd(void) -#else -int PDC_get_input_fd() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_input_fd() - called\n"); -#endif - - return fileno (stdin); -} - -/*man-start********************************************************************* - - PDC_check_bios_key() - Check BIOS key data area for input - - PDCurses Description: - This is a private PDCurses routine. - - This routine will check the BIOS for any indication that - keystrokes are pending. - - PDCurses Return Value: - Returns 1 if a keyboard character is available, 0 otherwise. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses bool PDC_check_bios_key( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_check_bios_key(void) -#else -bool PDC_check_bios_key() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_check_bios_key() - called\n"); -#endif - - return(kbhit()); -} - -/*man-start********************************************************************* - - PDC_get_bios_key() - Returns the next key available from the BIOS. - - PDCurses Description: - This is a private PDCurses routine. - - Returns the next key code struck at the keyboard. If the low 8 - bits are 0, the upper bits contain the extended character - code. If bit 0-7 are non-zero, the upper bits = 0. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_bios_key( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_bios_key(void) -#else -int PDC_get_bios_key() -#endif -/***********************************************************************/ -{ - int ascii=0,scan=0; - static unsigned char keyboard_function=0xFF; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_bios_key() - called\n"); -#endif - - if (keyboard_function == 0xFF) - { - regs.h.ah = 0x02; /* get shift status for all keyboards */ - int86(0x16, ®s, ®s); - scan = regs.h.al; - regs.h.ah = 0x12; /* get shift status for enhanced keyboards */ - int86(0x16, ®s, ®s); - if (scan == regs.h.al - && getdosmembyte(0x496) == 0x10) - keyboard_function = 0x10; - else - keyboard_function = 0x0; - } - regs.h.ah = keyboard_function; - int86(0x16, ®s, ®s); - ascii = regs.h.al; - scan = regs.h.ah; - pdc_key_modifiers = 0; - if (SP->save_key_modifiers) - { - regs.h.ah = 0x02; /* get shift status for all keyboards */ - int86(0x16, ®s, ®s); - if (regs.h.al & 0x01 - || regs.h.al & 0x02) - pdc_key_modifiers |= PDC_KEY_MODIFIER_SHIFT; - if (regs.h.al & 0x04) - pdc_key_modifiers |= PDC_KEY_MODIFIER_CONTROL; - if (regs.h.al & 0x08) - pdc_key_modifiers |= PDC_KEY_MODIFIER_ALT; - if (regs.h.al & 0x20) - pdc_key_modifiers |= PDC_KEY_MODIFIER_NUMLOCK; - } - - if (scan == 0x1c && ascii == 0x0a) /* ^Enter */ - return ((int) (0xfc00)); - if ((scan == 0x03 && ascii == 0x00) /* ^@ - Null */ - || (scan == 0xe0 && ascii == 0x0d) /* PadEnter */ - || (scan == 0xe0 && ascii == 0x0a)) /* ^PadEnter */ - return ((int) (ascii << 8)); - if ((scan == 0x37 && ascii == 0x2a) /* Star */ - || (scan == 0x4a && ascii == 0x2d) /* Minus */ - || (scan == 0x4e && ascii == 0x2b) /* Plus */ - || (scan == 0xe0 && ascii == 0x2f)) /* Slash */ - return ((int) ((ascii & 0x0f) | 0xf0) << 8); - if (ascii == 0x00 || ascii == 0xe0) - return ((int) (scan << 8)); - return ((int) (ascii)); -} - -/*man-start********************************************************************* - - PDC_get_ctrl_break() - return OS control break state - - PDCurses Description: - This is a private PDCurses routine. - - Returns the current OS Control Break Check state. - - PDCurses Return Value: - DOS: - This function returns TRUE on if the Control Break - Check is enabled otherwise FALSE is returned. - - FLEXOS: - This function returns TRUE on if the Keyboard Mode - allows a break to bre reported otherwise FALSE is returned. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses bool PDC_get_ctrl_break( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_get_ctrl_break(void) -#else -bool PDC_get_ctrl_break() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_ctrl_break() - called\n"); -#endif - - regs.h.ah = 0x33; - regs.h.al = 0x00; - int86(0x21, ®s, ®s); - return ((bool) regs.h.dl); -} - -/*man-start********************************************************************* - - PDC_rawgetch() - Returns the next uninterpreted character (if available). - - PDCurses Description: - Gets a character without any interpretation at all and returns - it. If keypad mode is active for the designated window, - function key translation will be performed. Otherwise, - function keys are ignored. If nodelay mode is active in the - window, then PDC_rawgetch() returns -1 if no character is - available. - - WARNING: It is unknown whether the FUNCTION key translation - is performed at this level. --Frotz 911130 BUG - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_rawgetch( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_rawgetch(void) -#else -int PDC_rawgetch() -#endif -/***********************************************************************/ -{ -extern WINDOW* _getch_win_; -/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ - /* is the same window - all references to w changed*/ - /* to _getch_win_ - marked with @@ */ - - int c=0; - int oldc=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_rawgetch() - called\n"); -#endif - - if (_getch_win_ == (WINDOW *)NULL) /* @@ */ - return( -1 ); - - if (_getch_win_->_nodelay && !PDC_breakout()) /* @@ */ - return( -1 ); - - while (1) /* loop to get valid char */ - { - c = PDC_get_bios_key(); - oldc = c; - /* - * Return the key if it is not a special key. - */ - if ((c = PDC_validchar(c)) >= 0) - { /* get & check next char */ - return( c ); - } - if (_getch_win_->_use_keypad) - return( oldc ); - } -} - -/*man-start********************************************************************* - - PDC_set_ctrl_break() - Enables/Disables the host OS BREAK key check. - - PDCurses Description: - This is a private PDCurses routine. - - Enables/Disables the host OS BREAK key check. If the supplied setting - is TRUE, this enables CTRL/C and CTRL/BREAK to abort the process. - If FALSE, CTRL/C and CTRL/BREAK are ignored. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_set_ctrl_break( bool setting ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_ctrl_break(bool setting) -#else -int PDC_set_ctrl_break(setting) -bool setting; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_ctrl_break() - called\n"); -#endif - -#ifdef NDP - if( setting ) - _ignore_breaks(); - else - _watch_breaks(); -#else -# ifdef GO32 - (void*)signal(SIGINT,(setting ? SIG_DFL : SIG_IGN)); -/* __djgpp_set_ctrl_c(setting);*/ - setcbrk(setting); -# else - regs.h.ah = 0x33; - regs.h.al = 0x00; - regs.h.dl = (unsigned char) (setting ? 1 : 0); - int86(0x21, ®s, ®s); -# endif -#endif - return( OK ); -} - -/*man-start********************************************************************* - - PDC_sysgetch() - Return a character using default system routines. - - PDCurses Description: - This is a private PDCurses function. - - Gets a character without normal ^S, ^Q, ^P and ^C interpretation - and returns it. If keypad mode is active for the designated - window, function key translation will be performed. Otherwise, - function keys are ignored. If nodelay mode is active in the - window, then sysgetch() returns -1 if no character is - available. - - PDCurses Return Value: - This function returns OK upon success otherwise ERR is returned. - - PDCurses Errors: - No errors are defined for this routine. - - Portability: - PDCurses int PDC_sysgetch( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_sysgetch(void) -#else -int PDC_sysgetch() -#endif -/***********************************************************************/ -{ -extern WINDOW* _getch_win_; -/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ - /* is the same window - all references to w changed*/ - /* to _getch_win_ - marked with @@ */ - - int c=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_sysgetch() - called\n"); -#endif - - if (_getch_win_ == (WINDOW *)NULL) /* @@ */ - return (-1); - - if (_getch_win_->_nodelay && !PDC_breakout()) - return (-1); - - while (1) - { - c = PDC_get_bios_key(); - /* - * Return the key if it is not a special key. - */ - if ((unsigned int)c < 256) - return(c); - if ((c = PDC_validchar(c)) >= 0) - return (c); /* get & check next char */ - } -} - -/*man-start********************************************************************* - - PDC_validchar() - validate/translate passed character - - PDCurses Description: - This is a private PDCurses function. - - Checks that 'c' is a valid character, and if so returns it, - with function key translation applied if 'w' has keypad mode - set. If char is invalid, returns -1. - - PDCurses Return Value: - This function returns -1 if the passed character is invalid, or - the WINDOW* 'w' is NULL, or 'w's keypad is not active. - - This function returns 0 under Flexos if the passed character - is 0x0300. (-:Forget why. --Frotz 911130:-) - - Otherwise, this function returns the PDCurses equivalent of the - passed character. See the function key and key macros in - - - PDCurses Errors: - There are no errors defined for this routine. - - Portability: - PDCurses int PDC_validchar( int c ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_validchar(int c) -#else -int PDC_validchar(c) -int c; -#endif -/***********************************************************************/ -{ -extern WINDOW* _getch_win_; -/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ - /* is the same window - all references to w changed*/ - /* to _getch_win_ - marked with @@ */ - - int *scanp=NULL; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_validchar() - called\n"); -#endif - - if (_getch_win_ == (WINDOW *)NULL) - return (-1); /* bad window pointer */ - - if ((unsigned int)c < 256) return (c); /* normal character */ - if (!(_getch_win_->_use_keypad)) return (-1); /* skip if keys if !keypad mode */ - - /* - * Under DOS, extended keys are in the upper byte. Shift down for a - * comparison. - */ - c = (c >> 8) & 0xFF; - - scanp = kptab; - while (*scanp > 0) /* search for value */ - { /* (stops on table entry 0x100) */ - if (*scanp++ == c) - { - return (*scanp); /* found, return it */ - } - scanp++; - } - return( -1 ); /* not found, invalid */ -} - -/*man-start********************************************************************* - - PDC_get_key_modifiers() - Returns the keyboard modifier(s) at time of last getch() - - PDCurses Description: - This is a private PDCurses routine. - - Returns the keyboard modifiers effective at the time of the last getch() - call only if PDC_save_key_modifiers(TRUE) has been called before the - getch(); - Use the macros; PDC_KEY_MODIFIER_* to determine which modifier(s) - were set. - - PDCurses Return Value: - This function returns the modifiers. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_key_modifiers( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -unsigned long PDC_get_key_modifiers(void) -#else -unsigned long PDC_get_key_modifiers() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_key_modifiers() - called\n"); -#endif - return(pdc_key_modifiers); -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ + +#ifdef GO32 +# include +#else +# include +#endif + +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + + +#ifdef PDCDEBUG +char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.2 2001/01/10 08:28:43 mark Exp $"; +#endif + +/******************************************************************************* +* Table for key code translation of function keys in keypad mode +* These values are for strict IBM keyboard compatibles only +*******************************************************************************/ + + +static int kptab[] = +{ + /* Normal Function Keys */ + 0x3b, KEY_F(1), 0x3c, KEY_F(2), 0x3d, KEY_F(3), 0x3e, KEY_F(4), + 0x3f, KEY_F(5), 0x40, KEY_F(6), 0x41, KEY_F(7), 0x42, KEY_F(8), + 0x43, KEY_F(9), 0x44, KEY_F(10), + + /* Normal Keypad */ + 0x47, KEY_HOME, 0x48, KEY_UP, 0x49, KEY_PPAGE, + 0x4b, KEY_LEFT, 0x4c, KEY_B2, 0x4d, KEY_RIGHT, + 0x4f, KEY_END, 0x50, KEY_DOWN, 0x51, KEY_NPAGE, + 0x52, KEY_IC, 0x53, KEY_DC, + + /* Shft-Function Keys */ + 0x54, KEY_F(13), 0x55, KEY_F(14), 0x56, KEY_F(15), 0x57, KEY_F(16), + 0x58, KEY_F(17), 0x59, KEY_F(18), 0x5a, KEY_F(19), 0x5b, KEY_F(20), + 0x5c, KEY_F(21), 0x5d, KEY_F(22), + + /* Ctl-Function Keys */ + 0x5e, KEY_F(25), 0x5f, KEY_F(26), 0x60, KEY_F(27), 0x61, KEY_F(28), + 0x62, KEY_F(29), 0x63, KEY_F(30), 0x64, KEY_F(31), 0x65, KEY_F(32), + 0x66, KEY_F(33), 0x67, KEY_F(34), + + /* Alt-Function Keys */ + 0x68, KEY_F(37), 0x69, KEY_F(38), 0x6a, KEY_F(39), 0x6b, KEY_F(40), + 0x6c, KEY_F(41), 0x6d, KEY_F(42), 0x6e, KEY_F(43), 0x6f, KEY_F(44), + 0x70, KEY_F(45), 0x71, KEY_F(46), + + /* Control-Keypad */ + 0x77, CTL_HOME, 0x84, CTL_PGUP, + 0x73, CTL_LEFT, 0x74, CTL_RIGHT, + 0x75, CTL_END, 0x76, CTL_PGDN, + + /* Alt-Numbers */ + 0x78, ALT_1, 0x79, ALT_2, 0x7a, ALT_3, 0x7b, ALT_4, + 0x7c, ALT_5, 0x7d, ALT_6, 0x7e, ALT_7, 0x7f, ALT_8, + 0x80, ALT_9, 0x81, ALT_0, + + /* Extended codes */ + 0x85, KEY_F(11), 0x86, KEY_F(12), 0x87, KEY_F(23), 0x88, KEY_F(24), + 0x89, KEY_F(35), 0x8a, KEY_F(36), 0x8b, KEY_F(47), 0x8c, KEY_F(48), + 0x03, 0, /* NULL */ + +#if defined(NUMKEYPAD) + 0xff, (int)'/', 0x0d, (int)'\n', + 0xfa, (int)'*', 0xfd, (int)'-', 0xfb, (int)'+', +#else + 0xff, PADSLASH, 0x0d, PADENTER, + 0xfa, PADSTAR, 0xfd, PADMINUS, 0xfb, PADPLUS, +#endif + + 0x0a, CTL_PADENTER, + 0xa6, ALT_PADENTER, 0x53, (int)'.', 0xfc, CTL_ENTER, + 0x93, CTL_DEL, 0x8f, CTL_PADCENTER, 0x90, CTL_PADPLUS, + 0x8e, CTL_PADMINUS, 0x95, CTL_PADSLASH, 0x96, CTL_PADSTAR, + 0x4e, ALT_PADPLUS, 0x4a, ALT_PADMINUS, 0xa4, ALT_PADSLASH, + 0x37, ALT_PADSTAR, 0x92, CTL_INS, 0xa2, ALT_INS, + 0xa3, ALT_DEL, 0x8d, CTL_UP, 0x91, CTL_DOWN, + 0x94, CTL_TAB, 0xa5, ALT_TAB, 0x82, ALT_MINUS, + 0x83, ALT_EQUAL, 0x99, ALT_PGUP, 0xa1, ALT_PGDN, + 0x9f, ALT_END, 0x98, ALT_UP, 0xa0, ALT_DOWN, + 0x9d, ALT_RIGHT, 0x9b, ALT_LEFT, 0x1c, ALT_ENTER, + 0x97, ALT_HOME, 0x01, ALT_ESC, 0x0e, ALT_BKSP, + 0x29, ALT_BQUOTE, 0x1a, ALT_LBRACKET, 0x1b, ALT_RBRACKET, + 0x27, ALT_SEMICOLON,0x28, ALT_FQUOTE, 0x33, ALT_COMMA, + 0x34, ALT_STOP, 0x35, ALT_FSLASH, 0x2b, ALT_BSLASH, + + /* Alt-Alphabet */ + 0x1e, ALT_A, 0x30, ALT_B, 0x2e, ALT_C, 0x20, ALT_D, + 0x12, ALT_E, 0x21, ALT_F, 0x22, ALT_G, 0x23, ALT_H, + 0x17, ALT_I, 0x24, ALT_J, 0x25, ALT_K, 0x26, ALT_L, + 0x32, ALT_M, 0x31, ALT_N, 0x18, ALT_O, 0x19, ALT_P, + 0x10, ALT_Q, 0x13, ALT_R, 0x1f, ALT_S, 0x14, ALT_T, + 0x16, ALT_U, 0x2f, ALT_V, 0x11, ALT_W, 0x2d, ALT_X, + 0x15, ALT_Y, 0x2c, ALT_Z, + 0x0f, KEY_BTAB, + 0x100, (-1) +}; + /* End of kptab[] */ + +static unsigned long pdc_key_modifiers=0L; +MOUSE_STATUS Trapped_Mouse_status; + +/*man-start********************************************************************* + + PDC_breakout() - check for type-ahead + + X/Open Description: + The curses package does the "line-breakout optimisation" by + looking for type-ahead periodically while updating the screen. + If input is found, the current update will be postponed until + refresh() or doupdate() are called again. This allows faster + response to commands typed in advance. Normally, the input FILE + pointer passed to newterm(), or stdin in the case when initscr() + was called, will be used to do this type-ahead checking. This routine + will do the actual check for PDcurses to see if input is pending. + + PDCurses Description: + This routine does what the PDcurses typeahead routine used to do. But + to make that routine consistent with its System V counterpart, all it + does now is set whether or not typeahead checking is performed. + + X/Open Return Value: + The PDC_breakout() routine returns TRUE if keyboard input is pending + otherwise FALSE is returned. + + Portability: + PDCurses bool PD_breakout( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +bool PDC_breakout( void ) +#else +bool PDC_breakout() +#endif +/***********************************************************************/ +{ +extern int c_pindex; /* putter index */ +extern int c_gindex; /* getter index */ +extern int c_ungind; /* wungetch() push index */ +#ifdef TC +# pragma argsused +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_breakout() - called\n"); +#endif + + if (c_ungind) + return (TRUE); /* ungotten char */ + if (c_pindex > c_gindex) + return (TRUE); /* buffered char */ + if (SP->raw_inp) + return((bool)PDC_check_bios_key());/* raw mode test */ + + return((bool)PDC_check_bios_key()); /* normal mode test */ +} + +/*man-start********************************************************************* + + PDC_get_input_fd() - Get file descriptor used for PDCurses input + + PDCurses Description: + This is a private PDCurses routine. + + This routine will return the file descriptor that PDCurses reads + its input from. It can be used for select(). + + PDCurses Return Value: + Returns a file descriptor. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_get_input_fd( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_input_fd(void) +#else +int PDC_get_input_fd() +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_input_fd() - called\n"); +#endif + + return fileno (stdin); +} + +/*man-start********************************************************************* + + PDC_check_bios_key() - Check BIOS key data area for input + + PDCurses Description: + This is a private PDCurses routine. + + This routine will check the BIOS for any indication that + keystrokes are pending. + + PDCurses Return Value: + Returns 1 if a keyboard character is available, 0 otherwise. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses bool PDC_check_bios_key( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +bool PDC_check_bios_key(void) +#else +bool PDC_check_bios_key() +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_check_bios_key() - called\n"); +#endif + + return(kbhit()); +} + +/*man-start********************************************************************* + + PDC_get_bios_key() - Returns the next key available from the BIOS. + + PDCurses Description: + This is a private PDCurses routine. + + Returns the next key code struck at the keyboard. If the low 8 + bits are 0, the upper bits contain the extended character + code. If bit 0-7 are non-zero, the upper bits = 0. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_get_bios_key( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_bios_key(void) +#else +int PDC_get_bios_key() +#endif +/***********************************************************************/ +{ + int ascii=0,scan=0; + static unsigned char keyboard_function=0xFF; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_bios_key() - called\n"); +#endif + + if (keyboard_function == 0xFF) + { + regs.h.ah = 0x02; /* get shift status for all keyboards */ + int86(0x16, ®s, ®s); + scan = regs.h.al; + regs.h.ah = 0x12; /* get shift status for enhanced keyboards */ + int86(0x16, ®s, ®s); + if (scan == regs.h.al + && getdosmembyte(0x496) == 0x10) + keyboard_function = 0x10; + else + keyboard_function = 0x0; + } + regs.h.ah = keyboard_function; + int86(0x16, ®s, ®s); + ascii = regs.h.al; + scan = regs.h.ah; + pdc_key_modifiers = 0; + if (SP->save_key_modifiers) + { + regs.h.ah = 0x02; /* get shift status for all keyboards */ + int86(0x16, ®s, ®s); + if (regs.h.al & 0x01 + || regs.h.al & 0x02) + pdc_key_modifiers |= PDC_KEY_MODIFIER_SHIFT; + if (regs.h.al & 0x04) + pdc_key_modifiers |= PDC_KEY_MODIFIER_CONTROL; + if (regs.h.al & 0x08) + pdc_key_modifiers |= PDC_KEY_MODIFIER_ALT; + if (regs.h.al & 0x20) + pdc_key_modifiers |= PDC_KEY_MODIFIER_NUMLOCK; + } + + if (scan == 0x1c && ascii == 0x0a) /* ^Enter */ + return ((int) (0xfc00)); + if ((scan == 0x03 && ascii == 0x00) /* ^@ - Null */ + || (scan == 0xe0 && ascii == 0x0d) /* PadEnter */ + || (scan == 0xe0 && ascii == 0x0a)) /* ^PadEnter */ + return ((int) (ascii << 8)); + if ((scan == 0x37 && ascii == 0x2a) /* Star */ + || (scan == 0x4a && ascii == 0x2d) /* Minus */ + || (scan == 0x4e && ascii == 0x2b) /* Plus */ + || (scan == 0xe0 && ascii == 0x2f)) /* Slash */ + return ((int) ((ascii & 0x0f) | 0xf0) << 8); + if (ascii == 0x00 || ascii == 0xe0) + return ((int) (scan << 8)); + return ((int) (ascii)); +} + +/*man-start********************************************************************* + + PDC_get_ctrl_break() - return OS control break state + + PDCurses Description: + This is a private PDCurses routine. + + Returns the current OS Control Break Check state. + + PDCurses Return Value: + DOS: + This function returns TRUE on if the Control Break + Check is enabled otherwise FALSE is returned. + + FLEXOS: + This function returns TRUE on if the Keyboard Mode + allows a break to bre reported otherwise FALSE is returned. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses bool PDC_get_ctrl_break( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +bool PDC_get_ctrl_break(void) +#else +bool PDC_get_ctrl_break() +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_ctrl_break() - called\n"); +#endif + + regs.h.ah = 0x33; + regs.h.al = 0x00; + int86(0x21, ®s, ®s); + return ((bool) regs.h.dl); +} + +/*man-start********************************************************************* + + PDC_rawgetch() - Returns the next uninterpreted character (if available). + + PDCurses Description: + Gets a character without any interpretation at all and returns + it. If keypad mode is active for the designated window, + function key translation will be performed. Otherwise, + function keys are ignored. If nodelay mode is active in the + window, then PDC_rawgetch() returns -1 if no character is + available. + + WARNING: It is unknown whether the FUNCTION key translation + is performed at this level. --Frotz 911130 BUG + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_rawgetch( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_rawgetch(void) +#else +int PDC_rawgetch() +#endif +/***********************************************************************/ +{ +extern WINDOW* _getch_win_; +/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ + /* is the same window - all references to w changed*/ + /* to _getch_win_ - marked with @@ */ + + int c=0; + int oldc=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_rawgetch() - called\n"); +#endif + + if (_getch_win_ == (WINDOW *)NULL) /* @@ */ + return( -1 ); + + if (_getch_win_->_nodelay && !PDC_breakout()) /* @@ */ + return( -1 ); + + while (1) /* loop to get valid char */ + { + c = PDC_get_bios_key(); + oldc = c; + /* + * Return the key if it is not a special key. + */ + if ((c = PDC_validchar(c)) >= 0) + { /* get & check next char */ + return( c ); + } + if (_getch_win_->_use_keypad) + return( oldc ); + } +} + +/*man-start********************************************************************* + + PDC_set_ctrl_break() - Enables/Disables the host OS BREAK key check. + + PDCurses Description: + This is a private PDCurses routine. + + Enables/Disables the host OS BREAK key check. If the supplied setting + is TRUE, this enables CTRL/C and CTRL/BREAK to abort the process. + If FALSE, CTRL/C and CTRL/BREAK are ignored. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_set_ctrl_break( bool setting ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_ctrl_break(bool setting) +#else +int PDC_set_ctrl_break(setting) +bool setting; +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_ctrl_break() - called\n"); +#endif + +#ifdef NDP + if( setting ) + _ignore_breaks(); + else + _watch_breaks(); +#else +# ifdef GO32 + (void*)signal(SIGINT,(setting ? SIG_DFL : SIG_IGN)); +/* __djgpp_set_ctrl_c(setting);*/ + setcbrk(setting); +# else + regs.h.ah = 0x33; + regs.h.al = 0x00; + regs.h.dl = (unsigned char) (setting ? 1 : 0); + int86(0x21, ®s, ®s); +# endif +#endif + return( OK ); +} + +/*man-start********************************************************************* + + PDC_sysgetch() - Return a character using default system routines. + + PDCurses Description: + This is a private PDCurses function. + + Gets a character without normal ^S, ^Q, ^P and ^C interpretation + and returns it. If keypad mode is active for the designated + window, function key translation will be performed. Otherwise, + function keys are ignored. If nodelay mode is active in the + window, then sysgetch() returns -1 if no character is + available. + + PDCurses Return Value: + This function returns OK upon success otherwise ERR is returned. + + PDCurses Errors: + No errors are defined for this routine. + + Portability: + PDCurses int PDC_sysgetch( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_sysgetch(void) +#else +int PDC_sysgetch() +#endif +/***********************************************************************/ +{ +extern WINDOW* _getch_win_; +/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ + /* is the same window - all references to w changed*/ + /* to _getch_win_ - marked with @@ */ + + int c=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_sysgetch() - called\n"); +#endif + + if (_getch_win_ == (WINDOW *)NULL) /* @@ */ + return (-1); + + if (_getch_win_->_nodelay && !PDC_breakout()) + return (-1); + + while (1) + { + c = PDC_get_bios_key(); + /* + * Return the key if it is not a special key. + */ + if ((unsigned int)c < 256) + return(c); + if ((c = PDC_validchar(c)) >= 0) + return (c); /* get & check next char */ + } +} + +/*man-start********************************************************************* + + PDC_validchar() - validate/translate passed character + + PDCurses Description: + This is a private PDCurses function. + + Checks that 'c' is a valid character, and if so returns it, + with function key translation applied if 'w' has keypad mode + set. If char is invalid, returns -1. + + PDCurses Return Value: + This function returns -1 if the passed character is invalid, or + the WINDOW* 'w' is NULL, or 'w's keypad is not active. + + This function returns 0 under Flexos if the passed character + is 0x0300. (-:Forget why. --Frotz 911130:-) + + Otherwise, this function returns the PDCurses equivalent of the + passed character. See the function key and key macros in + + + PDCurses Errors: + There are no errors defined for this routine. + + Portability: + PDCurses int PDC_validchar( int c ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_validchar(int c) +#else +int PDC_validchar(c) +int c; +#endif +/***********************************************************************/ +{ +extern WINDOW* _getch_win_; +/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ + /* is the same window - all references to w changed*/ + /* to _getch_win_ - marked with @@ */ + + int *scanp=NULL; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_validchar() - called\n"); +#endif + + if (_getch_win_ == (WINDOW *)NULL) + return (-1); /* bad window pointer */ + + if ((unsigned int)c < 256) return (c); /* normal character */ + if (!(_getch_win_->_use_keypad)) return (-1); /* skip if keys if !keypad mode */ + + /* + * Under DOS, extended keys are in the upper byte. Shift down for a + * comparison. + */ + c = (c >> 8) & 0xFF; + + scanp = kptab; + while (*scanp > 0) /* search for value */ + { /* (stops on table entry 0x100) */ + if (*scanp++ == c) + { + return (*scanp); /* found, return it */ + } + scanp++; + } + return( -1 ); /* not found, invalid */ +} + +/*man-start********************************************************************* + + PDC_get_key_modifiers() - Returns the keyboard modifier(s) at time of last getch() + + PDCurses Description: + This is a private PDCurses routine. + + Returns the keyboard modifiers effective at the time of the last getch() + call only if PDC_save_key_modifiers(TRUE) has been called before the + getch(); + Use the macros; PDC_KEY_MODIFIER_* to determine which modifier(s) + were set. + + PDCurses Return Value: + This function returns the modifiers. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_get_key_modifiers( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +unsigned long PDC_get_key_modifiers(void) +#else +unsigned long PDC_get_key_modifiers() +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_key_modifiers() - called\n"); +#endif + return(pdc_key_modifiers); +} diff --git a/dos/pdcprint.c b/dos/pdcprint.c index 7cea9acf..3da56756 100644 --- a/dos/pdcprint.c +++ b/dos/pdcprint.c @@ -1,82 +1,82 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCprint = "$Id: pdcprint.c,v 1.1 2001/01/10 08:28:44 mark Exp $"; -#endif - -/*man-start********************************************************************* - - PDC_print() - Provides primitive access to the BIOS printer functions - - PDCurses Description: - This is a private PDCurses routine. - - Implements write/init/read printer services at the BIOS level. - - This provides the basic support that PDCurses needs to dump the - contents of windows or pads to the printer attached to the BIOS - printer port. - - PDCurses Return Value: - See the BIOS INT 0x17 specifications. - - PDCurses Errors: - See the BIOS INT 0x17 specifications. - - Portability: - PDCurses int PDC_print( int cmd, int byte, int port ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_print(int cmd, int byte, int port) -#else -int PDC_print(cmd,byte,port) -int cmd; -int byte; -int port; -#endif -/***********************************************************************/ -{ - int status = 0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_print() - called\n"); -#endif - - regs.h.ah = (unsigned char)cmd; - regs.h.al = (unsigned char)byte; -# ifdef WATCOMC - regs.w.dx = (unsigned int)port; -# else - regs.x.dx = (unsigned int)port; -# endif - int86(0x17, ®s, ®s); - status = regs.h.ah; - return (status); - -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#ifdef PDCDEBUG +char *rcsid_PDCprint = "$Id: pdcprint.c,v 1.2 2001/01/10 08:28:45 mark Exp $"; +#endif + +/*man-start********************************************************************* + + PDC_print() - Provides primitive access to the BIOS printer functions + + PDCurses Description: + This is a private PDCurses routine. + + Implements write/init/read printer services at the BIOS level. + + This provides the basic support that PDCurses needs to dump the + contents of windows or pads to the printer attached to the BIOS + printer port. + + PDCurses Return Value: + See the BIOS INT 0x17 specifications. + + PDCurses Errors: + See the BIOS INT 0x17 specifications. + + Portability: + PDCurses int PDC_print( int cmd, int byte, int port ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_print(int cmd, int byte, int port) +#else +int PDC_print(cmd,byte,port) +int cmd; +int byte; +int port; +#endif +/***********************************************************************/ +{ + int status = 0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_print() - called\n"); +#endif + + regs.h.ah = (unsigned char)cmd; + regs.h.al = (unsigned char)byte; +# ifdef WATCOMC + regs.w.dx = (unsigned int)port; +# else + regs.x.dx = (unsigned int)port; +# endif + int86(0x17, ®s, ®s); + status = regs.h.ah; + return (status); + +} diff --git a/dos/pdcscrn.c b/dos/pdcscrn.c index f63727c6..fbe88eb6 100644 --- a/dos/pdcscrn.c +++ b/dos/pdcscrn.c @@ -1,333 +1,333 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef HAVE_MEMORY_H -# include -#endif - -#ifndef HAVE_MEMMOVE -# define memmove PDC_memmove -#endif - -#ifdef GO32 -# include -#endif - -#ifdef PDCDEBUG -char *rcsid_PDCscrn = "$Id: pdcscrn.c,v 1.1 2001/01/10 08:28:47 mark Exp $"; -#endif - - static unsigned short *saved_screen = NULL; - static int saved_lines = 0; - static int saved_cols = 0; - -/*man-start********************************************************************* - - PDC_scr_close() - Internal low-level binding to close the physical screen - - PDCurses Description: - This function provides a low-level binding for the Flexos - platform which must close the screen before writing to it. - This is a nop for the DOS platform. - - This function is provided in order to reset the FlexOS 16 bit - character set for input rather than the limited input - character set associated with the VT52. - - PDCurses Return Value: - This function returns OK on success, otherwise an ERR is returned. - - PDCurses Errors: - The DOS platform will never fail. The Flexos platform may fail - depending on the ability to close the current virtual console in - 8 (as opposed to 16) bit mode. - - Portability: - PDCurses int PDC_scr_close( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_scr_close(void) -#else -int PDC_scr_close() -#endif -/***********************************************************************/ -{ -#if SMALL || MEDIUM -struct SREGS segregs; -int ds=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scr_close() - called\n"); -#endif - if (getenv("PDC_RESTORE_SCREEN") != NULL) - { - if (saved_screen == NULL) - return( OK ); -#ifdef GO32 - dosmemput(saved_screen, - saved_lines * saved_cols * sizeof(unsigned short), - (unsigned long)_FAR_POINTER(SP->video_seg,SP->video_ofs)); -#else -# if (SMALL || MEDIUM) - segread(&segregs); - ds = segregs.ds; - movedata(ds, (int)saved_screen, - SP->video_seg,SP->video_ofs, - (saved_lines * saved_cols * sizeof(unsigned short))); -# else - memcpy((void *)_FAR_POINTER(SP->video_seg,SP->video_ofs), - (void*)saved_screen, - (saved_lines * saved_cols * sizeof(unsigned short))); -# endif -#endif - free(saved_screen); - saved_screen = NULL; - } - return( OK ); -} - -/*man-start********************************************************************* - - PDC_scrn_modes_equal() - Decide if two screen modes are equal - - PDCurses Description: - Mainly required for OS/2. It decides if two screen modes - (VIOMODEINFO structure) are equal. Under DOS it just compares - two integers - - PDCurses Return Value: - This function returns TRUE if equal else FALSe. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_scrn_modes_equal( int mode1, int mode2 ); - OS2 PDCurses int PDC_scrn_modes_equal( VIOMODEINFO mode1, VIOMODEINFO mode2 ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_scrn_modes_equal(int mode1, int mode2) -#else -bool PDC_scrn_modes_equal(mode1,mode2) -int mode1; -int mode2; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scrn_modes_equal() - called\n"); -#endif - - return (mode1 == mode2); -} - -/*man-start********************************************************************* - - PDC_scr_open() - Internal low-level binding to open the physical screen - - PDCurses Description: - This function provides a low-level binding for the Flexos - platform which must open the screen before writing to it. - - This function is provided in order to access the FlexOS 16 bit - character set for input rather than the limited input - character set associated with the VT52. - - PDCurses Return Value: - This function returns OK on success, otherwise an ERR is returned. - - PDCurses Errors: - The DOS platform will never fail. The Flexos platform may fail - depending on the ability to open the current virtual console in - 8 (as opposed to 16) bit mode. - - Portability: - PDCurses int PDC_scr_open( SCREEN* internal, bool echo ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_scr_open(SCREEN *internal, bool echo) -#else -int PDC_scr_open(internal,echo) -SCREEN *internal; -bool echo; -#endif -/***********************************************************************/ -{ -#if SMALL || MEDIUM -struct SREGS segregs; -int ds=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scr_open() - called\n"); -#endif - - internal->orig_attr = 0; - internal->orig_emulation = getdosmembyte (0x487); - - PDC_get_cursor_pos(&internal->cursrow, &internal->curscol); - internal->direct_video = TRUE; /* Assume that we can */ - internal->autocr = TRUE; /* lf -> crlf by default */ - internal->raw_out = FALSE; /* tty I/O modes */ - internal->raw_inp = FALSE; /* tty I/O modes */ - internal->cbreak = TRUE; - internal->save_key_modifiers = FALSE; - internal->return_key_modifiers = FALSE; - internal->echo = echo; -/* under System V Curses, typeahead checking is enabled by default */ - internal->refrbrk = TRUE; /* allow premature end of refresh*/ - internal->video_seg = 0xb000; /* Base screen segment addr */ - internal->video_ofs = 0x0; /* Base screen segment ofs */ - internal->video_page = 0; /* Current Video Page */ - internal->visible_cursor= TRUE; /* Assume that it is visible */ - internal->cursor = PDC_get_cursor_mode(); - - internal->adapter = PDC_query_adapter_type(); - internal->scrnmode = PDC_get_scrn_mode(); - - internal->orig_font = internal->font = PDC_get_font(); - internal->lines = PDC_get_rows(); - internal->cols = PDC_get_columns(); - - internal->audible = TRUE; - internal->visibility = 1; - internal->orig_cursor = internal->cursor; - internal->orgcbr = PDC_get_ctrl_break(); - internal->blank = ' '; - internal->resized = FALSE; - internal->shell = FALSE; - internal->_trap_mbe = 0L; - internal->_map_mbe_to_key = 0L; - internal->linesrippedoff = 0; - internal->linesrippedoffontop = 0; - internal->delaytenths = 0; -/* - * If the environment variable PDCURSES_BIOS is set, the DOS int10() - * BIOS calls are used in place of direct video memory access. - */ - internal->direct_video = TRUE; - if (getenv("PDCURSES_BIOS") != NULL) - internal->direct_video = FALSE; -/* - * This code for preserving the current screen... - */ - if (getenv("PDC_RESTORE_SCREEN") != NULL) - { - saved_lines = internal->lines; - saved_cols = internal->cols; - if ((saved_screen = (unsigned short*)malloc(saved_lines*saved_cols*sizeof(unsigned short))) == NULL) - return(ERR); - -#ifdef GO32 - dosmemget ((unsigned long)_FAR_POINTER(SP->video_seg,SP->video_ofs), - saved_lines * saved_cols * sizeof(unsigned short),saved_screen); -#else -# if (SMALL || MEDIUM) - segread(&segregs); - ds = segregs.ds; - movedata(SP->video_seg,SP->video_ofs, - ds, (int)saved_screen, - (saved_lines * saved_cols * sizeof(unsigned short))); -# else - memcpy((void*)saved_screen, - (void *)_FAR_POINTER(SP->video_seg,SP->video_ofs), - (saved_lines * saved_cols * sizeof(unsigned short))); -# endif -#endif - } - - if (getenv("PDC_PRESERVE_SCREEN") != NULL) - internal->_preserve = TRUE; - else - internal->_preserve = FALSE; - - return( OK ); -} - -/*man-start********************************************************************* - - PDC_resize_screen() - Internal low-level function to resize screen - - PDCurses Description: - This function provides a means for the application program to - resize the overall dimensions of the screen. Under DOS and OS/2 - the application can tell PDCurses what size to make the screen; - under X11, resizing is done by the user and this function simply - adjusts its internal structures to fit the new size. - - PDCurses Return Value: - This function returns OK on success, otherwise an ERR is returned. - - PDCurses Errors: - - Portability: - PDCurses int PDC_resize_screen( int, int ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_resize_screen(int nlines, int ncols) -#else -int PDC_resize_screen(nlines, ncols) -int nlines,ncols; -#endif -/***********************************************************************/ -{ - int rc=OK; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_resize_screen() - called. Lines: %d Cols: %d\n",nlines,ncols); -#endif - - switch (SP->adapter) - { - case _EGACOLOR: - if (nlines >= 43) PDC_set_font(_FONT8); - else PDC_set_80x25(); - break; - - case _VGACOLOR: - if (nlines > 28) PDC_set_font(_FONT8); - else if (nlines > 25) PDC_set_font(_FONT14); - else PDC_set_80x25(); - break; - - default: - break; - } - - return ( rc ); -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#ifdef HAVE_MEMORY_H +# include +#endif + +#ifndef HAVE_MEMMOVE +# define memmove PDC_memmove +#endif + +#ifdef GO32 +# include +#endif + +#ifdef PDCDEBUG +char *rcsid_PDCscrn = "$Id: pdcscrn.c,v 1.2 2001/01/10 08:28:48 mark Exp $"; +#endif + + static unsigned short *saved_screen = NULL; + static int saved_lines = 0; + static int saved_cols = 0; + +/*man-start********************************************************************* + + PDC_scr_close() - Internal low-level binding to close the physical screen + + PDCurses Description: + This function provides a low-level binding for the Flexos + platform which must close the screen before writing to it. + This is a nop for the DOS platform. + + This function is provided in order to reset the FlexOS 16 bit + character set for input rather than the limited input + character set associated with the VT52. + + PDCurses Return Value: + This function returns OK on success, otherwise an ERR is returned. + + PDCurses Errors: + The DOS platform will never fail. The Flexos platform may fail + depending on the ability to close the current virtual console in + 8 (as opposed to 16) bit mode. + + Portability: + PDCurses int PDC_scr_close( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_scr_close(void) +#else +int PDC_scr_close() +#endif +/***********************************************************************/ +{ +#if SMALL || MEDIUM +struct SREGS segregs; +int ds=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_scr_close() - called\n"); +#endif + if (getenv("PDC_RESTORE_SCREEN") != NULL) + { + if (saved_screen == NULL) + return( OK ); +#ifdef GO32 + dosmemput(saved_screen, + saved_lines * saved_cols * sizeof(unsigned short), + (unsigned long)_FAR_POINTER(SP->video_seg,SP->video_ofs)); +#else +# if (SMALL || MEDIUM) + segread(&segregs); + ds = segregs.ds; + movedata(ds, (int)saved_screen, + SP->video_seg,SP->video_ofs, + (saved_lines * saved_cols * sizeof(unsigned short))); +# else + memcpy((void *)_FAR_POINTER(SP->video_seg,SP->video_ofs), + (void*)saved_screen, + (saved_lines * saved_cols * sizeof(unsigned short))); +# endif +#endif + free(saved_screen); + saved_screen = NULL; + } + return( OK ); +} + +/*man-start********************************************************************* + + PDC_scrn_modes_equal() - Decide if two screen modes are equal + + PDCurses Description: + Mainly required for OS/2. It decides if two screen modes + (VIOMODEINFO structure) are equal. Under DOS it just compares + two integers + + PDCurses Return Value: + This function returns TRUE if equal else FALSe. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_scrn_modes_equal( int mode1, int mode2 ); + OS2 PDCurses int PDC_scrn_modes_equal( VIOMODEINFO mode1, VIOMODEINFO mode2 ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +bool PDC_scrn_modes_equal(int mode1, int mode2) +#else +bool PDC_scrn_modes_equal(mode1,mode2) +int mode1; +int mode2; +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_scrn_modes_equal() - called\n"); +#endif + + return (mode1 == mode2); +} + +/*man-start********************************************************************* + + PDC_scr_open() - Internal low-level binding to open the physical screen + + PDCurses Description: + This function provides a low-level binding for the Flexos + platform which must open the screen before writing to it. + + This function is provided in order to access the FlexOS 16 bit + character set for input rather than the limited input + character set associated with the VT52. + + PDCurses Return Value: + This function returns OK on success, otherwise an ERR is returned. + + PDCurses Errors: + The DOS platform will never fail. The Flexos platform may fail + depending on the ability to open the current virtual console in + 8 (as opposed to 16) bit mode. + + Portability: + PDCurses int PDC_scr_open( SCREEN* internal, bool echo ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_scr_open(SCREEN *internal, bool echo) +#else +int PDC_scr_open(internal,echo) +SCREEN *internal; +bool echo; +#endif +/***********************************************************************/ +{ +#if SMALL || MEDIUM +struct SREGS segregs; +int ds=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_scr_open() - called\n"); +#endif + + internal->orig_attr = 0; + internal->orig_emulation = getdosmembyte (0x487); + + PDC_get_cursor_pos(&internal->cursrow, &internal->curscol); + internal->direct_video = TRUE; /* Assume that we can */ + internal->autocr = TRUE; /* lf -> crlf by default */ + internal->raw_out = FALSE; /* tty I/O modes */ + internal->raw_inp = FALSE; /* tty I/O modes */ + internal->cbreak = TRUE; + internal->save_key_modifiers = FALSE; + internal->return_key_modifiers = FALSE; + internal->echo = echo; +/* under System V Curses, typeahead checking is enabled by default */ + internal->refrbrk = TRUE; /* allow premature end of refresh*/ + internal->video_seg = 0xb000; /* Base screen segment addr */ + internal->video_ofs = 0x0; /* Base screen segment ofs */ + internal->video_page = 0; /* Current Video Page */ + internal->visible_cursor= TRUE; /* Assume that it is visible */ + internal->cursor = PDC_get_cursor_mode(); + + internal->adapter = PDC_query_adapter_type(); + internal->scrnmode = PDC_get_scrn_mode(); + + internal->orig_font = internal->font = PDC_get_font(); + internal->lines = PDC_get_rows(); + internal->cols = PDC_get_columns(); + + internal->audible = TRUE; + internal->visibility = 1; + internal->orig_cursor = internal->cursor; + internal->orgcbr = PDC_get_ctrl_break(); + internal->blank = ' '; + internal->resized = FALSE; + internal->shell = FALSE; + internal->_trap_mbe = 0L; + internal->_map_mbe_to_key = 0L; + internal->linesrippedoff = 0; + internal->linesrippedoffontop = 0; + internal->delaytenths = 0; +/* + * If the environment variable PDCURSES_BIOS is set, the DOS int10() + * BIOS calls are used in place of direct video memory access. + */ + internal->direct_video = TRUE; + if (getenv("PDCURSES_BIOS") != NULL) + internal->direct_video = FALSE; +/* + * This code for preserving the current screen... + */ + if (getenv("PDC_RESTORE_SCREEN") != NULL) + { + saved_lines = internal->lines; + saved_cols = internal->cols; + if ((saved_screen = (unsigned short*)malloc(saved_lines*saved_cols*sizeof(unsigned short))) == NULL) + return(ERR); + +#ifdef GO32 + dosmemget ((unsigned long)_FAR_POINTER(SP->video_seg,SP->video_ofs), + saved_lines * saved_cols * sizeof(unsigned short),saved_screen); +#else +# if (SMALL || MEDIUM) + segread(&segregs); + ds = segregs.ds; + movedata(SP->video_seg,SP->video_ofs, + ds, (int)saved_screen, + (saved_lines * saved_cols * sizeof(unsigned short))); +# else + memcpy((void*)saved_screen, + (void *)_FAR_POINTER(SP->video_seg,SP->video_ofs), + (saved_lines * saved_cols * sizeof(unsigned short))); +# endif +#endif + } + + if (getenv("PDC_PRESERVE_SCREEN") != NULL) + internal->_preserve = TRUE; + else + internal->_preserve = FALSE; + + return( OK ); +} + +/*man-start********************************************************************* + + PDC_resize_screen() - Internal low-level function to resize screen + + PDCurses Description: + This function provides a means for the application program to + resize the overall dimensions of the screen. Under DOS and OS/2 + the application can tell PDCurses what size to make the screen; + under X11, resizing is done by the user and this function simply + adjusts its internal structures to fit the new size. + + PDCurses Return Value: + This function returns OK on success, otherwise an ERR is returned. + + PDCurses Errors: + + Portability: + PDCurses int PDC_resize_screen( int, int ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_resize_screen(int nlines, int ncols) +#else +int PDC_resize_screen(nlines, ncols) +int nlines,ncols; +#endif +/***********************************************************************/ +{ + int rc=OK; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_resize_screen() - called. Lines: %d Cols: %d\n",nlines,ncols); +#endif + + switch (SP->adapter) + { + case _EGACOLOR: + if (nlines >= 43) PDC_set_font(_FONT8); + else PDC_set_80x25(); + break; + + case _VGACOLOR: + if (nlines > 28) PDC_set_font(_FONT8); + else if (nlines > 25) PDC_set_font(_FONT14); + else PDC_set_80x25(); + break; + + default: + break; + } + + return ( rc ); +} diff --git a/dos/pdcsetsc.c b/dos/pdcsetsc.c index 17ddd942..c4b98823 100644 --- a/dos/pdcsetsc.c +++ b/dos/pdcsetsc.c @@ -1,455 +1,455 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCsetsc = "$Id: pdcsetsc.c,v 1.1 2001/01/10 08:28:49 mark Exp $"; -#endif - -/*man-start********************************************************************* - - PDC_set_80x25() - force a known screen state: 80x25 text mode. - - PDCurses Description: - This is a private PDCurses function. - - Forces the appropriate 80x25 alpha mode given the display adapter. - - Since we currently do not support changing the virtual console size, - this routine is a NOP under Flexos. - - PDCurses Return Value: - This function returns OK upon success otherwise ERR is returned. - - PDCurses Errors: - No errors are defined for this routine. - - Portability: - PDCurses int PDC_set_80x25( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_80x25(void) -#else -int PDC_set_80x25() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_80x25() - called\n"); -#endif - - switch (SP->adapter) - { - case _CGA: - case _EGACOLOR: - case _EGAMONO: - case _VGACOLOR: - case _VGAMONO: - case _MCGACOLOR: - case _MCGAMONO: - regs.h.ah = 0x00; - regs.h.al = 0x03; - int86(0x10, ®s, ®s); - break; - case _MDA: - regs.h.ah = 0x00; - regs.h.al = 0x07; - int86(0x10, ®s, ®s); - default: - break; - } - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_set_cursor_mode() - Set the cursor start and stop scan lines. - - PDCurses Description: - Sets the cursor type to begin in scan line startrow and end in - scan line endrow. Both values should be 0-31. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_set_cursor_mode( int startrow, int endrow ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_cursor_mode( int startrow, int endrow ) -#else -int PDC_set_cursor_mode(startrow,endrow) -int startrow; -int endrow; -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_cursor_mode() - called: startrow %d endrow %d\n",startrow,endrow); -#endif - - regs.h.ah = 0x01; - regs.h.ch = (unsigned char) startrow; - regs.h.cl = (unsigned char) endrow; - int86(0x10, ®s, ®s); - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_set_font() - sets the current font size - - PDCurses Description: - This is a private PDCurses function. - - This routine sets the current font size, if the adapter allows - such a change. - - PDCurses Return Value: - This function returns OK upon success otherwise ERR is returned. - - PDCurses Errors: - It is an error to attempt to change the font size on a "bogus" - adapter. The reason for this is that we have a known video - adapter identity problem. e.g. Two adapters report the same - identifying characteristics. - - It is also an error to attempt to change the size of the Flexos - console (as there is currently no support for that). - - Portability: - PDCurses int PDC_set_font( int size ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_font(int size) -#else -int PDC_set_font(size) -int size; -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_font() - called\n"); -#endif - - if (SP->bogus_adapter) - return( ERR ); - - switch (SP->adapter) - { - case _CGA: - case _MDA: - case _MCGACOLOR: - case _MCGAMONO: - case _MDS_GENIUS: - break; - - case _EGACOLOR: - case _EGAMONO: - if (SP->sizeable && (SP->font != size)) - { - switch (size) - { - case _FONT8: - regs.h.ah = 0x11; - regs.h.al = 0x12; - regs.h.bl = 0x00; - int86(0x10, ®s, ®s); - break; - case _FONT14: - regs.h.ah = 0x11; - regs.h.al = 0x11; - regs.h.bl = 0x00; - int86(0x10, ®s, ®s); - break; - default: - break; - } - } - break; - - case _VGACOLOR: - case _VGAMONO: - if (SP->sizeable && (SP->font != size)) - { - switch (size) - { - case _FONT8: - regs.h.ah = 0x11; - regs.h.al = 0x12; - regs.h.bl = 0x00; - int86(0x10, ®s, ®s); - break; - case _FONT14: - regs.h.ah = 0x11; - regs.h.al = 0x11; - regs.h.bl = 0x00; - int86(0x10, ®s, ®s); - break; - case _FONT16: - regs.h.ah = 0x11; - regs.h.al = 0x14; - regs.h.bl = 0x00; - int86(0x10, ®s, ®s); - break; - default: - break; - } - } - break; - default: - break; - } - if (SP->visible_cursor) - PDC_cursor_on(); - else - PDC_cursor_off(); - SP->font = PDC_get_font(); - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_set_rows() - sets the physical number of rows on screen - - PDCurses Description: - This is a private PDCurses function. - - This routine attempts to set the number of rows on the physical - screen to the passed value. - - PDCurses Return Value: - This function returns OK upon success otherwise ERR is returned. - - PDCurses Errors: - It is an error to attempt to change the screen size on a "bogus" - adapter. The reason for this is that we have a known video - adapter identity problem. e.g. Two adapters report the same - identifying characteristics. - - It is also an error to attempt to change the size of the Flexos - console (as there is currently no support for that). - - Portability: - PDCurses int PDC_set_rows( int rows ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_rows(int rows) -#else -int PDC_set_rows(rows) -int rows; -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_rows() - called\n"); -#endif - - if (SP->bogus_adapter) - return( ERR ); - - switch (SP->adapter) - { - case _EGACOLOR: - case _EGAMONO: - if (rows < 43) - PDC_set_font(_FONT14); - else - PDC_set_font(_FONT8); - break; - - case _VGACOLOR: - case _VGAMONO: - if (rows < 28) - PDC_set_font(_FONT16); - else - if (rows < 50) - PDC_set_font(_FONT14); - else - PDC_set_font(_FONT8); - break; - - case _MCGACOLOR: - case _MCGAMONO: - case _MDA: - case _CGA: - case _MDS_GENIUS: - default: - break; - } - SP->font = PDC_get_font(); - LINES = PDC_get_rows(); - COLS = PDC_get_columns(); - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_set_scrn_mode() - Set BIOS Video Mode - - PDCurses Description: - Sets the BIOS Video Mode Number ONLY if it is different from - the current video mode. This routine is for DOS systems only. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_set_scrn_mode( int new_mode ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_scrn_mode(int new_mode) -#else -int PDC_set_scrn_mode(new_mode) -int new_mode; -#endif -/***********************************************************************/ -{ - - int cur=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_scrn_mode() - called\n"); -#endif - - cur = (int) PDC_get_scrn_mode(); - if (cur != new_mode) - { - regs.h.ah = 0x00; - regs.h.al = (char) new_mode; - int86(0x10, ®s, ®s); - } - SP->font = PDC_get_font(); - SP->scrnmode = new_mode; - LINES = PDC_get_rows(); - COLS = PDC_get_columns(); - return( OK ); - -} -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_curs_set(int visibility) -#else -int PDC_curs_set(visibility) -int visibility; -#endif -/***********************************************************************/ -{ - int start=0,end=0; - int ret_vis=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_curs_set() - called: visibility=%d\n",visibility); -#endif - - ret_vis = SP->visibility; - SP->visibility = visibility; - - switch(visibility) - { - case 0: /* invisible */ - start = 32; - end = 32; /* was 33 */ - break; - case 2: /* highly visible */ - start = 2; /* almost full-height block */ - end = SP->font-1; - break; - default: /* normal visibility */ - start = SP->font - 2; -/* start = SP->font - (SP->font / 4); */ - end = SP->font-1; - break; - } - - regs.h.ah = 0x01; - regs.h.al = (unsigned char)SP->scrnmode; /* if not set, some BIOSes hang */ - regs.h.ch = (unsigned char)start; - regs.h.cl = (unsigned char)end; - int86(0x10, ®s, ®s); - return( ret_vis ); -} - -/*man-start********************************************************************* - - PDC_set_title() - Set window title - - PDCurses Description: - Sets the title of the window in which the curses program is running. - This function may not do anything on some platforms. - - PDCurses Return Value: - N/A - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses void PDC_set_title( char *title ); - -**man-end**********************************************************************/ -/***********************************************************************/ -#ifdef HAVE_PROTO -void PDC_set_title(char *title) -#else -void PDC_set_title(title) -char *title; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_title() - called:<%s>\n",title); -#endif - - return; -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#ifdef PDCDEBUG +char *rcsid_PDCsetsc = "$Id: pdcsetsc.c,v 1.2 2001/01/10 08:28:50 mark Exp $"; +#endif + +/*man-start********************************************************************* + + PDC_set_80x25() - force a known screen state: 80x25 text mode. + + PDCurses Description: + This is a private PDCurses function. + + Forces the appropriate 80x25 alpha mode given the display adapter. + + Since we currently do not support changing the virtual console size, + this routine is a NOP under Flexos. + + PDCurses Return Value: + This function returns OK upon success otherwise ERR is returned. + + PDCurses Errors: + No errors are defined for this routine. + + Portability: + PDCurses int PDC_set_80x25( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_80x25(void) +#else +int PDC_set_80x25() +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_80x25() - called\n"); +#endif + + switch (SP->adapter) + { + case _CGA: + case _EGACOLOR: + case _EGAMONO: + case _VGACOLOR: + case _VGAMONO: + case _MCGACOLOR: + case _MCGAMONO: + regs.h.ah = 0x00; + regs.h.al = 0x03; + int86(0x10, ®s, ®s); + break; + case _MDA: + regs.h.ah = 0x00; + regs.h.al = 0x07; + int86(0x10, ®s, ®s); + default: + break; + } + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_set_cursor_mode() - Set the cursor start and stop scan lines. + + PDCurses Description: + Sets the cursor type to begin in scan line startrow and end in + scan line endrow. Both values should be 0-31. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_set_cursor_mode( int startrow, int endrow ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_cursor_mode( int startrow, int endrow ) +#else +int PDC_set_cursor_mode(startrow,endrow) +int startrow; +int endrow; +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_cursor_mode() - called: startrow %d endrow %d\n",startrow,endrow); +#endif + + regs.h.ah = 0x01; + regs.h.ch = (unsigned char) startrow; + regs.h.cl = (unsigned char) endrow; + int86(0x10, ®s, ®s); + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_set_font() - sets the current font size + + PDCurses Description: + This is a private PDCurses function. + + This routine sets the current font size, if the adapter allows + such a change. + + PDCurses Return Value: + This function returns OK upon success otherwise ERR is returned. + + PDCurses Errors: + It is an error to attempt to change the font size on a "bogus" + adapter. The reason for this is that we have a known video + adapter identity problem. e.g. Two adapters report the same + identifying characteristics. + + It is also an error to attempt to change the size of the Flexos + console (as there is currently no support for that). + + Portability: + PDCurses int PDC_set_font( int size ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_font(int size) +#else +int PDC_set_font(size) +int size; +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_font() - called\n"); +#endif + + if (SP->bogus_adapter) + return( ERR ); + + switch (SP->adapter) + { + case _CGA: + case _MDA: + case _MCGACOLOR: + case _MCGAMONO: + case _MDS_GENIUS: + break; + + case _EGACOLOR: + case _EGAMONO: + if (SP->sizeable && (SP->font != size)) + { + switch (size) + { + case _FONT8: + regs.h.ah = 0x11; + regs.h.al = 0x12; + regs.h.bl = 0x00; + int86(0x10, ®s, ®s); + break; + case _FONT14: + regs.h.ah = 0x11; + regs.h.al = 0x11; + regs.h.bl = 0x00; + int86(0x10, ®s, ®s); + break; + default: + break; + } + } + break; + + case _VGACOLOR: + case _VGAMONO: + if (SP->sizeable && (SP->font != size)) + { + switch (size) + { + case _FONT8: + regs.h.ah = 0x11; + regs.h.al = 0x12; + regs.h.bl = 0x00; + int86(0x10, ®s, ®s); + break; + case _FONT14: + regs.h.ah = 0x11; + regs.h.al = 0x11; + regs.h.bl = 0x00; + int86(0x10, ®s, ®s); + break; + case _FONT16: + regs.h.ah = 0x11; + regs.h.al = 0x14; + regs.h.bl = 0x00; + int86(0x10, ®s, ®s); + break; + default: + break; + } + } + break; + default: + break; + } + if (SP->visible_cursor) + PDC_cursor_on(); + else + PDC_cursor_off(); + SP->font = PDC_get_font(); + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_set_rows() - sets the physical number of rows on screen + + PDCurses Description: + This is a private PDCurses function. + + This routine attempts to set the number of rows on the physical + screen to the passed value. + + PDCurses Return Value: + This function returns OK upon success otherwise ERR is returned. + + PDCurses Errors: + It is an error to attempt to change the screen size on a "bogus" + adapter. The reason for this is that we have a known video + adapter identity problem. e.g. Two adapters report the same + identifying characteristics. + + It is also an error to attempt to change the size of the Flexos + console (as there is currently no support for that). + + Portability: + PDCurses int PDC_set_rows( int rows ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_rows(int rows) +#else +int PDC_set_rows(rows) +int rows; +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_rows() - called\n"); +#endif + + if (SP->bogus_adapter) + return( ERR ); + + switch (SP->adapter) + { + case _EGACOLOR: + case _EGAMONO: + if (rows < 43) + PDC_set_font(_FONT14); + else + PDC_set_font(_FONT8); + break; + + case _VGACOLOR: + case _VGAMONO: + if (rows < 28) + PDC_set_font(_FONT16); + else + if (rows < 50) + PDC_set_font(_FONT14); + else + PDC_set_font(_FONT8); + break; + + case _MCGACOLOR: + case _MCGAMONO: + case _MDA: + case _CGA: + case _MDS_GENIUS: + default: + break; + } + SP->font = PDC_get_font(); + LINES = PDC_get_rows(); + COLS = PDC_get_columns(); + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_set_scrn_mode() - Set BIOS Video Mode + + PDCurses Description: + Sets the BIOS Video Mode Number ONLY if it is different from + the current video mode. This routine is for DOS systems only. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_set_scrn_mode( int new_mode ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_scrn_mode(int new_mode) +#else +int PDC_set_scrn_mode(new_mode) +int new_mode; +#endif +/***********************************************************************/ +{ + + int cur=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_scrn_mode() - called\n"); +#endif + + cur = (int) PDC_get_scrn_mode(); + if (cur != new_mode) + { + regs.h.ah = 0x00; + regs.h.al = (char) new_mode; + int86(0x10, ®s, ®s); + } + SP->font = PDC_get_font(); + SP->scrnmode = new_mode; + LINES = PDC_get_rows(); + COLS = PDC_get_columns(); + return( OK ); + +} +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_curs_set(int visibility) +#else +int PDC_curs_set(visibility) +int visibility; +#endif +/***********************************************************************/ +{ + int start=0,end=0; + int ret_vis=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_curs_set() - called: visibility=%d\n",visibility); +#endif + + ret_vis = SP->visibility; + SP->visibility = visibility; + + switch(visibility) + { + case 0: /* invisible */ + start = 32; + end = 32; /* was 33 */ + break; + case 2: /* highly visible */ + start = 2; /* almost full-height block */ + end = SP->font-1; + break; + default: /* normal visibility */ + start = SP->font - 2; +/* start = SP->font - (SP->font / 4); */ + end = SP->font-1; + break; + } + + regs.h.ah = 0x01; + regs.h.al = (unsigned char)SP->scrnmode; /* if not set, some BIOSes hang */ + regs.h.ch = (unsigned char)start; + regs.h.cl = (unsigned char)end; + int86(0x10, ®s, ®s); + return( ret_vis ); +} + +/*man-start********************************************************************* + + PDC_set_title() - Set window title + + PDCurses Description: + Sets the title of the window in which the curses program is running. + This function may not do anything on some platforms. + + PDCurses Return Value: + N/A + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses void PDC_set_title( char *title ); + +**man-end**********************************************************************/ +/***********************************************************************/ +#ifdef HAVE_PROTO +void PDC_set_title(char *title) +#else +void PDC_set_title(title) +char *title; +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_title() - called:<%s>\n",title); +#endif + + return; +} diff --git a/dos/wccdos.lrf b/dos/wccdos.lrf index 83ad039a..94fdf56d 100644 --- a/dos/wccdos.lrf +++ b/dos/wccdos.lrf @@ -1,47 +1,47 @@ -+addch.obj -+addchstr.obj -+addstr.obj -+attr.obj -+beep.obj -+bkgd.obj -+border.obj -+clear.obj -+color.obj -+delch.obj -+deleteln.obj -+getch.obj -+getstr.obj -+getyx.obj -+inch.obj -+inchstr.obj -+initscr.obj -+inopts.obj -+insch.obj -+insstr.obj -+instr.obj -+kernel.obj -+mouse.obj -+move.obj -+outopts.obj -+overlay.obj -+pad.obj -+printw.obj -+refresh.obj -+scanw.obj -+scroll.obj -+slk.obj -+termattr.obj -+terminfo.obj -+touch.obj -+util.obj -+window.obj -+pdcclip.obj -+pdcdebug.obj -+pdcdisp.obj -+pdcgetsc.obj -+pdckbd.obj -+pdcprint.obj -+pdcscrn.obj -+pdcsetsc.obj -+pdcutil.obj -+pdcwin.obj ++addch.obj ++addchstr.obj ++addstr.obj ++attr.obj ++beep.obj ++bkgd.obj ++border.obj ++clear.obj ++color.obj ++delch.obj ++deleteln.obj ++getch.obj ++getstr.obj ++getyx.obj ++inch.obj ++inchstr.obj ++initscr.obj ++inopts.obj ++insch.obj ++insstr.obj ++instr.obj ++kernel.obj ++mouse.obj ++move.obj ++outopts.obj ++overlay.obj ++pad.obj ++printw.obj ++refresh.obj ++scanw.obj ++scroll.obj ++slk.obj ++termattr.obj ++terminfo.obj ++touch.obj ++util.obj ++window.obj ++pdcclip.obj ++pdcdebug.obj ++pdcdisp.obj ++pdcgetsc.obj ++pdckbd.obj ++pdcprint.obj ++pdcscrn.obj ++pdcsetsc.obj ++pdcutil.obj ++pdcwin.obj diff --git a/dos/wccdos16.mak b/dos/wccdos16.mak index 125a1938..e371ceba 100644 --- a/dos/wccdos16.mak +++ b/dos/wccdos16.mak @@ -1,389 +1,389 @@ -################################################################################ -# -# Watcom WMAKE Makefile for PDCurses library - DOS (16 bit) Watcom C/C++ 10.6 -# -# Usage: wmake -f [path\]wccdos16.mak [DEBUG=Y] [target] -# -# where target can be any of: -# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] -# -################################################################################ -# -# Change these for your environment... -# -################################################################################ -PDCURSES_HOME =c:\curses -CCINCDIR =k:\h -MODEL =l -################################################################################ -# Nothing below here should required changing. -################################################################################ -VER=24 -VERDOT=2.4 - -PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h -PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h -PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) -PANEL_HEADER =$(PDCURSES_HOME)\panel.h - - -srcdir = $(PDCURSES_HOME)\pdcurses -osdir = $(PDCURSES_HOME)\dos -pandir = $(PDCURSES_HOME)\panel -demodir = $(PDCURSES_HOME)\demos - -CC = wcc -TARGET=dos - -!ifeq DEBUG Y -CFLAGS = /d2 /DPDCDEBUG -LDFLAGS = DEBUG WATCOM ALL -!else -CFLAGS = /oneatx -LDFLAGS = -!endif - -CPPFLAGS = /i=$(PDCURSES_HOME) /i=$(CCINCDIR) - -CCFLAGS = /bt=$(TARGET) /zq /m$(MODEL) $(CFLAGS) $(CPPFLAGS) - -LINK = wlink - -LIBEXE = wlib /q /n - -LIBCURSES = pdcurses.lib -LIBPANEL = panel.lib - -PDCLIBS = $(LIBCURSES) $(LIBPANEL) -DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe - -################################################################################ -all: $(PDCLIBS) $(DEMOS) - -clean: - -del *.obj - -del curses.lib - -del panel.lib - -del *.exe - -demos: $(DEMOS) - -#------------------------------------------------------------------------ - -LIBOBJS = & -addch.obj & -addchstr.obj & -addstr.obj & -attr.obj & -beep.obj & -bkgd.obj & -border.obj & -clear.obj & -color.obj & -delch.obj & -deleteln.obj & -getch.obj & -getstr.obj & -getyx.obj & -inch.obj & -inchstr.obj & -initscr.obj & -inopts.obj & -insch.obj & -insstr.obj & -instr.obj & -kernel.obj & -mouse.obj & -move.obj & -outopts.obj & -overlay.obj & -pad.obj & -printw.obj & -refresh.obj & -scanw.obj & -scroll.obj & -slk.obj & -termattr.obj & -terminfo.obj & -touch.obj & -util.obj & -window.obj - -PDCOBJS = & -pdcclip.obj & -pdcdebug.obj & -pdcdisp.obj & -pdcgetsc.obj & -pdckbd.obj & -pdcprint.obj & -pdcscrn.obj & -pdcsetsc.obj & -pdcutil.obj & -pdcwin.obj - -PANOBJS = & -panel.obj - -pdcurses.lib : $(LIBOBJS) $(PDCOBJS) - $(LIBEXE) $@ @$(osdir)\wccdos.lrf - -panel.lib : $(PANOBJS) - @%create lib.rsp - @%append lib.rsp +$(PANOBJS) - $(LIBEXE) $@ @lib.rsp - del lib.rsp - -addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addch.c - -addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addchstr.c - -addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addstr.c - -attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\attr.c - -beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\beep.c - -bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\bkgd.c - -border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\border.c - -clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\clear.c - -color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\color.c - -delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\delch.c - -deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\deleteln.c - -getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getch.c - -getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getstr.c - -getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getyx.c - -inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inch.c - -inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inchstr.c - -initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\initscr.c - -inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inopts.c - -insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insch.c - -insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insstr.c - -instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\instr.c - -kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\kernel.c - -mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\mouse.c - -move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\move.c - -outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\outopts.c - -overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\overlay.c - -pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pad.c - -printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\printw.c - -refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\refresh.c - -scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scanw.c - -scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scroll.c - -slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\slk.c - -termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\termattr.c - -terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\terminfo.c - -touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\touch.c - -util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\util.c - -window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\window.c - - -pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcclip.c - -pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcdebug.c - -pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcdisp.c - -pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcgetsc.c - -pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdckbd.c - -pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcprint.c - -pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcscrn.c - -pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcsetsc.c - -pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcutil.c - -pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcwin.c - -#------------------------------------------------------------------------ - -panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) - $(CC) $(CCFLAGS) /fo=$@ $(pandir)\panel.c - -#------------------------------------------------------------------------ - -firework.exe: firework.obj $(LIBCURSES) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name firework.exe - @%append demos.lnk file firework.obj - @%append demos.lnk library $(LIBCURSES) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -newdemo.exe: newdemo.obj $(LIBCURSES) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name newdemo.exe - @%append demos.lnk file newdemo.obj - @%append demos.lnk library $(LIBCURSES) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name ptest.exe - @%append demos.lnk file ptest.obj - @%append demos.lnk library $(LIBCURSES) - @%append demos.lnk library $(LIBPANEL) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -testcurs.exe: testcurs.obj $(LIBCURSES) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name testcurs.exe - @%append demos.lnk file testcurs.obj - @%append demos.lnk library $(LIBCURSES) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name tuidemo.exe - @%append demos.lnk file tuidemo.obj - @%append demos.lnk file tui.obj - @%append demos.lnk library $(LIBCURSES) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -xmas.exe: xmas.obj $(LIBCURSES) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name xmas.exe - @%append demos.lnk file xmas.obj - @%append demos.lnk library $(LIBCURSES) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - - -firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\firework.c - -newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\newdemo.c - -ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\ptest.c - -testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\testcurs.c - -tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tui.c - -tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tuidemo.c - -xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\xmas.c - -dist: pdcurses.lib panel.lib - -mkdir tmp - cd tmp - copy $(PDCURSES_HOME)\README README - copy $(PDCURSES_HOME)\readme.?? . - copy $(PDCURSES_HOME)\curses.h . - copy $(PDCURSES_HOME)\curspriv.h . - copy $(PDCURSES_HOME)\maintain.er . - copy ..\pdcurses.lib . - copy ..\panel.lib . - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz - echo PDCurses - Public Domain Curses >> file_id.diz - echo Version $(VERDOT) for Watcom C++ 16bit DOS PDC$(VER)16W.ZIP >> file_id.diz - echo ------------------------------------------ >> file_id.diz - echo Public Domain Curses library for >> file_id.diz - echo Watcom C/C++ 10.6 for 16 bit DOS. >> file_id.diz - echo Source available in PDCURS$(VER).ZIP >> file_id.diz - echo Public Domain. >> file_id.diz - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz - zip pdc$(VER)16w *.* - cd .. +################################################################################ +# +# Watcom WMAKE Makefile for PDCurses library - DOS (16 bit) Watcom C/C++ 10.6 +# +# Usage: wmake -f [path\]wccdos16.mak [DEBUG=Y] [target] +# +# where target can be any of: +# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] +# +################################################################################ +# +# Change these for your environment... +# +################################################################################ +PDCURSES_HOME =c:\curses +CCINCDIR =k:\h +MODEL =l +################################################################################ +# Nothing below here should required changing. +################################################################################ +VER=24 +VERDOT=2.4 + +PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h +PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h +PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PANEL_HEADER =$(PDCURSES_HOME)\panel.h + + +srcdir = $(PDCURSES_HOME)\pdcurses +osdir = $(PDCURSES_HOME)\dos +pandir = $(PDCURSES_HOME)\panel +demodir = $(PDCURSES_HOME)\demos + +CC = wcc +TARGET=dos + +!ifeq DEBUG Y +CFLAGS = /d2 /DPDCDEBUG +LDFLAGS = DEBUG WATCOM ALL +!else +CFLAGS = /oneatx +LDFLAGS = +!endif + +CPPFLAGS = /i=$(PDCURSES_HOME) /i=$(CCINCDIR) + +CCFLAGS = /bt=$(TARGET) /zq /m$(MODEL) $(CFLAGS) $(CPPFLAGS) + +LINK = wlink + +LIBEXE = wlib /q /n + +LIBCURSES = pdcurses.lib +LIBPANEL = panel.lib + +PDCLIBS = $(LIBCURSES) $(LIBPANEL) +DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe + +################################################################################ +all: $(PDCLIBS) $(DEMOS) + +clean: + -del *.obj + -del curses.lib + -del panel.lib + -del *.exe + +demos: $(DEMOS) + +#------------------------------------------------------------------------ + +LIBOBJS = & +addch.obj & +addchstr.obj & +addstr.obj & +attr.obj & +beep.obj & +bkgd.obj & +border.obj & +clear.obj & +color.obj & +delch.obj & +deleteln.obj & +getch.obj & +getstr.obj & +getyx.obj & +inch.obj & +inchstr.obj & +initscr.obj & +inopts.obj & +insch.obj & +insstr.obj & +instr.obj & +kernel.obj & +mouse.obj & +move.obj & +outopts.obj & +overlay.obj & +pad.obj & +printw.obj & +refresh.obj & +scanw.obj & +scroll.obj & +slk.obj & +termattr.obj & +terminfo.obj & +touch.obj & +util.obj & +window.obj + +PDCOBJS = & +pdcclip.obj & +pdcdebug.obj & +pdcdisp.obj & +pdcgetsc.obj & +pdckbd.obj & +pdcprint.obj & +pdcscrn.obj & +pdcsetsc.obj & +pdcutil.obj & +pdcwin.obj + +PANOBJS = & +panel.obj + +pdcurses.lib : $(LIBOBJS) $(PDCOBJS) + $(LIBEXE) $@ @$(osdir)\wccdos.lrf + +panel.lib : $(PANOBJS) + @%create lib.rsp + @%append lib.rsp +$(PANOBJS) + $(LIBEXE) $@ @lib.rsp + del lib.rsp + +addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addch.c + +addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addchstr.c + +addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addstr.c + +attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\attr.c + +beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\beep.c + +bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\bkgd.c + +border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\border.c + +clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\clear.c + +color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\color.c + +delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\delch.c + +deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\deleteln.c + +getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getch.c + +getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getstr.c + +getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getyx.c + +inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inch.c + +inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inchstr.c + +initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\initscr.c + +inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inopts.c + +insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insch.c + +insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insstr.c + +instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\instr.c + +kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\kernel.c + +mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\mouse.c + +move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\move.c + +outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\outopts.c + +overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\overlay.c + +pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pad.c + +printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\printw.c + +refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\refresh.c + +scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scanw.c + +scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scroll.c + +slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\slk.c + +termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\termattr.c + +terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\terminfo.c + +touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\touch.c + +util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\util.c + +window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\window.c + + +pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcclip.c + +pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcdebug.c + +pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcdisp.c + +pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcgetsc.c + +pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdckbd.c + +pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcprint.c + +pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcscrn.c + +pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcsetsc.c + +pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcutil.c + +pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcwin.c + +#------------------------------------------------------------------------ + +panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) + $(CC) $(CCFLAGS) /fo=$@ $(pandir)\panel.c + +#------------------------------------------------------------------------ + +firework.exe: firework.obj $(LIBCURSES) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name firework.exe + @%append demos.lnk file firework.obj + @%append demos.lnk library $(LIBCURSES) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +newdemo.exe: newdemo.obj $(LIBCURSES) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name newdemo.exe + @%append demos.lnk file newdemo.obj + @%append demos.lnk library $(LIBCURSES) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name ptest.exe + @%append demos.lnk file ptest.obj + @%append demos.lnk library $(LIBCURSES) + @%append demos.lnk library $(LIBPANEL) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +testcurs.exe: testcurs.obj $(LIBCURSES) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name testcurs.exe + @%append demos.lnk file testcurs.obj + @%append demos.lnk library $(LIBCURSES) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name tuidemo.exe + @%append demos.lnk file tuidemo.obj + @%append demos.lnk file tui.obj + @%append demos.lnk library $(LIBCURSES) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +xmas.exe: xmas.obj $(LIBCURSES) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name xmas.exe + @%append demos.lnk file xmas.obj + @%append demos.lnk library $(LIBCURSES) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + + +firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\firework.c + +newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\newdemo.c + +ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\ptest.c + +testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\testcurs.c + +tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tui.c + +tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tuidemo.c + +xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\xmas.c + +dist: pdcurses.lib panel.lib + -mkdir tmp + cd tmp + copy $(PDCURSES_HOME)\README README + copy $(PDCURSES_HOME)\readme.?? . + copy $(PDCURSES_HOME)\curses.h . + copy $(PDCURSES_HOME)\curspriv.h . + copy $(PDCURSES_HOME)\maintain.er . + copy ..\pdcurses.lib . + copy ..\panel.lib . + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz + echo PDCurses - Public Domain Curses >> file_id.diz + echo Version $(VERDOT) for Watcom C++ 16bit DOS PDC$(VER)16W.ZIP >> file_id.diz + echo ------------------------------------------ >> file_id.diz + echo Public Domain Curses library for >> file_id.diz + echo Watcom C/C++ 10.6 for 16 bit DOS. >> file_id.diz + echo Source available in PDCURS$(VER).ZIP >> file_id.diz + echo Public Domain. >> file_id.diz + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz + zip pdc$(VER)16w *.* + cd .. diff --git a/dos/wccdos4g.mak b/dos/wccdos4g.mak index 3841e00e..7b43f8a4 100644 --- a/dos/wccdos4g.mak +++ b/dos/wccdos4g.mak @@ -1,388 +1,388 @@ -################################################################################ -# -# Watcom WMAKE Makefile for PDCurses library - DOS/4GW Watcom C/C++ 10.6 -# -# Usage: wmake -f [path\]wccdos4g.mak [-DDEBUG] [target] -# -# where target can be any of: -# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] -# -################################################################################ -# -# Change these for your environment... -# -################################################################################ -PDCURSES_HOME =c:\curses -CCINCDIR =k:\h -################################################################################ -# Nothing below here should required changing. -################################################################################ -VER=24 -VERDOT=2.4 - -PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h -PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h -PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) -PANEL_HEADER =$(PDCURSES_HOME)\panel.h - - -srcdir = $(PDCURSES_HOME)\pdcurses -osdir = $(PDCURSES_HOME)\dos -pandir = $(PDCURSES_HOME)\panel -demodir = $(PDCURSES_HOME)\demos - -CC = wcc386 -TARGET=dos4g - -!ifeq DEBUG Y -CFLAGS = /d2 /DPDCDEBUG -LDFLAGS = DEBUG WATCOM ALL -!else -CFLAGS = /oneatx -LDFLAGS = -!endif - -CPPFLAGS = /i=$(PDCURSES_HOME) /i=$(CCINCDIR) - -CCFLAGS = /bt=$(TARGET) /zq /mf $(CFLAGS) $(CPPFLAGS) - -LINK = wlink - -LIBEXE = wlib /q /n - -LIBCURSES = pdcurses.lib -LIBPANEL = panel.lib - -PDCLIBS = $(LIBCURSES) $(LIBPANEL) -DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe - -################################################################################ -all: $(PDCLIBS) $(DEMOS) - -clean: - -del *.obj - -del curses.lib - -del panel.lib - -del *.exe - -demos: $(DEMOS) - -#------------------------------------------------------------------------ - -LIBOBJS = & -addch.obj & -addchstr.obj & -addstr.obj & -attr.obj & -beep.obj & -bkgd.obj & -border.obj & -clear.obj & -color.obj & -delch.obj & -deleteln.obj & -getch.obj & -getstr.obj & -getyx.obj & -inch.obj & -inchstr.obj & -initscr.obj & -inopts.obj & -insch.obj & -insstr.obj & -instr.obj & -kernel.obj & -mouse.obj & -move.obj & -outopts.obj & -overlay.obj & -pad.obj & -printw.obj & -refresh.obj & -scanw.obj & -scroll.obj & -slk.obj & -termattr.obj & -terminfo.obj & -touch.obj & -util.obj & -window.obj - -PDCOBJS = & -pdcclip.obj & -pdcdebug.obj & -pdcdisp.obj & -pdcgetsc.obj & -pdckbd.obj & -pdcprint.obj & -pdcscrn.obj & -pdcsetsc.obj & -pdcutil.obj & -pdcwin.obj - -PANOBJS = & -panel.obj - -pdcurses.lib : $(LIBOBJS) $(PDCOBJS) - $(LIBEXE) $@ @$(osdir)\wccdos.lrf - -panel.lib : $(PANOBJS) - @%create lib.rsp - @%append lib.rsp +$(PANOBJS) - $(LIBEXE) $@ @lib.rsp - del lib.rsp - -addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addch.c - -addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addchstr.c - -addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addstr.c - -attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\attr.c - -beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\beep.c - -bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\bkgd.c - -border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\border.c - -clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\clear.c - -color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\color.c - -delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\delch.c - -deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\deleteln.c - -getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getch.c - -getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getstr.c - -getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getyx.c - -inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inch.c - -inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inchstr.c - -initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\initscr.c - -inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inopts.c - -insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insch.c - -insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insstr.c - -instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\instr.c - -kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\kernel.c - -mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\mouse.c - -move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\move.c - -outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\outopts.c - -overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\overlay.c - -pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pad.c - -printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\printw.c - -refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\refresh.c - -scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scanw.c - -scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scroll.c - -slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\slk.c - -termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\termattr.c - -terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\terminfo.c - -touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\touch.c - -util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\util.c - -window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\window.c - - -pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcclip.c - -pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcdebug.c - -pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcdisp.c - -pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcgetsc.c - -pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdckbd.c - -pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcprint.c - -pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcscrn.c - -pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcsetsc.c - -pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcutil.c - -pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcwin.c - -#------------------------------------------------------------------------ - -panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) - $(CC) $(CCFLAGS) /fo=$@ $(pandir)\panel.c - -#------------------------------------------------------------------------ - -firework.exe: firework.obj $(LIBCURSES) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name firework.exe - @%append demos.lnk file firework.obj - @%append demos.lnk library $(LIBCURSES) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -newdemo.exe: newdemo.obj $(LIBCURSES) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name newdemo.exe - @%append demos.lnk file newdemo.obj - @%append demos.lnk library $(LIBCURSES) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name ptest.exe - @%append demos.lnk file ptest.obj - @%append demos.lnk library $(LIBCURSES) - @%append demos.lnk library $(LIBPANEL) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -testcurs.exe: testcurs.obj $(LIBCURSES) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name testcurs.exe - @%append demos.lnk file testcurs.obj - @%append demos.lnk library $(LIBCURSES) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name tuidemo.exe - @%append demos.lnk file tuidemo.obj - @%append demos.lnk file tui.obj - @%append demos.lnk library $(LIBCURSES) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -xmas.exe: xmas.obj $(LIBCURSES) - @%create demos.lnk - @%append demos.lnk option quiet - @%append demos.lnk system $(TARGET) - @%append demos.lnk name xmas.exe - @%append demos.lnk file xmas.obj - @%append demos.lnk library $(LIBCURSES) - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - - -firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\firework.c - -newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\newdemo.c - -ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\ptest.c - -testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\testcurs.c - -tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tui.c - -tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tuidemo.c - -xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\xmas.c - -dist: pdcurses.lib panel.lib - -mkdir tmp - cd tmp - copy $(PDCURSES_HOME)\README README - copy $(PDCURSES_HOME)\readme.?? . - copy $(PDCURSES_HOME)\curses.h . - copy $(PDCURSES_HOME)\curspriv.h . - copy $(PDCURSES_HOME)\maintain.er . - copy ..\pdcurses.lib . - copy ..\panel.lib . - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz - echo PDCurses - Public Domain Curses >> file_id.diz - echo Version $(VERDOT) for Watcom C++ 32bit DOS PDC$(VER)32W.ZIP >> file_id.diz - echo ------------------------------------------ >> file_id.diz - echo Public Domain Curses library for >> file_id.diz - echo Watcom C/C++ 10.6 for 32 bit DOS. >> file_id.diz - echo Source available in PDCURS$(VER).ZIP >> file_id.diz - echo Public Domain. >> file_id.diz - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz - zip pdc$(VER)32w *.* - cd .. +################################################################################ +# +# Watcom WMAKE Makefile for PDCurses library - DOS/4GW Watcom C/C++ 10.6 +# +# Usage: wmake -f [path\]wccdos4g.mak [-DDEBUG] [target] +# +# where target can be any of: +# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] +# +################################################################################ +# +# Change these for your environment... +# +################################################################################ +PDCURSES_HOME =c:\curses +CCINCDIR =k:\h +################################################################################ +# Nothing below here should required changing. +################################################################################ +VER=24 +VERDOT=2.4 + +PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h +PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h +PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PANEL_HEADER =$(PDCURSES_HOME)\panel.h + + +srcdir = $(PDCURSES_HOME)\pdcurses +osdir = $(PDCURSES_HOME)\dos +pandir = $(PDCURSES_HOME)\panel +demodir = $(PDCURSES_HOME)\demos + +CC = wcc386 +TARGET=dos4g + +!ifeq DEBUG Y +CFLAGS = /d2 /DPDCDEBUG +LDFLAGS = DEBUG WATCOM ALL +!else +CFLAGS = /oneatx +LDFLAGS = +!endif + +CPPFLAGS = /i=$(PDCURSES_HOME) /i=$(CCINCDIR) + +CCFLAGS = /bt=$(TARGET) /zq /mf $(CFLAGS) $(CPPFLAGS) + +LINK = wlink + +LIBEXE = wlib /q /n + +LIBCURSES = pdcurses.lib +LIBPANEL = panel.lib + +PDCLIBS = $(LIBCURSES) $(LIBPANEL) +DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe + +################################################################################ +all: $(PDCLIBS) $(DEMOS) + +clean: + -del *.obj + -del curses.lib + -del panel.lib + -del *.exe + +demos: $(DEMOS) + +#------------------------------------------------------------------------ + +LIBOBJS = & +addch.obj & +addchstr.obj & +addstr.obj & +attr.obj & +beep.obj & +bkgd.obj & +border.obj & +clear.obj & +color.obj & +delch.obj & +deleteln.obj & +getch.obj & +getstr.obj & +getyx.obj & +inch.obj & +inchstr.obj & +initscr.obj & +inopts.obj & +insch.obj & +insstr.obj & +instr.obj & +kernel.obj & +mouse.obj & +move.obj & +outopts.obj & +overlay.obj & +pad.obj & +printw.obj & +refresh.obj & +scanw.obj & +scroll.obj & +slk.obj & +termattr.obj & +terminfo.obj & +touch.obj & +util.obj & +window.obj + +PDCOBJS = & +pdcclip.obj & +pdcdebug.obj & +pdcdisp.obj & +pdcgetsc.obj & +pdckbd.obj & +pdcprint.obj & +pdcscrn.obj & +pdcsetsc.obj & +pdcutil.obj & +pdcwin.obj + +PANOBJS = & +panel.obj + +pdcurses.lib : $(LIBOBJS) $(PDCOBJS) + $(LIBEXE) $@ @$(osdir)\wccdos.lrf + +panel.lib : $(PANOBJS) + @%create lib.rsp + @%append lib.rsp +$(PANOBJS) + $(LIBEXE) $@ @lib.rsp + del lib.rsp + +addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addch.c + +addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addchstr.c + +addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addstr.c + +attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\attr.c + +beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\beep.c + +bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\bkgd.c + +border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\border.c + +clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\clear.c + +color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\color.c + +delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\delch.c + +deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\deleteln.c + +getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getch.c + +getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getstr.c + +getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getyx.c + +inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inch.c + +inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inchstr.c + +initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\initscr.c + +inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inopts.c + +insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insch.c + +insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insstr.c + +instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\instr.c + +kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\kernel.c + +mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\mouse.c + +move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\move.c + +outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\outopts.c + +overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\overlay.c + +pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pad.c + +printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\printw.c + +refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\refresh.c + +scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scanw.c + +scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scroll.c + +slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\slk.c + +termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\termattr.c + +terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\terminfo.c + +touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\touch.c + +util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\util.c + +window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\window.c + + +pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcclip.c + +pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcdebug.c + +pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcdisp.c + +pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcgetsc.c + +pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdckbd.c + +pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcprint.c + +pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcscrn.c + +pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcsetsc.c + +pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcutil.c + +pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcwin.c + +#------------------------------------------------------------------------ + +panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) + $(CC) $(CCFLAGS) /fo=$@ $(pandir)\panel.c + +#------------------------------------------------------------------------ + +firework.exe: firework.obj $(LIBCURSES) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name firework.exe + @%append demos.lnk file firework.obj + @%append demos.lnk library $(LIBCURSES) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +newdemo.exe: newdemo.obj $(LIBCURSES) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name newdemo.exe + @%append demos.lnk file newdemo.obj + @%append demos.lnk library $(LIBCURSES) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name ptest.exe + @%append demos.lnk file ptest.obj + @%append demos.lnk library $(LIBCURSES) + @%append demos.lnk library $(LIBPANEL) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +testcurs.exe: testcurs.obj $(LIBCURSES) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name testcurs.exe + @%append demos.lnk file testcurs.obj + @%append demos.lnk library $(LIBCURSES) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name tuidemo.exe + @%append demos.lnk file tuidemo.obj + @%append demos.lnk file tui.obj + @%append demos.lnk library $(LIBCURSES) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +xmas.exe: xmas.obj $(LIBCURSES) + @%create demos.lnk + @%append demos.lnk option quiet + @%append demos.lnk system $(TARGET) + @%append demos.lnk name xmas.exe + @%append demos.lnk file xmas.obj + @%append demos.lnk library $(LIBCURSES) + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + + +firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\firework.c + +newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\newdemo.c + +ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\ptest.c + +testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\testcurs.c + +tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tui.c + +tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tuidemo.c + +xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\xmas.c + +dist: pdcurses.lib panel.lib + -mkdir tmp + cd tmp + copy $(PDCURSES_HOME)\README README + copy $(PDCURSES_HOME)\readme.?? . + copy $(PDCURSES_HOME)\curses.h . + copy $(PDCURSES_HOME)\curspriv.h . + copy $(PDCURSES_HOME)\maintain.er . + copy ..\pdcurses.lib . + copy ..\panel.lib . + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz + echo PDCurses - Public Domain Curses >> file_id.diz + echo Version $(VERDOT) for Watcom C++ 32bit DOS PDC$(VER)32W.ZIP >> file_id.diz + echo ------------------------------------------ >> file_id.diz + echo Public Domain Curses library for >> file_id.diz + echo Watcom C/C++ 10.6 for 32 bit DOS. >> file_id.diz + echo Source available in PDCURS$(VER).ZIP >> file_id.diz + echo Public Domain. >> file_id.diz + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz + zip pdc$(VER)32w *.* + cd .. diff --git a/os2/README b/os2/README index 70dcd8ec..be283daf 100644 --- a/os2/README +++ b/os2/README @@ -1,19 +1,19 @@ - - Welcome to PDCurses - - Contents - -------- - This directory contains core PDCurses source code files specific to - the OS/2 platform. - - - Distribution Status - ------------------- - - The files in this directory are released to the Public Domain. - - - Acknowlegements - --------------- - - Generic OS/2 port was provided by ???? + + Welcome to PDCurses + + Contents + -------- + This directory contains core PDCurses source code files specific to + the OS/2 platform. + + + Distribution Status + ------------------- + + The files in this directory are released to the Public Domain. + + + Acknowlegements + --------------- + + Generic OS/2 port was provided by ???? diff --git a/os2/bccos2.ini b/os2/bccos2.ini index f612f339..34bd7e67 100644 --- a/os2/bccos2.ini +++ b/os2/bccos2.ini @@ -1,154 +1,154 @@ -# MSDOS DMAKE startup file. Customize to suit your needs. -# Assumes MKS toolkit for the tool commands, and Turbo-C. Change as req'd. -# See the documentation for a description of internally defined macros. -# -# Disable warnings for macros redefined here that were given -# on the command line. -__.SILENT := $(.SILENT) -.SILENT := yes - -# Configuration parameters for DMAKE startup.mk file -# Set these to NON-NULL if you wish to turn the parameter on. -_HAVE_RCS := yes # yes => RCS is installed. -_HAVE_SCCS := # yes => SCCS is installed. - -# Applicable suffix definitions -A := .lib # Libraries -E := .exe # Executables -F := .for # Fortran -O := .obj # Objects -P := .pas # Pascal -S := .asm # Assembler sources -V := # RCS suffix - -# See if these are defined -TMPDIR := $(ROOTDIR)/tmp -.IMPORT .IGNORE : TMPDIR SHELL COMSPEC - -# Recipe execution configurations -# First set SHELL, If it is not defined, use COMSPEC, otherwise -# it is assumed to be MKS Korn SHELL. -.IF $(SHELL) == $(NULL) -.IF $(COMSPEC) == $(NULL) - SHELL := $(ROOTDIR)/bin/sh$E -.ELSE - SHELL := $(COMSPEC) -.END -.END -GROUPSHELL := $(SHELL) - -# Now set remaining arguments depending on which SHELL we -# are going to use. COMSPEC (assumed to be command.com) or -# MKS Korn Shell. -.IF $(SHELL)==$(COMSPEC) - SHELLFLAGS := $(SWITCHAR)c - GROUPFLAGS := $(SHELLFLAGS) - SHELLMETAS := *"?<> - GROUPSUFFIX := .bat - DIRSEPSTR := \\ - DIVFILE = $(TMPFILE:s,/,\) -.ELSE - SHELLFLAGS := -c - GROUPFLAGS := - SHELLMETAS := *"?<>|()&][$$\#`' - GROUPSUFFIX := .ksh - .MKSARGS := yes - DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) - DIVSEP_shell_yes := \\\ - DIVSEP_shell_no := \\ -.END - -# Standard C-language command names and flags - CC := bcc # C-compiler and flags - CFLAGS += - - AS := tasm # Assembler and flags - ASFLAGS += - - LD = tlink # Loader and flags - LDFLAGS += - LDLIBS = - -# Definition of $(MAKE) macro for recursive makes. - MAKE = $(MAKECMD) $(MFLAGS) - -# Language and Parser generation Tools and their flags - YACC := yacc # standard yacc - YFLAGS += - YTAB := ytab # yacc output files name stem. - - LEX := lex # standard lex - LFLAGS += - LEXYY := lex_yy # lex output file - -# Other Compilers, Tools and their flags - PC := tpc # pascal compiler - RC := anyf77 # ratfor compiler - FC := anyf77 # fortran compiler - - CO := co # check out for RCS - COFLAGS += -q - - AR := ar # archiver - ARFLAGS+= ruv - - RM := rm # remove a file command - RMFLAGS += - -# Implicit generation rules for making inferences. -# We don't provide .yr or .ye rules here. They're obsolete. -# Rules for making *$O - %$O .SWAP: %.c ; $(CC) $(CFLAGS) -c $< - %$O .SWAP: %$P ; $(PC) $(PFLAGS) -c $< - %$O .SWAP: %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); - %$O : %.cl ; class -c $< - %$O .SWAP: %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< - -# Executables - %$E .SWAP: %$O ; $(CC) $(LDFLAGS) -e$@ $< - -# lex and yacc rules - %.c .SWAP: %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ - %.c .SWAP: %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ - -# RCS support -.IF $(_HAVE_RCS) - % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@ - .NOINFER : $$(@:d)RCS/$$(@:f)$V -.END - -# SCCS support -.IF $(_HAVE_SCCS) - % : s.% ; get $< - .NOINFER : s.% -.END - -# Recipe to make archive files. -%$A .SWAP: -[ - $(AR) $(ARFLAGS) $@ $? - $(RM) $(RMFLAGS) $? -] - -# DMAKE uses this recipe to remove intermediate targets -.REMOVE :; $(RM) -f $< - -# AUGMAKE extensions for SYSV compatibility -@B = $(@:b) -@D = $(@:d) -@F = $(@:f) -"*B" = $(*:b) -"*D" = $(*:d) -"*F" = $(*:f) - RCS is installed. +_HAVE_SCCS := # yes => SCCS is installed. + +# Applicable suffix definitions +A := .lib # Libraries +E := .exe # Executables +F := .for # Fortran +O := .obj # Objects +P := .pas # Pascal +S := .asm # Assembler sources +V := # RCS suffix + +# See if these are defined +TMPDIR := $(ROOTDIR)/tmp +.IMPORT .IGNORE : TMPDIR SHELL COMSPEC + +# Recipe execution configurations +# First set SHELL, If it is not defined, use COMSPEC, otherwise +# it is assumed to be MKS Korn SHELL. +.IF $(SHELL) == $(NULL) +.IF $(COMSPEC) == $(NULL) + SHELL := $(ROOTDIR)/bin/sh$E +.ELSE + SHELL := $(COMSPEC) +.END +.END +GROUPSHELL := $(SHELL) + +# Now set remaining arguments depending on which SHELL we +# are going to use. COMSPEC (assumed to be command.com) or +# MKS Korn Shell. +.IF $(SHELL)==$(COMSPEC) + SHELLFLAGS := $(SWITCHAR)c + GROUPFLAGS := $(SHELLFLAGS) + SHELLMETAS := *"?<> + GROUPSUFFIX := .bat + DIRSEPSTR := \\ + DIVFILE = $(TMPFILE:s,/,\) +.ELSE + SHELLFLAGS := -c + GROUPFLAGS := + SHELLMETAS := *"?<>|()&][$$\#`' + GROUPSUFFIX := .ksh + .MKSARGS := yes + DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) + DIVSEP_shell_yes := \\\ + DIVSEP_shell_no := \\ +.END + +# Standard C-language command names and flags + CC := bcc # C-compiler and flags + CFLAGS += + + AS := tasm # Assembler and flags + ASFLAGS += + + LD = tlink # Loader and flags + LDFLAGS += + LDLIBS = + +# Definition of $(MAKE) macro for recursive makes. + MAKE = $(MAKECMD) $(MFLAGS) + +# Language and Parser generation Tools and their flags + YACC := yacc # standard yacc + YFLAGS += + YTAB := ytab # yacc output files name stem. + + LEX := lex # standard lex + LFLAGS += + LEXYY := lex_yy # lex output file + +# Other Compilers, Tools and their flags + PC := tpc # pascal compiler + RC := anyf77 # ratfor compiler + FC := anyf77 # fortran compiler + + CO := co # check out for RCS + COFLAGS += -q + + AR := ar # archiver + ARFLAGS+= ruv + + RM := rm # remove a file command + RMFLAGS += + +# Implicit generation rules for making inferences. +# We don't provide .yr or .ye rules here. They're obsolete. +# Rules for making *$O + %$O .SWAP: %.c ; $(CC) $(CFLAGS) -c $< + %$O .SWAP: %$P ; $(PC) $(PFLAGS) -c $< + %$O .SWAP: %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); + %$O : %.cl ; class -c $< + %$O .SWAP: %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< + +# Executables + %$E .SWAP: %$O ; $(CC) $(LDFLAGS) -e$@ $< + +# lex and yacc rules + %.c .SWAP: %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ + %.c .SWAP: %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ + +# RCS support +.IF $(_HAVE_RCS) + % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@ + .NOINFER : $$(@:d)RCS/$$(@:f)$V +.END + +# SCCS support +.IF $(_HAVE_SCCS) + % : s.% ; get $< + .NOINFER : s.% +.END + +# Recipe to make archive files. +%$A .SWAP: +[ + $(AR) $(ARFLAGS) $@ $? + $(RM) $(RMFLAGS) $? +] + +# DMAKE uses this recipe to remove intermediate targets +.REMOVE :; $(RM) -f $< + +# AUGMAKE extensions for SYSV compatibility +@B = $(@:b) +@D = $(@:d) +@F = $(@:f) +"*B" = $(*:b) +"*D" = $(*:d) +"*F" = $(*:f) + file_id.diz - echo PDCurses - Public Domain Curses >> file_id.diz - echo Version $(VERDOT) for Borland C++ OS/2 1.0 PDC$(VER)BCOS2.ZIP >> file_id.diz - echo ------------------------------------------ >> file_id.diz - echo Public Domain Curses library for >> file_id.diz - echo Borland C/C++ os/2 1.0. >> file_id.diz - echo Source available in PDCURS$(VER).ZIP >> file_id.diz - echo Public Domain. >> file_id.diz - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz - zip pdc$(VER)bcos2 *.* - cd .. +################################################################################ +# +# Borland MAKE Makefile for PDCurses library - OS/2 BC++ 1.0+ +# +# Usage: make -f [path\]bccos2.mak [-DDEBUG] [target] +# +# where target can be any of: +# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] +# +################################################################################ +# +# Change these for your environment... +# +################################################################################ +PDCURSES_HOME =c:\curses +CC_HOME =c:\bcos2 +#MODEL =l +################################################################################ +# Nothing below here should required changing. +################################################################################ +VER=24 +VERDOT=2.4 + +PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h +PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h +PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PANEL_HEADER =$(PDCURSES_HOME)\panel.h + +CCLIBDIR =$(CC_HOME)\lib +CCINCDIR =$(CC_HOME)\include + +srcdir = $(PDCURSES_HOME)\pdcurses +osdir = $(PDCURSES_HOME)\os2 +pandir = $(PDCURSES_HOME)\panel +demodir = $(PDCURSES_HOME)\demos + +CC = bcc + +!if $d(DEBUG) +CFLAGS = -N -v -y -DPDCDEBUG +LDFLAGS = /c /v /s /l /e +!else +CFLAGS = -O +LDFLAGS = +!endif + +CPPFLAGS = -I$(PDCURSES_HOME) -I$(CCINCDIR) + +CCFLAGS = -c $(CFLAGS) $(CPPFLAGS) + +LINK = tlink + +#CCLIBS =$(CCLIBDIR)\c2.lib +CCLIBS =c2.lib+os2.lib +STARTUP =$(CCLIBDIR)\c02.obj + +LIBEXE = tlib /C /E + +LIBCURSES = pdcurses.lib +LIBPANEL = panel.lib + +PDCLIBS = $(LIBCURSES) $(LIBPANEL) +DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe + +################################################################################ +all: $(PDCLIBS) $(DEMOS) + +clean: + -del *.obj + -del curses.lib + -del panel.lib + -del *.exe + +demos: $(DEMOS) + +#------------------------------------------------------------------------ + +LIBOBJS = \ +addch.obj \ +addchstr.obj \ +addstr.obj \ +attr.obj \ +beep.obj \ +bkgd.obj \ +border.obj \ +clear.obj \ +color.obj \ +delch.obj \ +deleteln.obj \ +getch.obj \ +getstr.obj \ +getyx.obj \ +inch.obj \ +inchstr.obj \ +initscr.obj \ +inopts.obj \ +insch.obj \ +insstr.obj \ +instr.obj \ +kernel.obj \ +mouse.obj \ +move.obj \ +outopts.obj \ +overlay.obj \ +pad.obj \ +printw.obj \ +refresh.obj \ +scanw.obj \ +scroll.obj \ +slk.obj \ +termattr.obj \ +terminfo.obj \ +touch.obj \ +util.obj \ +window.obj + +PDCOBJS = \ +pdcclip.obj \ +pdcdebug.obj \ +pdcdisp.obj \ +pdcgetsc.obj \ +pdckbd.obj \ +pdcprint.obj \ +pdcscrn.obj \ +pdcsetsc.obj \ +pdcutil.obj \ +pdcwin.obj + +PANOBJS = \ +panel.obj + +pdcurses.lib : $(LIBOBJS) $(PDCOBJS) + $(LIBEXE) $@ @$(osdir)\bccos2.lrf + +panel.lib : $(PANOBJS) + $(LIBEXE) $@ -+$(PANOBJS) + +addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\addch.c + +addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\addchstr.c + +addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\addstr.c + +attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\attr.c + +beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\beep.c + +bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\bkgd.c + +border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\border.c + +clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\clear.c + +color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\color.c + +delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\delch.c + +deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\deleteln.c + +getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\getch.c + +getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\getstr.c + +getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\getyx.c + +inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\inch.c + +inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\inchstr.c + +initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\initscr.c + +inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\inopts.c + +insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\insch.c + +insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\insstr.c + +instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\instr.c + +kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\kernel.c + +mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\mouse.c + +move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\move.c + +outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\outopts.c + +overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\overlay.c + +pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pad.c + +printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\printw.c + +refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\refresh.c + +scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\scanw.c + +scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\scroll.c + +slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\slk.c + +termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\termattr.c + +terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\terminfo.c + +touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\touch.c + +util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\util.c + +window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\window.c + + +pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcclip.c + +pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcdebug.c + +pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcdisp.c + +pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcgetsc.c + +pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdckbd.c + +pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcprint.c + +pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcscrn.c + +pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcsetsc.c + +pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcutil.c + +pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcwin.c + +#------------------------------------------------------------------------ + +panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) + $(CC) $(CCFLAGS) -o$@ $(pandir)\panel.c + +#------------------------------------------------------------------------ + +firework.exe: firework.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj,$*,,$(LIBCURSES)+$(CCLIBS); + +newdemo.exe: newdemo.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj,$*,,$(LIBCURSES)+$(CCLIBS); + +ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj,$*,,$(LIBPANEL)+$(LIBCURSES)+$(CCLIBS); + +testcurs.exe: testcurs.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj,$*,,$(LIBCURSES)+$(CCLIBS); + +tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj+tui.obj,$*,,$(LIBCURSES)+$(CCLIBS); + +xmas.exe: xmas.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $(STARTUP)+$*.obj,$*,,$(LIBCURSES)+$(CCLIBS); + + +firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\firework.c + +newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\newdemo.c + +ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\ptest.c + +testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\testcurs.c + +tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) -o$@ $(demodir)\tui.c + +tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) -o$@ $(demodir)\tuidemo.c + +xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\xmas.c + +dist: pdcurses.lib panel.lib + -mkdir tmp + cd tmp + copy $(PDCURSES_HOME)\README README + copy $(PDCURSES_HOME)\readme.?? . + copy $(PDCURSES_HOME)\curses.h . + copy $(PDCURSES_HOME)\curspriv.h . + copy $(PDCURSES_HOME)\maintain.er . + copy ..\pdcurses.lib . + copy ..\panel.lib . + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz + echo PDCurses - Public Domain Curses >> file_id.diz + echo Version $(VERDOT) for Borland C++ OS/2 1.0 PDC$(VER)BCOS2.ZIP >> file_id.diz + echo ------------------------------------------ >> file_id.diz + echo Public Domain Curses library for >> file_id.diz + echo Borland C/C++ os/2 1.0. >> file_id.diz + echo Source available in PDCURS$(VER).ZIP >> file_id.diz + echo Public Domain. >> file_id.diz + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz + zip pdc$(VER)bcos2 *.* + cd .. diff --git a/os2/gccos2.mak b/os2/gccos2.mak index 56522359..af6d7363 100644 --- a/os2/gccos2.mak +++ b/os2/gccos2.mak @@ -1,577 +1,577 @@ -################################################################################ -# -# GNU MAKE Makefile for PDCurses library - OS/2 emx 0.9c -# -# Usage: make -f [path\]gccos2.mak [DEBUG=Y] [EMXVIDEO=Y] [target] -# -# where target can be any of: -# [all|demos|pdcurses.a|panel.a|testcurs.exe...] -# -# The EMXVIDEO option compiles with the emx video library, which -# enables a PDCurses program to run under OS/2 and DOS. -# -################################################################################ -# -# Change these for your environment... -# -################################################################################ -PDCURSES_HOME =c:\curses -CC_HOME =c:/emx -################################################################################ -# Nothing below here should required changing. -################################################################################ -VER=24 -VERDOT=2.4 - -PDCURSES_CURSES_H =$(PDCURSES_HOME)/curses.h -PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)/curspriv.h -PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) -PANEL_HEADER =$(PDCURSES_HOME)/panel.h - -CCLIBDIR =$(CC_HOME)/lib -CCINCDIR =$(CC_HOME)/include - -srcdir = $(PDCURSES_HOME)/pdcurses -osdir = $(PDCURSES_HOME)/os2 -pandir = $(PDCURSES_HOME)/panel -demodir = $(PDCURSES_HOME)/demos - -CC = gcc - -ifeq ($(EMXVIDEO),Y) - EMXVID = -DEMXVIDEO - VIDLIB = -lvideo - BINDFLAGS = -acm - DLLTARGET = -else - EMXVID = - VIDLIB = - BINDFLAGS = - DLLTARGET = pdcurses.dll -endif - -ifeq ($(DEBUG),Y) - CFLAGS = -c -g -Wall -fomit-frame-pointer -DPDCDEBUG - LDFLAGS = -g -else - CFLAGS = -c -O3 -Wall -fomit-frame-pointer - LDFLAGS = -endif - -DLLFLAGS = -Zdll -Zcrtdll -Zomf -DLLCURSES = pdcurses_dll.lib - -CPPFLAGS = -I$(PDCURSES_HOME) -I$(CCINCDIR) $(EMXVID) - -CCFLAGS = $(CFLAGS) $(CPPFLAGS) - -LINK = gcc -EMXBIND =emxbind -EMXOMF =emxomf - -CCLIBS =$(VIDLIB) - -LIBEXE = ar -LIBFLAGS =rcv - -LIBCURSES = pdcurses.a -LIBPANEL = panel.a - -PDCLIBS = $(LIBCURSES) $(DLLTARGET) $(LIBPANEL) -DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe - -################################################################################ -all: $(PDCLIBS) $(DEMOS) - -clean: - -del *.o - -del curses.lib - -del panel.lib - -del *.exe - -demos: $(DEMOS) - -#------------------------------------------------------------------------ - -LIBOBJS = \ -addch.o \ -addchstr.o \ -addstr.o \ -attr.o \ -beep.o \ -bkgd.o \ -border.o \ -clear.o \ -color.o \ -delch.o \ -deleteln.o \ -getch.o \ -getstr.o \ -getyx.o \ -inch.o \ -inchstr.o \ -initscr.o \ -inopts.o \ -insch.o \ -insstr.o \ -instr.o \ -kernel.o \ -mouse.o \ -move.o \ -outopts.o \ -overlay.o \ -pad.o \ -printw.o \ -refresh.o \ -scanw.o \ -scroll.o \ -slk.o \ -termattr.o \ -terminfo.o \ -touch.o \ -util.o \ -window.o - -DLLOBJS = \ -addch.dlo \ -addchstr.dlo \ -addstr.dlo \ -attr.dlo \ -beep.dlo \ -bkgd.dlo \ -border.dlo \ -clear.dlo \ -color.dlo \ -delch.dlo \ -deleteln.dlo \ -getch.dlo \ -getstr.dlo \ -getyx.dlo \ -inch.dlo \ -inchstr.dlo \ -initscr.dlo \ -inopts.dlo \ -insch.dlo \ -insstr.dlo \ -instr.dlo \ -kernel.dlo \ -mouse.dlo \ -move.dlo \ -outopts.dlo \ -overlay.dlo \ -pad.dlo \ -printw.dlo \ -refresh.dlo \ -scanw.dlo \ -scroll.dlo \ -slk.dlo \ -termattr.dlo \ -terminfo.dlo \ -touch.dlo \ -util.dlo \ -window.dlo - -PDCOBJS = \ -pdcclip.o \ -pdcdebug.o \ -pdcdisp.o \ -pdcgetsc.o \ -pdckbd.o \ -pdcprint.o \ -pdcscrn.o \ -pdcsetsc.o \ -pdcutil.o \ -pdcwin.o - -PDCDLOS = \ -pdcclip.dlo \ -pdcdebug.dlo \ -pdcdisp.dlo \ -pdcgetsc.dlo \ -pdckbd.dlo \ -pdcprint.dlo \ -pdcscrn.dlo \ -pdcsetsc.dlo \ -pdcutil.dlo \ -pdcwin.dlo - -PANOBJS = \ -panel.o - -pdcurses.a : $(LIBOBJS) $(PDCOBJS) - $(LIBEXE) $(LIBFLAGS) $@ *.o - $(LIBEXE) d $@ $(PANOBJS) firework.o newdemo.o ptest.o testcurs.o tui.o tuidemo.o xmas.o - $(EMXOMF) -o pdcurses.lib pdcurses.a - -pdcurses.dll : $(DLLOBJS) $(PDCDLOS) - $(LINK) $(DLLFLAGS) -o pdcurses.dll $(DLLOBJS) $(PDCDLOS) $(osdir)\pdcurses.def - emximp -o pdcurses_dll.lib $(osdir)\pdcurses.def - emximp -o pdcurses_dll.a pdcurses_dll.lib - -panel.a : $(PANOBJS) - $(LIBEXE) $(LIBFLAGS) $@ $(PANOBJS) - $(EMXOMF) -o panel.lib panel.a - -addch.o: $(srcdir)\addch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\addch.c - -addchstr.o: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\addchstr.c - -addstr.o: $(srcdir)\addstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\addstr.c - -attr.o: $(srcdir)\attr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\attr.c - -beep.o: $(srcdir)\beep.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\beep.c - -bkgd.o: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\bkgd.c - -border.o: $(srcdir)\border.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\border.c - -clear.o: $(srcdir)\clear.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\clear.c - -color.o: $(srcdir)\color.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\color.c - -delch.o: $(srcdir)\delch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\delch.c - -deleteln.o: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\deleteln.c - -getch.o: $(srcdir)\getch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\getch.c - -getstr.o: $(srcdir)\getstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\getstr.c - -getyx.o: $(srcdir)\getyx.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\getyx.c - -inch.o: $(srcdir)\inch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\inch.c - -inchstr.o: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\inchstr.c - -initscr.o: $(srcdir)\initscr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\initscr.c - -inopts.o: $(srcdir)\inopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\inopts.c - -insch.o: $(srcdir)\insch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\insch.c - -insstr.o: $(srcdir)\insstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\insstr.c - -instr.o: $(srcdir)\instr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\instr.c - -kernel.o: $(srcdir)\kernel.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\kernel.c - -mouse.o: $(srcdir)\mouse.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\mouse.c - -move.o: $(srcdir)\move.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\move.c - -outopts.o: $(srcdir)\outopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\outopts.c - -overlay.o: $(srcdir)\overlay.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\overlay.c - -pad.o: $(srcdir)\pad.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\pad.c - -printw.o: $(srcdir)\printw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\printw.c - -refresh.o: $(srcdir)\refresh.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\refresh.c - -scanw.o: $(srcdir)\scanw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\scanw.c - -scroll.o: $(srcdir)\scroll.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\scroll.c - -slk.o: $(srcdir)\slk.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\slk.c - -termattr.o: $(srcdir)\termattr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\termattr.c - -terminfo.o: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\terminfo.c - -touch.o: $(srcdir)\touch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\touch.c - -util.o: $(srcdir)\util.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\util.c - -window.o: $(srcdir)\window.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\window.c - - -pdcclip.o: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcclip.c - -pdcdebug.o: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcdebug.c - -pdcdisp.o: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcdisp.c - -pdcgetsc.o: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcgetsc.c - -pdckbd.o: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)\pdckbd.c - -pdcprint.o: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcprint.c - -pdcscrn.o: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcscrn.c - -pdcsetsc.o: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcsetsc.c - -pdcutil.o: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcutil.c - -pdcwin.o: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcwin.c - -addch.dlo: $(srcdir)\addch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\addch.c - -addchstr.dlo: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\addchstr.c - -addstr.dlo: $(srcdir)\addstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\addstr.c - -attr.dlo: $(srcdir)\attr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\attr.c - -beep.dlo: $(srcdir)\beep.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\beep.c - -bkgd.dlo: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\bkgd.c - -border.dlo: $(srcdir)\border.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\border.c - -clear.dlo: $(srcdir)\clear.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\clear.c - -color.dlo: $(srcdir)\color.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\color.c - -delch.dlo: $(srcdir)\delch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\delch.c - -deleteln.dlo: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\deleteln.c - -getch.dlo: $(srcdir)\getch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\getch.c - -getstr.dlo: $(srcdir)\getstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\getstr.c - -getyx.dlo: $(srcdir)\getyx.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\getyx.c - -inch.dlo: $(srcdir)\inch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\inch.c - -inchstr.dlo: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\inchstr.c - -initscr.dlo: $(srcdir)\initscr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\initscr.c - -inopts.dlo: $(srcdir)\inopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\inopts.c - -insch.dlo: $(srcdir)\insch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\insch.c - -insstr.dlo: $(srcdir)\insstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\insstr.c - -instr.dlo: $(srcdir)\instr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\instr.c - -kernel.dlo: $(srcdir)\kernel.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\kernel.c - -mouse.dlo: $(srcdir)\mouse.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\mouse.c - -move.dlo: $(srcdir)\move.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\move.c - -outopts.dlo: $(srcdir)\outopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\outopts.c - -overlay.dlo: $(srcdir)\overlay.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\overlay.c - -pad.dlo: $(srcdir)\pad.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\pad.c - -printw.dlo: $(srcdir)\printw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\printw.c - -refresh.dlo: $(srcdir)\refresh.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\refresh.c - -scanw.dlo: $(srcdir)\scanw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\scanw.c - -scroll.dlo: $(srcdir)\scroll.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\scroll.c - -slk.dlo: $(srcdir)\slk.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\slk.c - -termattr.dlo: $(srcdir)\termattr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\termattr.c - -terminfo.dlo: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\terminfo.c - -touch.dlo: $(srcdir)\touch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\touch.c - -util.dlo: $(srcdir)\util.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\util.c - -window.dlo: $(srcdir)\window.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\window.c - - -pdcclip.dlo: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcclip.c - -pdcdebug.dlo: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\pdcdebug.c - -pdcdisp.dlo: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcdisp.c - -pdcgetsc.dlo: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcgetsc.c - -pdckbd.dlo: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdckbd.c - -pdcprint.dlo: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcprint.c - -pdcscrn.dlo: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcscrn.c - -pdcsetsc.dlo: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcsetsc.c - -pdcutil.dlo: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\pdcutil.c - -pdcwin.dlo: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\pdcwin.c - -#------------------------------------------------------------------------ - -panel.o: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) - $(CC) $(CCFLAGS) -o$@ $(pandir)\panel.c - -#------------------------------------------------------------------------ - -firework.exe: firework.o $(LIBCURSES) - $(LINK) $(LDFLAGS) -o firework firework.o $(LIBCURSES) -L$(CCLIBDIR) $(CCLIBS) - $(EMXBIND) firework $(BINDFLAGS) - -newdemo.exe: newdemo.o $(LIBCURSES) - $(LINK) $(LDFLAGS) -o newdemo newdemo.o $(LIBCURSES) -L$(CCLIBDIR) $(CCLIBS) - $(EMXBIND) newdemo $(BINDFLAGS) - -ptest.exe: ptest.o $(LIBCURSES) $(LIBPANEL) - $(LINK) $(LDFLAGS) -o ptest ptest.o $(LIBCURSES) $(LIBPANEL) -L$(CCLIBDIR) $(CCLIBS) - $(EMXBIND) ptest $(BINDFLAGS) - -testcurs.exe: testcurs.o $(LIBCURSES) - $(LINK) $(LDFLAGS) -o testcurs testcurs.o $(LIBCURSES) -L$(CCLIBDIR) $(CCLIBS) - $(EMXBIND) testcurs $(BINDFLAGS) - -tuidemo.exe: tuidemo.o tui.o $(LIBCURSES) - $(LINK) $(LDFLAGS) -o tuidemo tuidemo.o tui.o $(LIBCURSES) -L$(CCLIBDIR) $(CCLIBS) - $(EMXBIND) tuidemo $(BINDFLAGS) - -xmas.exe: xmas.o $(LIBCURSES) - $(LINK) $(LDFLAGS) -o xmas xmas.o $(LIBCURSES) -L$(CCLIBDIR) $(CCLIBS) - $(EMXBIND) xmas $(BINDFLAGS) - - -testcurs_dyn.exe: testcurs.obj pdcurses.dll - $(LINK) $(LDFLAGS) $(DLLFLAGS) -o testcurs_dyn testcurs.obj $(DLLCURSES) -L$(CCLIBDIR) $(CCLIBS) - $(EMXBIND) testcurs_dyn $(BINDFLAGS) - -firework.o: $(demodir)\firework.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o$@ $(demodir)\firework.c - -newdemo.o: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o$@ $(demodir)\newdemo.c - -ptest.o: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o$@ $(demodir)\ptest.c - -testcurs.o: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o$@ $(demodir)\testcurs.c - -testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -Zomf -o$@ $(demodir)\testcurs.c - -tui.o: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -I$(demodir) -o $@ $(demodir)\tui.c - -tuidemo.o: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -I$(demodir) -o $@ $(demodir)\tuidemo.c - -xmas.o: $(demodir)\xmas.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o$@ $(demodir)\xmas.c - -dist: pdcurses.a panel.a - -mkdir tmp - copy $(PDCURSES_HOME)\README tmp\README - copy $(PDCURSES_HOME)\readme.?? tmp - copy $(PDCURSES_HOME)\curses.h tmp - copy $(PDCURSES_HOME)\curspriv.h tmp - copy $(PDCURSES_HOME)\maintain.er tmp - copy pdcurses.a tmp - copy panel.a tmp - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > tmp\file_id.diz - echo PDCurses - Public Domain Curses >> tmp\file_id.diz - echo Version $(VERDOT) for EMX OS/2 PDC$(VER)_EMX_OS2.ZIP >> tmp\file_id.diz - echo ------------------------------------------ >> tmp\file_id.diz - echo Public Domain Curses library for >> tmp\file_id.diz - echo EMX 0.9c for OS/2. >> tmp\file_id.diz - echo Source available in PDCURS$(VER).ZIP >> tmp\file_id.diz - echo Public Domain. >> tmp\file_id.diz - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> tmp\file_id.diz - rexx 'cd tmp'; 'zip pdc$(VER)_emx_os2 "*.*"'; return 0 +################################################################################ +# +# GNU MAKE Makefile for PDCurses library - OS/2 emx 0.9c +# +# Usage: make -f [path\]gccos2.mak [DEBUG=Y] [EMXVIDEO=Y] [target] +# +# where target can be any of: +# [all|demos|pdcurses.a|panel.a|testcurs.exe...] +# +# The EMXVIDEO option compiles with the emx video library, which +# enables a PDCurses program to run under OS/2 and DOS. +# +################################################################################ +# +# Change these for your environment... +# +################################################################################ +PDCURSES_HOME =c:\curses +CC_HOME =c:/emx +################################################################################ +# Nothing below here should required changing. +################################################################################ +VER=24 +VERDOT=2.4 + +PDCURSES_CURSES_H =$(PDCURSES_HOME)/curses.h +PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)/curspriv.h +PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PANEL_HEADER =$(PDCURSES_HOME)/panel.h + +CCLIBDIR =$(CC_HOME)/lib +CCINCDIR =$(CC_HOME)/include + +srcdir = $(PDCURSES_HOME)/pdcurses +osdir = $(PDCURSES_HOME)/os2 +pandir = $(PDCURSES_HOME)/panel +demodir = $(PDCURSES_HOME)/demos + +CC = gcc + +ifeq ($(EMXVIDEO),Y) + EMXVID = -DEMXVIDEO + VIDLIB = -lvideo + BINDFLAGS = -acm + DLLTARGET = +else + EMXVID = + VIDLIB = + BINDFLAGS = + DLLTARGET = pdcurses.dll +endif + +ifeq ($(DEBUG),Y) + CFLAGS = -c -g -Wall -fomit-frame-pointer -DPDCDEBUG + LDFLAGS = -g +else + CFLAGS = -c -O3 -Wall -fomit-frame-pointer + LDFLAGS = +endif + +DLLFLAGS = -Zdll -Zcrtdll -Zomf +DLLCURSES = pdcurses_dll.lib + +CPPFLAGS = -I$(PDCURSES_HOME) -I$(CCINCDIR) $(EMXVID) + +CCFLAGS = $(CFLAGS) $(CPPFLAGS) + +LINK = gcc +EMXBIND =emxbind +EMXOMF =emxomf + +CCLIBS =$(VIDLIB) + +LIBEXE = ar +LIBFLAGS =rcv + +LIBCURSES = pdcurses.a +LIBPANEL = panel.a + +PDCLIBS = $(LIBCURSES) $(DLLTARGET) $(LIBPANEL) +DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe + +################################################################################ +all: $(PDCLIBS) $(DEMOS) + +clean: + -del *.o + -del curses.lib + -del panel.lib + -del *.exe + +demos: $(DEMOS) + +#------------------------------------------------------------------------ + +LIBOBJS = \ +addch.o \ +addchstr.o \ +addstr.o \ +attr.o \ +beep.o \ +bkgd.o \ +border.o \ +clear.o \ +color.o \ +delch.o \ +deleteln.o \ +getch.o \ +getstr.o \ +getyx.o \ +inch.o \ +inchstr.o \ +initscr.o \ +inopts.o \ +insch.o \ +insstr.o \ +instr.o \ +kernel.o \ +mouse.o \ +move.o \ +outopts.o \ +overlay.o \ +pad.o \ +printw.o \ +refresh.o \ +scanw.o \ +scroll.o \ +slk.o \ +termattr.o \ +terminfo.o \ +touch.o \ +util.o \ +window.o + +DLLOBJS = \ +addch.dlo \ +addchstr.dlo \ +addstr.dlo \ +attr.dlo \ +beep.dlo \ +bkgd.dlo \ +border.dlo \ +clear.dlo \ +color.dlo \ +delch.dlo \ +deleteln.dlo \ +getch.dlo \ +getstr.dlo \ +getyx.dlo \ +inch.dlo \ +inchstr.dlo \ +initscr.dlo \ +inopts.dlo \ +insch.dlo \ +insstr.dlo \ +instr.dlo \ +kernel.dlo \ +mouse.dlo \ +move.dlo \ +outopts.dlo \ +overlay.dlo \ +pad.dlo \ +printw.dlo \ +refresh.dlo \ +scanw.dlo \ +scroll.dlo \ +slk.dlo \ +termattr.dlo \ +terminfo.dlo \ +touch.dlo \ +util.dlo \ +window.dlo + +PDCOBJS = \ +pdcclip.o \ +pdcdebug.o \ +pdcdisp.o \ +pdcgetsc.o \ +pdckbd.o \ +pdcprint.o \ +pdcscrn.o \ +pdcsetsc.o \ +pdcutil.o \ +pdcwin.o + +PDCDLOS = \ +pdcclip.dlo \ +pdcdebug.dlo \ +pdcdisp.dlo \ +pdcgetsc.dlo \ +pdckbd.dlo \ +pdcprint.dlo \ +pdcscrn.dlo \ +pdcsetsc.dlo \ +pdcutil.dlo \ +pdcwin.dlo + +PANOBJS = \ +panel.o + +pdcurses.a : $(LIBOBJS) $(PDCOBJS) + $(LIBEXE) $(LIBFLAGS) $@ *.o + $(LIBEXE) d $@ $(PANOBJS) firework.o newdemo.o ptest.o testcurs.o tui.o tuidemo.o xmas.o + $(EMXOMF) -o pdcurses.lib pdcurses.a + +pdcurses.dll : $(DLLOBJS) $(PDCDLOS) + $(LINK) $(DLLFLAGS) -o pdcurses.dll $(DLLOBJS) $(PDCDLOS) $(osdir)\pdcurses.def + emximp -o pdcurses_dll.lib $(osdir)\pdcurses.def + emximp -o pdcurses_dll.a pdcurses_dll.lib + +panel.a : $(PANOBJS) + $(LIBEXE) $(LIBFLAGS) $@ $(PANOBJS) + $(EMXOMF) -o panel.lib panel.a + +addch.o: $(srcdir)\addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\addch.c + +addchstr.o: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\addchstr.c + +addstr.o: $(srcdir)\addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\addstr.c + +attr.o: $(srcdir)\attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\attr.c + +beep.o: $(srcdir)\beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\beep.c + +bkgd.o: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\bkgd.c + +border.o: $(srcdir)\border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\border.c + +clear.o: $(srcdir)\clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\clear.c + +color.o: $(srcdir)\color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\color.c + +delch.o: $(srcdir)\delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\delch.c + +deleteln.o: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\deleteln.c + +getch.o: $(srcdir)\getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\getch.c + +getstr.o: $(srcdir)\getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\getstr.c + +getyx.o: $(srcdir)\getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\getyx.c + +inch.o: $(srcdir)\inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\inch.c + +inchstr.o: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\inchstr.c + +initscr.o: $(srcdir)\initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\initscr.c + +inopts.o: $(srcdir)\inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\inopts.c + +insch.o: $(srcdir)\insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\insch.c + +insstr.o: $(srcdir)\insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\insstr.c + +instr.o: $(srcdir)\instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\instr.c + +kernel.o: $(srcdir)\kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\kernel.c + +mouse.o: $(srcdir)\mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\mouse.c + +move.o: $(srcdir)\move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\move.c + +outopts.o: $(srcdir)\outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\outopts.c + +overlay.o: $(srcdir)\overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\overlay.c + +pad.o: $(srcdir)\pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pad.c + +printw.o: $(srcdir)\printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\printw.c + +refresh.o: $(srcdir)\refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\refresh.c + +scanw.o: $(srcdir)\scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\scanw.c + +scroll.o: $(srcdir)\scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\scroll.c + +slk.o: $(srcdir)\slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\slk.c + +termattr.o: $(srcdir)\termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\termattr.c + +terminfo.o: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\terminfo.c + +touch.o: $(srcdir)\touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\touch.c + +util.o: $(srcdir)\util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\util.c + +window.o: $(srcdir)\window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\window.c + + +pdcclip.o: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcclip.c + +pdcdebug.o: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcdebug.c + +pdcdisp.o: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcdisp.c + +pdcgetsc.o: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcgetsc.c + +pdckbd.o: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdckbd.c + +pdcprint.o: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcprint.c + +pdcscrn.o: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcscrn.c + +pdcsetsc.o: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(osdir)\pdcsetsc.c + +pdcutil.o: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcutil.c + +pdcwin.o: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -o$@ $(srcdir)\pdcwin.c + +addch.dlo: $(srcdir)\addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\addch.c + +addchstr.dlo: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\addchstr.c + +addstr.dlo: $(srcdir)\addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\addstr.c + +attr.dlo: $(srcdir)\attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\attr.c + +beep.dlo: $(srcdir)\beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\beep.c + +bkgd.dlo: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\bkgd.c + +border.dlo: $(srcdir)\border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\border.c + +clear.dlo: $(srcdir)\clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\clear.c + +color.dlo: $(srcdir)\color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\color.c + +delch.dlo: $(srcdir)\delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\delch.c + +deleteln.dlo: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\deleteln.c + +getch.dlo: $(srcdir)\getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\getch.c + +getstr.dlo: $(srcdir)\getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\getstr.c + +getyx.dlo: $(srcdir)\getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\getyx.c + +inch.dlo: $(srcdir)\inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\inch.c + +inchstr.dlo: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\inchstr.c + +initscr.dlo: $(srcdir)\initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\initscr.c + +inopts.dlo: $(srcdir)\inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\inopts.c + +insch.dlo: $(srcdir)\insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\insch.c + +insstr.dlo: $(srcdir)\insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\insstr.c + +instr.dlo: $(srcdir)\instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\instr.c + +kernel.dlo: $(srcdir)\kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\kernel.c + +mouse.dlo: $(srcdir)\mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\mouse.c + +move.dlo: $(srcdir)\move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\move.c + +outopts.dlo: $(srcdir)\outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\outopts.c + +overlay.dlo: $(srcdir)\overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\overlay.c + +pad.dlo: $(srcdir)\pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\pad.c + +printw.dlo: $(srcdir)\printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\printw.c + +refresh.dlo: $(srcdir)\refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\refresh.c + +scanw.dlo: $(srcdir)\scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\scanw.c + +scroll.dlo: $(srcdir)\scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\scroll.c + +slk.dlo: $(srcdir)\slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\slk.c + +termattr.dlo: $(srcdir)\termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\termattr.c + +terminfo.dlo: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\terminfo.c + +touch.dlo: $(srcdir)\touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\touch.c + +util.dlo: $(srcdir)\util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\util.c + +window.dlo: $(srcdir)\window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\window.c + + +pdcclip.dlo: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcclip.c + +pdcdebug.dlo: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\pdcdebug.c + +pdcdisp.dlo: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcdisp.c + +pdcgetsc.dlo: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcgetsc.c + +pdckbd.dlo: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdckbd.c + +pdcprint.dlo: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcprint.c + +pdcscrn.dlo: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcscrn.c + +pdcsetsc.dlo: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(osdir)\pdcsetsc.c + +pdcutil.dlo: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\pdcutil.c + +pdcwin.dlo: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) $(DLLFLAGS) -o$@ $(srcdir)\pdcwin.c + +#------------------------------------------------------------------------ + +panel.o: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) + $(CC) $(CCFLAGS) -o$@ $(pandir)\panel.c + +#------------------------------------------------------------------------ + +firework.exe: firework.o $(LIBCURSES) + $(LINK) $(LDFLAGS) -o firework firework.o $(LIBCURSES) -L$(CCLIBDIR) $(CCLIBS) + $(EMXBIND) firework $(BINDFLAGS) + +newdemo.exe: newdemo.o $(LIBCURSES) + $(LINK) $(LDFLAGS) -o newdemo newdemo.o $(LIBCURSES) -L$(CCLIBDIR) $(CCLIBS) + $(EMXBIND) newdemo $(BINDFLAGS) + +ptest.exe: ptest.o $(LIBCURSES) $(LIBPANEL) + $(LINK) $(LDFLAGS) -o ptest ptest.o $(LIBCURSES) $(LIBPANEL) -L$(CCLIBDIR) $(CCLIBS) + $(EMXBIND) ptest $(BINDFLAGS) + +testcurs.exe: testcurs.o $(LIBCURSES) + $(LINK) $(LDFLAGS) -o testcurs testcurs.o $(LIBCURSES) -L$(CCLIBDIR) $(CCLIBS) + $(EMXBIND) testcurs $(BINDFLAGS) + +tuidemo.exe: tuidemo.o tui.o $(LIBCURSES) + $(LINK) $(LDFLAGS) -o tuidemo tuidemo.o tui.o $(LIBCURSES) -L$(CCLIBDIR) $(CCLIBS) + $(EMXBIND) tuidemo $(BINDFLAGS) + +xmas.exe: xmas.o $(LIBCURSES) + $(LINK) $(LDFLAGS) -o xmas xmas.o $(LIBCURSES) -L$(CCLIBDIR) $(CCLIBS) + $(EMXBIND) xmas $(BINDFLAGS) + + +testcurs_dyn.exe: testcurs.obj pdcurses.dll + $(LINK) $(LDFLAGS) $(DLLFLAGS) -o testcurs_dyn testcurs.obj $(DLLCURSES) -L$(CCLIBDIR) $(CCLIBS) + $(EMXBIND) testcurs_dyn $(BINDFLAGS) + +firework.o: $(demodir)\firework.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\firework.c + +newdemo.o: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\newdemo.c + +ptest.o: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\ptest.c + +testcurs.o: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\testcurs.c + +testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Zomf -o$@ $(demodir)\testcurs.c + +tui.o: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) -o $@ $(demodir)\tui.c + +tuidemo.o: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) -o $@ $(demodir)\tuidemo.c + +xmas.o: $(demodir)\xmas.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o$@ $(demodir)\xmas.c + +dist: pdcurses.a panel.a + -mkdir tmp + copy $(PDCURSES_HOME)\README tmp\README + copy $(PDCURSES_HOME)\readme.?? tmp + copy $(PDCURSES_HOME)\curses.h tmp + copy $(PDCURSES_HOME)\curspriv.h tmp + copy $(PDCURSES_HOME)\maintain.er tmp + copy pdcurses.a tmp + copy panel.a tmp + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > tmp\file_id.diz + echo PDCurses - Public Domain Curses >> tmp\file_id.diz + echo Version $(VERDOT) for EMX OS/2 PDC$(VER)_EMX_OS2.ZIP >> tmp\file_id.diz + echo ------------------------------------------ >> tmp\file_id.diz + echo Public Domain Curses library for >> tmp\file_id.diz + echo EMX 0.9c for OS/2. >> tmp\file_id.diz + echo Source available in PDCURS$(VER).ZIP >> tmp\file_id.diz + echo Public Domain. >> tmp\file_id.diz + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> tmp\file_id.diz + rexx 'cd tmp'; 'zip pdc$(VER)_emx_os2 "*.*"'; return 0 diff --git a/os2/ibmos2.ini b/os2/ibmos2.ini index 592d8322..3b2fc572 100644 --- a/os2/ibmos2.ini +++ b/os2/ibmos2.ini @@ -1,154 +1,154 @@ -# MSDOS DMAKE startup file. Customize to suit your needs. -# Assumes MKS toolkit for the tool commands, and Turbo-C. Change as req'd. -# See the documentation for a description of internally defined macros. -# -# Disable warnings for macros redefined here that were given -# on the command line. -__.SILENT := $(.SILENT) -.SILENT := yes - -# Configuration parameters for DMAKE startup.mk file -# Set these to NON-NULL if you wish to turn the parameter on. -_HAVE_RCS := yes # yes => RCS is installed. -_HAVE_SCCS := # yes => SCCS is installed. - -# Applicable suffix definitions -A := .lib # Libraries -E := .exe # Executables -F := .for # Fortran -O := .obj # Objects -P := .pas # Pascal -S := .asm # Assembler sources -V := # RCS suffix - -# See if these are defined -TMPDIR := $(ROOTDIR)/tmp -.IMPORT .IGNORE : TMPDIR SHELL COMSPEC - -# Recipe execution configurations -# First set SHELL, If it is not defined, use COMSPEC, otherwise -# it is assumed to be MKS Korn SHELL. -.IF $(SHELL) == $(NULL) -.IF $(COMSPEC) == $(NULL) - SHELL := $(ROOTDIR)/bin/sh$E -.ELSE - SHELL := $(COMSPEC) -.END -.END -GROUPSHELL := $(SHELL) - -# Now set remaining arguments depending on which SHELL we -# are going to use. COMSPEC (assumed to be command.com) or -# MKS Korn Shell. -.IF $(SHELL)==$(COMSPEC) - SHELLFLAGS := $(SWITCHAR)c - GROUPFLAGS := $(SHELLFLAGS) - SHELLMETAS := *"?<> - GROUPSUFFIX := .bat - DIRSEPSTR := \\ - DIVFILE = $(TMPFILE:s,/,\) -.ELSE - SHELLFLAGS := -c - GROUPFLAGS := - SHELLMETAS := *"?<>|()&][$$\#`' - GROUPSUFFIX := .ksh - .MKSARGS := yes - DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) - DIVSEP_shell_yes := \\\ - DIVSEP_shell_no := \\ -.END - -# Standard C-language command names and flags - CC := icc # C-compiler and flags - CFLAGS += - - AS := # Assembler and flags - ASFLAGS += - - LD = link386 # Loader and flags - LDFLAGS += - LDLIBS = - -# Definition of $(MAKE) macro for recursive makes. - MAKE = $(MAKECMD) $(MFLAGS) - -# Language and Parser generation Tools and their flags - YACC := yacc # standard yacc - YFLAGS += - YTAB := ytab # yacc output files name stem. - - LEX := lex # standard lex - LFLAGS += - LEXYY := lex_yy # lex output file - -# Other Compilers, Tools and their flags - PC := tpc # pascal compiler - RC := anyf77 # ratfor compiler - FC := anyf77 # fortran compiler - - CO := co # check out for RCS - COFLAGS += -q - - AR := ar # archiver - ARFLAGS+= ruv - - RM := rm # remove a file command - RMFLAGS += - -# Implicit generation rules for making inferences. -# We don't provide .yr or .ye rules here. They're obsolete. -# Rules for making *$O - %$O .SWAP: %.c ; $(CC) $(CFLAGS) -c $< - %$O .SWAP: %$P ; $(PC) $(PFLAGS) -c $< - %$O .SWAP: %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); - %$O : %.cl ; class -c $< - %$O .SWAP: %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< - -# Executables - %$E .SWAP: %$O ; $(CC) $(LDFLAGS) -e$@ $< - -# lex and yacc rules - %.c .SWAP: %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ - %.c .SWAP: %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ - -# RCS support -.IF $(_HAVE_RCS) - % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@ - .NOINFER : $$(@:d)RCS/$$(@:f)$V -.END - -# SCCS support -.IF $(_HAVE_SCCS) - % : s.% ; get $< - .NOINFER : s.% -.END - -# Recipe to make archive files. -%$A .SWAP: -[ - $(AR) $(ARFLAGS) $@ $? - $(RM) $(RMFLAGS) $? -] - -# DMAKE uses this recipe to remove intermediate targets -.REMOVE :; $(RM) -f $< - -# AUGMAKE extensions for SYSV compatibility -@B = $(@:b) -@D = $(@:d) -@F = $(@:f) -"*B" = $(*:b) -"*D" = $(*:d) -"*F" = $(*:f) - RCS is installed. +_HAVE_SCCS := # yes => SCCS is installed. + +# Applicable suffix definitions +A := .lib # Libraries +E := .exe # Executables +F := .for # Fortran +O := .obj # Objects +P := .pas # Pascal +S := .asm # Assembler sources +V := # RCS suffix + +# See if these are defined +TMPDIR := $(ROOTDIR)/tmp +.IMPORT .IGNORE : TMPDIR SHELL COMSPEC + +# Recipe execution configurations +# First set SHELL, If it is not defined, use COMSPEC, otherwise +# it is assumed to be MKS Korn SHELL. +.IF $(SHELL) == $(NULL) +.IF $(COMSPEC) == $(NULL) + SHELL := $(ROOTDIR)/bin/sh$E +.ELSE + SHELL := $(COMSPEC) +.END +.END +GROUPSHELL := $(SHELL) + +# Now set remaining arguments depending on which SHELL we +# are going to use. COMSPEC (assumed to be command.com) or +# MKS Korn Shell. +.IF $(SHELL)==$(COMSPEC) + SHELLFLAGS := $(SWITCHAR)c + GROUPFLAGS := $(SHELLFLAGS) + SHELLMETAS := *"?<> + GROUPSUFFIX := .bat + DIRSEPSTR := \\ + DIVFILE = $(TMPFILE:s,/,\) +.ELSE + SHELLFLAGS := -c + GROUPFLAGS := + SHELLMETAS := *"?<>|()&][$$\#`' + GROUPSUFFIX := .ksh + .MKSARGS := yes + DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) + DIVSEP_shell_yes := \\\ + DIVSEP_shell_no := \\ +.END + +# Standard C-language command names and flags + CC := icc # C-compiler and flags + CFLAGS += + + AS := # Assembler and flags + ASFLAGS += + + LD = link386 # Loader and flags + LDFLAGS += + LDLIBS = + +# Definition of $(MAKE) macro for recursive makes. + MAKE = $(MAKECMD) $(MFLAGS) + +# Language and Parser generation Tools and their flags + YACC := yacc # standard yacc + YFLAGS += + YTAB := ytab # yacc output files name stem. + + LEX := lex # standard lex + LFLAGS += + LEXYY := lex_yy # lex output file + +# Other Compilers, Tools and their flags + PC := tpc # pascal compiler + RC := anyf77 # ratfor compiler + FC := anyf77 # fortran compiler + + CO := co # check out for RCS + COFLAGS += -q + + AR := ar # archiver + ARFLAGS+= ruv + + RM := rm # remove a file command + RMFLAGS += + +# Implicit generation rules for making inferences. +# We don't provide .yr or .ye rules here. They're obsolete. +# Rules for making *$O + %$O .SWAP: %.c ; $(CC) $(CFLAGS) -c $< + %$O .SWAP: %$P ; $(PC) $(PFLAGS) -c $< + %$O .SWAP: %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); + %$O : %.cl ; class -c $< + %$O .SWAP: %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< + +# Executables + %$E .SWAP: %$O ; $(CC) $(LDFLAGS) -e$@ $< + +# lex and yacc rules + %.c .SWAP: %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ + %.c .SWAP: %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ + +# RCS support +.IF $(_HAVE_RCS) + % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@ + .NOINFER : $$(@:d)RCS/$$(@:f)$V +.END + +# SCCS support +.IF $(_HAVE_SCCS) + % : s.% ; get $< + .NOINFER : s.% +.END + +# Recipe to make archive files. +%$A .SWAP: +[ + $(AR) $(ARFLAGS) $@ $? + $(RM) $(RMFLAGS) $? +] + +# DMAKE uses this recipe to remove intermediate targets +.REMOVE :; $(RM) -f $< + +# AUGMAKE extensions for SYSV compatibility +@B = $(@:b) +@D = $(@:d) +@F = $(@:f) +"*B" = $(*:b) +"*D" = $(*:d) +"*F" = $(*:f) + RCS is installed. -_HAVE_SCCS := # yes => SCCS is installed. - -# Applicable suffix definitions -A := .lib # Libraries -E := .exe # Executables -F := .for # Fortran -O := .obj # Objects -P := .pas # Pascal -S := .asm # Assembler sources -V := # RCS suffix - -# See if these are defined -TMPDIR := $(ROOTDIR)/tmp -.IMPORT .IGNORE : TMPDIR SHELL COMSPEC - -# Recipe execution configurations -# First set SHELL, If it is not defined, use COMSPEC, otherwise -# it is assumed to be MKS Korn SHELL. -.IF $(SHELL) == $(NULL) -.IF $(COMSPEC) == $(NULL) - SHELL := $(ROOTDIR)/bin/sh$E -.ELSE - SHELL := $(COMSPEC) -.END -.END -GROUPSHELL := $(SHELL) - -# Now set remaining arguments depending on which SHELL we -# are going to use. COMSPEC (assumed to be command.com) or -# MKS Korn Shell. -.IF $(SHELL)==$(COMSPEC) - SHELLFLAGS := $(SWITCHAR)c - GROUPFLAGS := $(SHELLFLAGS) - SHELLMETAS := *"?<> - GROUPSUFFIX := .bat - DIRSEPSTR := \\ - DIVFILE = $(TMPFILE:s,/,\) -.ELSE - SHELLFLAGS := -c - GROUPFLAGS := - SHELLMETAS := *"?<>|()&][$$\#`' - GROUPSUFFIX := .ksh - .MKSARGS := yes - DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) - DIVSEP_shell_yes := \\\ - DIVSEP_shell_no := \\ -.END - -# Standard C-language command names and flags - CC := icc # C-compiler and flags - CFLAGS += - - AS := # Assembler and flags - ASFLAGS += - - LD = link386 # Loader and flags - LDFLAGS += - LDLIBS = - -# Definition of $(MAKE) macro for recursive makes. - MAKE = $(MAKECMD) $(MFLAGS) - -# Language and Parser generation Tools and their flags - YACC := yacc # standard yacc - YFLAGS += - YTAB := ytab # yacc output files name stem. - - LEX := lex # standard lex - LFLAGS += - LEXYY := lex_yy # lex output file - -# Other Compilers, Tools and their flags - PC := tpc # pascal compiler - RC := anyf77 # ratfor compiler - FC := anyf77 # fortran compiler - - CO := co # check out for RCS - COFLAGS += -q - - AR := ar # archiver - ARFLAGS+= ruv - - RM := rm # remove a file command - RMFLAGS += - -# Implicit generation rules for making inferences. -# We don't provide .yr or .ye rules here. They're obsolete. -# Rules for making *$O - %$O .SWAP: %.c ; $(CC) $(CFLAGS) -c $< - %$O .SWAP: %$P ; $(PC) $(PFLAGS) -c $< - %$O .SWAP: %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); - %$O : %.cl ; class -c $< - %$O .SWAP: %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< - -# Executables - %$E .SWAP: %$O ; $(CC) $(LDFLAGS) -e$@ $< - -# lex and yacc rules - %.c .SWAP: %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ - %.c .SWAP: %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ - -# RCS support -.IF $(_HAVE_RCS) - % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@ - .NOINFER : $$(@:d)RCS/$$(@:f)$V -.END - -# SCCS support -.IF $(_HAVE_SCCS) - % : s.% ; get $< - .NOINFER : s.% -.END - -# Recipe to make archive files. -%$A .SWAP: -[ - $(AR) $(ARFLAGS) $@ $? - $(RM) $(RMFLAGS) $? -] - -# DMAKE uses this recipe to remove intermediate targets -.REMOVE :; $(RM) -f $< - -# AUGMAKE extensions for SYSV compatibility -@B = $(@:b) -@D = $(@:d) -@F = $(@:f) -"*B" = $(*:b) -"*D" = $(*:d) -"*F" = $(*:f) - RCS is installed. +_HAVE_SCCS := # yes => SCCS is installed. + +# Applicable suffix definitions +A := .lib # Libraries +E := .exe # Executables +F := .for # Fortran +O := .obj # Objects +P := .pas # Pascal +S := .asm # Assembler sources +V := # RCS suffix + +# See if these are defined +TMPDIR := $(ROOTDIR)/tmp +.IMPORT .IGNORE : TMPDIR SHELL COMSPEC + +# Recipe execution configurations +# First set SHELL, If it is not defined, use COMSPEC, otherwise +# it is assumed to be MKS Korn SHELL. +.IF $(SHELL) == $(NULL) +.IF $(COMSPEC) == $(NULL) + SHELL := $(ROOTDIR)/bin/sh$E +.ELSE + SHELL := $(COMSPEC) +.END +.END +GROUPSHELL := $(SHELL) + +# Now set remaining arguments depending on which SHELL we +# are going to use. COMSPEC (assumed to be command.com) or +# MKS Korn Shell. +.IF $(SHELL)==$(COMSPEC) + SHELLFLAGS := $(SWITCHAR)c + GROUPFLAGS := $(SHELLFLAGS) + SHELLMETAS := *"?<> + GROUPSUFFIX := .bat + DIRSEPSTR := \\ + DIVFILE = $(TMPFILE:s,/,\) +.ELSE + SHELLFLAGS := -c + GROUPFLAGS := + SHELLMETAS := *"?<>|()&][$$\#`' + GROUPSUFFIX := .ksh + .MKSARGS := yes + DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}}) + DIVSEP_shell_yes := \\\ + DIVSEP_shell_no := \\ +.END + +# Standard C-language command names and flags + CC := icc # C-compiler and flags + CFLAGS += + + AS := # Assembler and flags + ASFLAGS += + + LD = link386 # Loader and flags + LDFLAGS += + LDLIBS = + +# Definition of $(MAKE) macro for recursive makes. + MAKE = $(MAKECMD) $(MFLAGS) + +# Language and Parser generation Tools and their flags + YACC := yacc # standard yacc + YFLAGS += + YTAB := ytab # yacc output files name stem. + + LEX := lex # standard lex + LFLAGS += + LEXYY := lex_yy # lex output file + +# Other Compilers, Tools and their flags + PC := tpc # pascal compiler + RC := anyf77 # ratfor compiler + FC := anyf77 # fortran compiler + + CO := co # check out for RCS + COFLAGS += -q + + AR := ar # archiver + ARFLAGS+= ruv + + RM := rm # remove a file command + RMFLAGS += + +# Implicit generation rules for making inferences. +# We don't provide .yr or .ye rules here. They're obsolete. +# Rules for making *$O + %$O .SWAP: %.c ; $(CC) $(CFLAGS) -c $< + %$O .SWAP: %$P ; $(PC) $(PFLAGS) -c $< + %$O .SWAP: %$S ; $(AS) $(ASFLAGS) $(<:s,/,\); + %$O : %.cl ; class -c $< + %$O .SWAP: %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $< + +# Executables + %$E .SWAP: %$O ; $(CC) $(LDFLAGS) -e$@ $< + +# lex and yacc rules + %.c .SWAP: %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@ + %.c .SWAP: %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@ + +# RCS support +.IF $(_HAVE_RCS) + % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@ + .NOINFER : $$(@:d)RCS/$$(@:f)$V +.END + +# SCCS support +.IF $(_HAVE_SCCS) + % : s.% ; get $< + .NOINFER : s.% +.END + +# Recipe to make archive files. +%$A .SWAP: +[ + $(AR) $(ARFLAGS) $@ $? + $(RM) $(RMFLAGS) $? +] + +# DMAKE uses this recipe to remove intermediate targets +.REMOVE :; $(RM) -f $< + +# AUGMAKE extensions for SYSV compatibility +@B = $(@:b) +@D = $(@:d) +@F = $(@:f) +"*B" = $(*:b) +"*D" = $(*:d) +"*F" = $(*:f) + file_id.diz - echo PDCurses - Public Domain Curses >> file_id.diz - echo Version $(VERDOT) for C Set/2 OS/2 PDC$(VER)_ICC_OS2.ZIP >> file_id.diz - echo ------------------------------------------ >> file_id.diz - echo Public Domain Curses library for >> file_id.diz - echo C Set/2 for OS/2. >> file_id.diz - echo Source available in PDCURS$(VER).ZIP >> file_id.diz - echo Public Domain. >> file_id.diz - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz - zip pdc$(VER)_icc_os2 *.* - cd .. +################################################################################ +# +# NMAKE Makefile for PDCurses library - OS/2 C Set/2 +# +# Usage: nmake -f [path\]iccos2.mak [DEBUG=1] [target] +# +# where target can be any of: +# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] +# +################################################################################ +# +# Change these for your environment... +# +################################################################################ +PDCURSES_HOME =c:\curses +CC_HOME =f:\ibmc +################################################################################ +# Nothing below here should required changing. +################################################################################ +VER=24 +VERDOT=2.4 + +PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h +PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h +PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PANEL_HEADER =$(PDCURSES_HOME)\panel.h + +srcdir = $(PDCURSES_HOME)\pdcurses +osdir = $(PDCURSES_HOME)\os2 +pandir = $(PDCURSES_HOME)\panel +demodir = $(PDCURSES_HOME)\demos + +CC = icc + +!ifdef DEBUG +CFLAGS = /Sm /Ti+ /O- /Q+ /dPDCDEBUG +LDFLAGS = /NOLOGO /NOE /SE:160 /DEBUG /PMTYPE:VIO +!else +CFLAGS = /Sm /Ti- /O+ /Q+ +LDFLAGS = /NOLOGO /NOE /EXEPACK /PACKCODE /PACKDATA /PMTYPE:VIO +!endif + +CPPFLAGS = -I$(PDCURSES_HOME) + +CCFLAGS = -c $(CFLAGS) $(CPPFLAGS) + +LINK = link386 + +LIBEXE = lib + +LIBCURSES = pdcurses.lib +LIBPANEL = panel.lib + +LIBRARIES = $(LIBCURSES) $(LIBPANEL) + +################################################################################ +all: $(LIBRARIES) + +clean: + -del *.obj + -del curses.lib + -del panel.lib + -del *.exe + +demos: testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe + +#------------------------------------------------------------------------ + +LIBOBJS = \ +addch.obj \ +addchstr.obj \ +addstr.obj \ +attr.obj \ +beep.obj \ +bkgd.obj \ +border.obj \ +clear.obj \ +color.obj \ +delch.obj \ +deleteln.obj \ +getch.obj \ +getstr.obj \ +getyx.obj \ +inch.obj \ +inchstr.obj \ +initscr.obj \ +inopts.obj \ +insch.obj \ +insstr.obj \ +instr.obj \ +kernel.obj \ +mouse.obj \ +move.obj \ +outopts.obj \ +overlay.obj \ +pad.obj \ +printw.obj \ +refresh.obj \ +scanw.obj \ +scroll.obj \ +slk.obj \ +termattr.obj \ +terminfo.obj \ +touch.obj \ +util.obj \ +window.obj + +PDCOBJS = \ +pdcclip.obj \ +pdcdebug.obj \ +pdcdisp.obj \ +pdcgetsc.obj \ +pdckbd.obj \ +pdcprint.obj \ +pdcscrn.obj \ +pdcsetsc.obj \ +pdcutil.obj \ +pdcwin.obj + +PANOBJS = \ +panel.obj + +pdcurses.lib : $(LIBOBJS) $(PDCOBJS) + $(LIBEXE) $@ @$(osdir)\iccos2.lrf + +panel.lib : $(PANOBJS) + $(LIBEXE) $@ -+$(PANOBJS); + +addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addch.c + +addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addchstr.c + +addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\addstr.c + +attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\attr.c + +beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\beep.c + +bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\bkgd.c + +border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\border.c + +clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\clear.c + +color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\color.c + +delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\delch.c + +deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\deleteln.c + +getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getch.c + +getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getstr.c + +getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\getyx.c + +inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inch.c + +inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inchstr.c + +initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\initscr.c + +inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\inopts.c + +insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\insch.c + +insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\insstr.c + +instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\instr.c + +kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\kernel.c + +mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\mouse.c + +move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\move.c + +outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\outopts.c + +overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\overlay.c + +pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pad.c + +printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\printw.c + +refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\refresh.c + +scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\scanw.c + +scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\scroll.c + +slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\slk.c + +termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\termattr.c + +terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\terminfo.c + +touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\touch.c + +util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\util.c + +window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\window.c + + +pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcclip.c + +pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcdebug.c + +pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcdisp.c + +pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcgetsc.c + +pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdckbd.c + +pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcprint.c + +pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcscrn.c + +pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(osdir)\pdcsetsc.c + +pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcutil.c + +pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) -Fo$@ $(srcdir)\pdcwin.c + +#------------------------------------------------------------------------ + +panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) + $(CC) $(CCFLAGS) -Fo$@ $(pandir)\panel.c + +#------------------------------------------------------------------------ +# DLFLAGS = $(LDEBUG) $*$(OBJ),$*,,$(PDCLIB); +# PANFLAGS = $(LDEBUG) $*$(OBJ),$*,,$(PDCLIB)+$(PANLIB); + +firework.exe: firework.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + +newdemo.exe: newdemo.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + +ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES)+$(LIBPANEL); + +testcurs.exe: testcurs.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + +tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj+tui.obj,$*,,$(LIBCURSES); + +xmas.exe: xmas.obj $(LIBCURSES) + $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); + + +firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\firework.c + +newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\newdemo.c + +ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)/panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\ptest.c + +testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\testcurs.c + +tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\tui.c + +tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\tuidemo.c + +xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -Fo$@ $(demodir)\xmas.c + +dist: pdcurses.lib panel.lib + -mkdir tmp + chdir tmp + copy $(PDCURSES_HOME)\README README + copy $(PDCURSES_HOME)\readme.?? . + copy $(PDCURSES_HOME)\curses.h . + copy $(PDCURSES_HOME)\curspriv.h . + copy $(PDCURSES_HOME)\maintain.er . + copy ..\pdcurses.lib . + copy ..\panel.lib . + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz + echo PDCurses - Public Domain Curses >> file_id.diz + echo Version $(VERDOT) for C Set/2 OS/2 PDC$(VER)_ICC_OS2.ZIP >> file_id.diz + echo ------------------------------------------ >> file_id.diz + echo Public Domain Curses library for >> file_id.diz + echo C Set/2 for OS/2. >> file_id.diz + echo Source available in PDCURS$(VER).ZIP >> file_id.diz + echo Public Domain. >> file_id.diz + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz + zip pdc$(VER)_icc_os2 *.* + cd .. diff --git a/os2/os2-bcc.rsp b/os2/os2-bcc.rsp index 4fde5da6..af8b7466 100644 --- a/os2/os2-bcc.rsp +++ b/os2/os2-bcc.rsp @@ -1,9 +1,9 @@ --K --G --rd --d --V --w-eff --j0 --c --P- +-K +-G +-rd +-d +-V +-w-eff +-j0 +-c +-P- diff --git a/os2/os2ibm.ini b/os2/os2ibm.ini index 04690a00..f26ebaf5 100644 --- a/os2/os2ibm.ini +++ b/os2/os2ibm.ini @@ -1,3 +1,3 @@ -#NOTE: startup.mk file is called dmake.ini for OS/2 -# and is found in os2/mscdos/dmake.ini -.INCLUDE : "os2/mscdos/dmake.ini" +#NOTE: startup.mk file is called dmake.ini for OS/2 +# and is found in os2/mscdos/dmake.ini +.INCLUDE : "os2/mscdos/dmake.ini" diff --git a/os2/pdcclip.c b/os2/pdcclip.c index 849c56b8..bd0c014d 100644 --- a/os2/pdcclip.c +++ b/os2/pdcclip.c @@ -1,193 +1,193 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ - - -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#if !defined(EMXVIDEO) -# define INCL_DOS -# define INCL_WIN -#endif -#include - -#include - -#ifdef PDCDEBUG -char *rcsid_PDCclip = "$Id: pdcclip.c,v 1.1 2001/01/10 08:29:28 mark Exp $"; -#endif - - -/*man-start********************************************************************* - - PDC_getclipboard() - Gets the contents of the clipboard - - PDCurses Description: - This is a PDCurses only routine. - - Gets the textual contents of the system's clipboard. This - function returns the contents of the clipboard in the contents - argument. It is the responsibilitiy of the caller to free the - memory returned with the free() system call. The length of the - clipboard contents is returned in the length argument. - - PDCurses Return Value: - indicator of success/failure of call. - PDC_CLIP_SUCCESS the call was successful - PDC_CLIP_ACCESS_ERROR an error occured while accessing the - clipboard - PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for - the clipboard contents - PDC_CLIP_EMPTY the clipboard contains no text - - Portability: - PDCurses int PDC_getclipboard( char **contents, long *length ); - -**man-end**********************************************************************/ - -int PDC_CDECL PDC_getclipboard(char **contents, long *length) -{ -#if !defined(EMXVIDEO) - HMQ hmq; - HAB hab; - PTIB ptib; - PPIB ppib; - ULONG ulRet; - long len=0; - int rc=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_getclipboard() - called\n"); -#endif - -#if !defined(EMXVIDEO) - DosGetInfoBlocks( &ptib, &ppib ); - ppib->pib_ultype = 3; - hab = WinInitialize( 0 ); - hmq = WinCreateMsgQueue( hab, 0 ); - - if ( !WinOpenClipbrd( hab ) ) - { - WinDestroyMsgQueue( hmq ); - WinTerminate( hab ); - return PDC_CLIP_ACCESS_ERROR; - } - ulRet = WinQueryClipbrdData( hab, CF_TEXT ); - if ( !ulRet ) - rc = PDC_CLIP_EMPTY; - else - { - len = strlen( (char *)ulRet ); - *contents = (char *)malloc( len+1 ); - if ( !*contents ) - { - rc = PDC_CLIP_MEMORY_ERROR; - } - else - { - strcpy( (char *)*contents, (char *)ulRet ); - *length = len; - rc = PDC_CLIP_SUCCESS; - } - } - WinCloseClipbrd( hab ); - WinDestroyMsgQueue( hmq ); - WinTerminate( hab ); - return( rc ); -#else - return PDC_CLIP_ACCESS_ERROR; -#endif -} - - -/*man-start********************************************************************* - - PDC_setclipboard() - Sets the contents of the clipboard - - PDCurses Description: - This is a PDCurses only routine. - - Copies the supplied text into the system's clipboard, emptying - the clipboard prior to the copy. - - PDCurses Return Value: - indicator of success/failure of call. - PDC_CLIP_SUCCESS the call was successful - PDC_CLIP_ACCESS_ERROR an error occured while accessing the - clipboard - - Portability: - PDCurses int PDC_getclipboard( char *contents, long length ); - -**man-end**********************************************************************/ - -int PDC_CDECL PDC_setclipboard(char *contents, long length) -{ -#if !defined(EMXVIDEO) - HAB hab; - PTIB ptib; - PPIB ppib; - ULONG ulRC; - PSZ szTextOut=NULL; - int rc=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_setclipboard() - called\n"); -#endif - -#if !defined(EMXVIDEO) - DosGetInfoBlocks( &ptib, &ppib ); - ppib->pib_ultype = 3; - hab = WinInitialize( 0 ); - - if ( !WinOpenClipbrd( hab ) ) - { - WinTerminate( hab ); - return PDC_CLIP_ACCESS_ERROR; - } - ulRC = DosAllocSharedMem( (PVOID) &szTextOut, NULL, length+1, PAG_WRITE | PAG_COMMIT | OBJ_GIVEABLE ); - if (ulRC != 0) - { - rc = PDC_CLIP_MEMORY_ERROR; - } - else - { - strcpy( szTextOut, contents ); - WinEmptyClipbrd( hab ); - if ( WinSetClipbrdData( hab, (ULONG)szTextOut, CF_TEXT, CFI_POINTER ) ) - { - rc = PDC_CLIP_SUCCESS; - } - else - { - DosFreeMem( szTextOut ); - rc = PDC_CLIP_ACCESS_ERROR; - } - } - WinCloseClipbrd( hab ); - WinTerminate( hab ); - return( rc ); -#else - return PDC_CLIP_ACCESS_ERROR; -#endif -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ + + +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#if !defined(EMXVIDEO) +# define INCL_DOS +# define INCL_WIN +#endif +#include + +#include + +#ifdef PDCDEBUG +char *rcsid_PDCclip = "$Id: pdcclip.c,v 1.2 2001/01/10 08:29:29 mark Exp $"; +#endif + + +/*man-start********************************************************************* + + PDC_getclipboard() - Gets the contents of the clipboard + + PDCurses Description: + This is a PDCurses only routine. + + Gets the textual contents of the system's clipboard. This + function returns the contents of the clipboard in the contents + argument. It is the responsibilitiy of the caller to free the + memory returned with the free() system call. The length of the + clipboard contents is returned in the length argument. + + PDCurses Return Value: + indicator of success/failure of call. + PDC_CLIP_SUCCESS the call was successful + PDC_CLIP_ACCESS_ERROR an error occured while accessing the + clipboard + PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for + the clipboard contents + PDC_CLIP_EMPTY the clipboard contains no text + + Portability: + PDCurses int PDC_getclipboard( char **contents, long *length ); + +**man-end**********************************************************************/ + +int PDC_CDECL PDC_getclipboard(char **contents, long *length) +{ +#if !defined(EMXVIDEO) + HMQ hmq; + HAB hab; + PTIB ptib; + PPIB ppib; + ULONG ulRet; + long len=0; + int rc=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_getclipboard() - called\n"); +#endif + +#if !defined(EMXVIDEO) + DosGetInfoBlocks( &ptib, &ppib ); + ppib->pib_ultype = 3; + hab = WinInitialize( 0 ); + hmq = WinCreateMsgQueue( hab, 0 ); + + if ( !WinOpenClipbrd( hab ) ) + { + WinDestroyMsgQueue( hmq ); + WinTerminate( hab ); + return PDC_CLIP_ACCESS_ERROR; + } + ulRet = WinQueryClipbrdData( hab, CF_TEXT ); + if ( !ulRet ) + rc = PDC_CLIP_EMPTY; + else + { + len = strlen( (char *)ulRet ); + *contents = (char *)malloc( len+1 ); + if ( !*contents ) + { + rc = PDC_CLIP_MEMORY_ERROR; + } + else + { + strcpy( (char *)*contents, (char *)ulRet ); + *length = len; + rc = PDC_CLIP_SUCCESS; + } + } + WinCloseClipbrd( hab ); + WinDestroyMsgQueue( hmq ); + WinTerminate( hab ); + return( rc ); +#else + return PDC_CLIP_ACCESS_ERROR; +#endif +} + + +/*man-start********************************************************************* + + PDC_setclipboard() - Sets the contents of the clipboard + + PDCurses Description: + This is a PDCurses only routine. + + Copies the supplied text into the system's clipboard, emptying + the clipboard prior to the copy. + + PDCurses Return Value: + indicator of success/failure of call. + PDC_CLIP_SUCCESS the call was successful + PDC_CLIP_ACCESS_ERROR an error occured while accessing the + clipboard + + Portability: + PDCurses int PDC_getclipboard( char *contents, long length ); + +**man-end**********************************************************************/ + +int PDC_CDECL PDC_setclipboard(char *contents, long length) +{ +#if !defined(EMXVIDEO) + HAB hab; + PTIB ptib; + PPIB ppib; + ULONG ulRC; + PSZ szTextOut=NULL; + int rc=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_setclipboard() - called\n"); +#endif + +#if !defined(EMXVIDEO) + DosGetInfoBlocks( &ptib, &ppib ); + ppib->pib_ultype = 3; + hab = WinInitialize( 0 ); + + if ( !WinOpenClipbrd( hab ) ) + { + WinTerminate( hab ); + return PDC_CLIP_ACCESS_ERROR; + } + ulRC = DosAllocSharedMem( (PVOID) &szTextOut, NULL, length+1, PAG_WRITE | PAG_COMMIT | OBJ_GIVEABLE ); + if (ulRC != 0) + { + rc = PDC_CLIP_MEMORY_ERROR; + } + else + { + strcpy( szTextOut, contents ); + WinEmptyClipbrd( hab ); + if ( WinSetClipbrdData( hab, (ULONG)szTextOut, CF_TEXT, CFI_POINTER ) ) + { + rc = PDC_CLIP_SUCCESS; + } + else + { + DosFreeMem( szTextOut ); + rc = PDC_CLIP_ACCESS_ERROR; + } + } + WinCloseClipbrd( hab ); + WinTerminate( hab ); + return( rc ); +#else + return PDC_CLIP_ACCESS_ERROR; +#endif +} diff --git a/os2/pdcdisp.c b/os2/pdcdisp.c index d83de0dc..74a93030 100644 --- a/os2/pdcdisp.c +++ b/os2/pdcdisp.c @@ -1,582 +1,582 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#include - -#ifdef HAVE_MEMORY_H -# include -#endif - -#ifndef HAVE_MEMMOVE -# define memmove PDC_memmove -#endif - -#ifdef PDCDEBUG -char *rcsid_PDCdisp = "$Id: pdcdisp.c,v 1.1 2001/01/10 08:29:30 mark Exp $"; -#endif - -/*man-start********************************************************************* - - PDC_clr_update() - Updates the screen with a full redraw. - - PDCurses Description: - Updates the screen by clearing it and then redraw it in its - entirety. If SP->refrbrk is TRUE, and there is pending - input characters, the update will be prematurely terminated. - - PDCurses Return Value: - This routine returns ERR if it is unable to accomplish it's task. - This return value is ONLY under FLEXOS. - - The return value OK is returned if there were no errors. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_clr_update( WINDOW* s ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_clr_update(WINDOW *s) -#else -int PDC_clr_update(s) -WINDOW *s; -#endif -/***********************************************************************/ -{ -register int i=0,j=0; - WINDOW* w=NULL; - unsigned short* ch; - bool rc=FALSE; - - extern unsigned char atrtab[MAX_ATRTAB]; - -/* the next two variables have been changed from chtype to unsigned short */ -/* as this is the correct datatype for a physical character/attribute */ - unsigned short temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ - unsigned short chr; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_clr_update() - called\n"); -#endif - - w = curscr; - if (w == (WINDOW *)NULL) - return( ERR ); -/* if (SP->full_redraw) - PDC_clr_scrn(s); *//* clear physical screen */ - - s->_clear = FALSE; - for (i = 0; i < LINES; i++) /* update physical screen */ - { - if (s != w) /* copy s to curscr */ - memcpy(w->_y[i], s->_y[i], COLS * sizeof(chtype)); - - ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */ - - for (j=0;j_y[i][j] & A_CHARTEXT); - temp_line[j] = chtype_attr(s->_y[i][j]) | chr; - } - - if (SP->direct_video) - { -#ifdef EMXVIDEO - v_putline ((char *)ch, 0, i, COLS); -#else - VioWrtCellStr ((PCH)ch, (USHORT)(COLS * sizeof(unsigned short)), (USHORT)i, 0, 0); -#endif - } - else - { - for (j = 0; j < COLS; j++) - { - PDC_gotoxy(i, j); - PDC_putc( (*ch & A_CHARTEXT), (*ch & A_ATTRIBUTES) >> 8 ); - ch++; - } - } - - if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) - { - rc = PDC_breakout(); - if(rc) - break; - } - w->_firstch[i] = _NO_CHANGE; - w->_lastch[i] = _NO_CHANGE; - } - return( OK ); -} - -/*man-start********************************************************************* - - PDC_cursor_on() - Turns on the hardware cursor. - - PDCurses Description: - Turns on the hardware curses, it does nothing if it is already on. - - PDCurses Return Value: - Returns OK upon success, ERR upon failure. - - Portability: - PDCurses int PDC_cursor_on( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_cursor_on(void) -#else -int PDC_cursor_on() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_cursor_on() - called\n"); -#endif - - if (!SP->visible_cursor) - { - SP->visible_cursor = TRUE; - PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, - (SP->cursor & 0x00ff)); - } - return( OK ); -} - -/*man-start********************************************************************* - - PDC_cursor_off() - Turns off the hardware cursor. - - PDCurses Description: - Turns off the hardware curses, it does nothing if it is already off. - - PDCurses Return Value: - Returns OK upon success, ERR upon failure. - - PDCurses Errors: - ERR will be returned (in the case of FLEXOS) if the hardware cursor - can not be disabled. - - Portability: - PDCurses int PDC_cursor_off( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_cursor_off(void) -#else -int PDC_cursor_off() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_cursor_off() - called\n"); -#endif - - if (SP->visible_cursor) - { - SP->visible_cursor = FALSE; - PDC_set_cursor_mode(32, 33); /* turn it off */ - } - return( OK ); -} - -/*man-start********************************************************************* - - PDC_fix_cursor() - Fix the cursor start and stop scan lines (if necessary) - - PDCurses Description: - This is a private PDCurses routine. - - This routine will fix the cursor shape for certain video adapters. - Normally, the values used are correct, but some adapters choke. - The most noticable choke is on a monochrome adapter. The "correct" - scan lines will result in the cursor being set in the middle of the - character cell, rather than at the bottom. - - The passed flag indicates whether the cursor is visible or not. - - This only applies to the DOS platform. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_fix_cursor( int flag ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_fix_cursor(int flag) -#else -int PDC_fix_cursor(flag) -int flag; -#endif -/***********************************************************************/ -{ - return( OK ); -} - -/*man-start********************************************************************* - - PDC_gotoxy() - position hardware cursor at (x, y) - - PDCurses Description: - This is a private PDCurses routine. - - Moves the physical cursor to the desired address on the - screen. We don't optimize here -- on a PC, it takes more time - to optimize than to do things directly. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_gotoxy( int row, int col ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_gotoxy(int row, int col) -#else -int PDC_gotoxy(row,col) -int row; -int col; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_gotoxy() - called: row %d col %d\n",row,col); -#endif - -#ifdef EMXVIDEO - v_gotoxy (col, row); -#else - VioSetCurPos (row, col, 0); -#endif - return(OK); -} - -/*man-start********************************************************************* - - PDC_putc() - Output a character in the current attribute. - - PDCurses Description: - This is a private PDCurses routine. - - Outputs character 'chr' to screen in tty fashion. If a colour - mode is active, the character is written with colour 'colour'. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_putc( chtype character, chtype color ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_putc( chtype character, chtype color ) -#else -int PDC_putc(character,color) -chtype character; -chtype color; -#endif -/***********************************************************************/ -{ - int curRow=0, curCol=0; -#ifdef EMXVIDEO - char Cell[2]; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_putc() - called:char=%c attrib=0x%x color=0x%x\n",character & A_CHARTEXT,character & A_ATTRIBUTES,color); -#endif - - PDC_get_cursor_pos (&curRow, &curCol); -#ifdef EMXVIDEO - Cell[0] = (char)character; - Cell[1] = (char)color; - v_putline (Cell, curCol, curRow, 1); -#else - VioWrtTTY ((PCH)&character, 1, 0); - VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0); - PDC_gotoxy (curRow, curCol); -#endif - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_putctty() - Output a character and attribute in TTY fashion. - - PDCurses Description: - This is a private PDCurses routine. - - Outputs character 'chr' to screen in tty fashion. If a colour - mode is active, the character is written with colour 'colour'. - - This function moves the physical cursor after writing so the - screen will scroll if necessary. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_putctty( chtype character, chtype color ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_putctty( chtype character, chtype color ) -#else -int PDC_putctty(character,color) -chtype character; -chtype color; -#endif -/***********************************************************************/ -{ - int curRow=0, curCol=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_putctty() - called\n"); -#endif - - PDC_get_cursor_pos (&curRow, &curCol); -#ifdef EMXVIDEO - v_attrib (color); - v_putc (character); -#else - VioWrtTTY ((PCH)&character, 1, 0); - VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0); -#endif - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_scroll() - low level screen scroll - - PDCurses Description: - Scrolls a window in the current page up or down. Urow, lcol, - lrow, rcol are the window coordinates. Lines is the number of - lines to scroll. If 0, clears the window, if < 0 scrolls down, - if > 0 scrolls up. Blanks areas that are left, and sets - character attributes to attr. If in a colour graphics mode, - fills them with the colour 'attr' instead. - - PDCurses Return Value: - The PDC_scroll() function returns OK on success otherwise ERR is returned. - - PDCurses Errors: - An error will only be returned on the Flexos platform if s_copy() - fails. - - Portability: - PDCurses int PDC_scroll( int urow, int lcol, int rcol, - int nlines, chtype attr ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_scroll(int urow, int lcol, int lrow, int rcol, int nlines, chtype attr) -#else -int PDC_scroll(urow,lcol,lrow,rcol,nlines,attr) -int urow; -int lcol; -int lrow; -int rcol; -int nlines; -chtype attr; -#endif -/***********************************************************************/ -{ - extern unsigned char atrtab[MAX_ATRTAB]; - int phys_attr=chtype_attr(attr); -#ifdef FLEXOS - int srow=0; - int scol=0; - int drow=0; - int dcol=0; - int nrows=0; - int ncols=0; - char blank = (char) SP->blank; -#endif - -#ifndef EMXVIDEO - USHORT ch=(phys_attr | SP->blank); -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scroll() - called: urow %d lcol %d lrow %d rcol %d nlines %d\n",urow,lcol,lrow,rcol,nlines); -#endif - -#ifdef EMXVIDEO - v_attrib (phys_attr); - if (nlines > 0) - v_scroll (lcol, urow, rcol, lrow, nlines, V_SCROLL_UP); - else - if (nlines < 0) - v_scroll (lcol, urow, rcol, lrow, -nlines, V_SCROLL_DOWN); - else /* this clears the whole screen */ - v_scroll (lcol, urow, rcol, lrow, -1, V_SCROLL_CLEAR); -#else - if (nlines > 0) - VioScrollUp(urow, lcol, lrow, rcol, nlines, (PBYTE)&ch, 0); - else - if (nlines < 0) - VioScrollDn(urow, lcol, lrow, rcol, nlines, (PBYTE)&ch, 0); - else -/* this clears the whole screen ?? */ - VioScrollUp(0, 0, -1, -1, -1, (PBYTE)&ch, 0); -#endif - return(OK); -} - -/*man-start********************************************************************* - - PDC_transform_line() - display a physical line of the screen - - PDCurses Description: - This is a private PDCurses function. - - Updates the given physical line to look like the corresponding - line in _curscr. - - PDCurses Return Value: - This routine returns TRUE if a premature refresh end - is allowed, and there is an input character pending. Otherwise, - FALSE is returned. - - PDCurses Errors: - No errors are defined for this routine. - - Portability: - PDCurses bool PDC_transform_line( int lineno ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_transform_line(register int lineno) -#else -bool PDC_transform_line(lineno) -register int lineno; -#endif -/***********************************************************************/ -{ -register chtype* dstp=NULL; -register chtype* srcp=NULL; - - int x=0; - int endx=0; - int len=0; - extern unsigned char atrtab[MAX_ATRTAB]; - - unsigned short temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ - unsigned short chr=0; - unsigned short* ch=NULL; - - register int j=0; - bool rc=FALSE; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_transform_line() - called: line %d\n",lineno); -#endif - - if (curscr == (WINDOW *)NULL) - return( FALSE ); - - x = curscr->_firstch[lineno]; - endx = curscr->_lastch[lineno]; - dstp = curscr->_y[lineno] + x; - srcp = curscr->_y[lineno] + x; - len = endx-x+1; - - ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */ - -/* replace the attribute part of the chtype with the actual colour value */ -/* replacing the number that points to the actual colour value. */ - - for (j=0;jdirect_video) - { -#ifdef EMXVIDEO - v_putline ((char*)ch, x, lineno, len); -#else - VioWrtCellStr ((PCH)ch, (USHORT)(len*sizeof(unsigned short)), (USHORT)lineno, (USHORT)x, 0); -#endif - } - else - { - for (; x <= endx; x++) - { - PDC_gotoxy(lineno, x); - PDC_putc( (*ch & A_CHARTEXT),(*ch & A_ATTRIBUTES) >> 8 ); - ch++; - } - } - curscr->_firstch[lineno] = _NO_CHANGE; - curscr->_lastch[lineno] = _NO_CHANGE; - - if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) - { - rc = PDC_breakout(); - if(rc) - return(TRUE); - } - return(FALSE); -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#include + +#ifdef HAVE_MEMORY_H +# include +#endif + +#ifndef HAVE_MEMMOVE +# define memmove PDC_memmove +#endif + +#ifdef PDCDEBUG +char *rcsid_PDCdisp = "$Id: pdcdisp.c,v 1.2 2001/01/10 08:29:31 mark Exp $"; +#endif + +/*man-start********************************************************************* + + PDC_clr_update() - Updates the screen with a full redraw. + + PDCurses Description: + Updates the screen by clearing it and then redraw it in its + entirety. If SP->refrbrk is TRUE, and there is pending + input characters, the update will be prematurely terminated. + + PDCurses Return Value: + This routine returns ERR if it is unable to accomplish it's task. + This return value is ONLY under FLEXOS. + + The return value OK is returned if there were no errors. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_clr_update( WINDOW* s ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_clr_update(WINDOW *s) +#else +int PDC_clr_update(s) +WINDOW *s; +#endif +/***********************************************************************/ +{ +register int i=0,j=0; + WINDOW* w=NULL; + unsigned short* ch; + bool rc=FALSE; + + extern unsigned char atrtab[MAX_ATRTAB]; + +/* the next two variables have been changed from chtype to unsigned short */ +/* as this is the correct datatype for a physical character/attribute */ + unsigned short temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ + unsigned short chr; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_clr_update() - called\n"); +#endif + + w = curscr; + if (w == (WINDOW *)NULL) + return( ERR ); +/* if (SP->full_redraw) + PDC_clr_scrn(s); *//* clear physical screen */ + + s->_clear = FALSE; + for (i = 0; i < LINES; i++) /* update physical screen */ + { + if (s != w) /* copy s to curscr */ + memcpy(w->_y[i], s->_y[i], COLS * sizeof(chtype)); + + ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */ + + for (j=0;j_y[i][j] & A_CHARTEXT); + temp_line[j] = chtype_attr(s->_y[i][j]) | chr; + } + + if (SP->direct_video) + { +#ifdef EMXVIDEO + v_putline ((char *)ch, 0, i, COLS); +#else + VioWrtCellStr ((PCH)ch, (USHORT)(COLS * sizeof(unsigned short)), (USHORT)i, 0, 0); +#endif + } + else + { + for (j = 0; j < COLS; j++) + { + PDC_gotoxy(i, j); + PDC_putc( (*ch & A_CHARTEXT), (*ch & A_ATTRIBUTES) >> 8 ); + ch++; + } + } + + if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) + { + rc = PDC_breakout(); + if(rc) + break; + } + w->_firstch[i] = _NO_CHANGE; + w->_lastch[i] = _NO_CHANGE; + } + return( OK ); +} + +/*man-start********************************************************************* + + PDC_cursor_on() - Turns on the hardware cursor. + + PDCurses Description: + Turns on the hardware curses, it does nothing if it is already on. + + PDCurses Return Value: + Returns OK upon success, ERR upon failure. + + Portability: + PDCurses int PDC_cursor_on( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_cursor_on(void) +#else +int PDC_cursor_on() +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_cursor_on() - called\n"); +#endif + + if (!SP->visible_cursor) + { + SP->visible_cursor = TRUE; + PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, + (SP->cursor & 0x00ff)); + } + return( OK ); +} + +/*man-start********************************************************************* + + PDC_cursor_off() - Turns off the hardware cursor. + + PDCurses Description: + Turns off the hardware curses, it does nothing if it is already off. + + PDCurses Return Value: + Returns OK upon success, ERR upon failure. + + PDCurses Errors: + ERR will be returned (in the case of FLEXOS) if the hardware cursor + can not be disabled. + + Portability: + PDCurses int PDC_cursor_off( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_cursor_off(void) +#else +int PDC_cursor_off() +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_cursor_off() - called\n"); +#endif + + if (SP->visible_cursor) + { + SP->visible_cursor = FALSE; + PDC_set_cursor_mode(32, 33); /* turn it off */ + } + return( OK ); +} + +/*man-start********************************************************************* + + PDC_fix_cursor() - Fix the cursor start and stop scan lines (if necessary) + + PDCurses Description: + This is a private PDCurses routine. + + This routine will fix the cursor shape for certain video adapters. + Normally, the values used are correct, but some adapters choke. + The most noticable choke is on a monochrome adapter. The "correct" + scan lines will result in the cursor being set in the middle of the + character cell, rather than at the bottom. + + The passed flag indicates whether the cursor is visible or not. + + This only applies to the DOS platform. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_fix_cursor( int flag ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_fix_cursor(int flag) +#else +int PDC_fix_cursor(flag) +int flag; +#endif +/***********************************************************************/ +{ + return( OK ); +} + +/*man-start********************************************************************* + + PDC_gotoxy() - position hardware cursor at (x, y) + + PDCurses Description: + This is a private PDCurses routine. + + Moves the physical cursor to the desired address on the + screen. We don't optimize here -- on a PC, it takes more time + to optimize than to do things directly. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_gotoxy( int row, int col ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_gotoxy(int row, int col) +#else +int PDC_gotoxy(row,col) +int row; +int col; +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_gotoxy() - called: row %d col %d\n",row,col); +#endif + +#ifdef EMXVIDEO + v_gotoxy (col, row); +#else + VioSetCurPos (row, col, 0); +#endif + return(OK); +} + +/*man-start********************************************************************* + + PDC_putc() - Output a character in the current attribute. + + PDCurses Description: + This is a private PDCurses routine. + + Outputs character 'chr' to screen in tty fashion. If a colour + mode is active, the character is written with colour 'colour'. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_putc( chtype character, chtype color ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_putc( chtype character, chtype color ) +#else +int PDC_putc(character,color) +chtype character; +chtype color; +#endif +/***********************************************************************/ +{ + int curRow=0, curCol=0; +#ifdef EMXVIDEO + char Cell[2]; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_putc() - called:char=%c attrib=0x%x color=0x%x\n",character & A_CHARTEXT,character & A_ATTRIBUTES,color); +#endif + + PDC_get_cursor_pos (&curRow, &curCol); +#ifdef EMXVIDEO + Cell[0] = (char)character; + Cell[1] = (char)color; + v_putline (Cell, curCol, curRow, 1); +#else + VioWrtTTY ((PCH)&character, 1, 0); + VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0); + PDC_gotoxy (curRow, curCol); +#endif + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_putctty() - Output a character and attribute in TTY fashion. + + PDCurses Description: + This is a private PDCurses routine. + + Outputs character 'chr' to screen in tty fashion. If a colour + mode is active, the character is written with colour 'colour'. + + This function moves the physical cursor after writing so the + screen will scroll if necessary. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_putctty( chtype character, chtype color ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_putctty( chtype character, chtype color ) +#else +int PDC_putctty(character,color) +chtype character; +chtype color; +#endif +/***********************************************************************/ +{ + int curRow=0, curCol=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_putctty() - called\n"); +#endif + + PDC_get_cursor_pos (&curRow, &curCol); +#ifdef EMXVIDEO + v_attrib (color); + v_putc (character); +#else + VioWrtTTY ((PCH)&character, 1, 0); + VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0); +#endif + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_scroll() - low level screen scroll + + PDCurses Description: + Scrolls a window in the current page up or down. Urow, lcol, + lrow, rcol are the window coordinates. Lines is the number of + lines to scroll. If 0, clears the window, if < 0 scrolls down, + if > 0 scrolls up. Blanks areas that are left, and sets + character attributes to attr. If in a colour graphics mode, + fills them with the colour 'attr' instead. + + PDCurses Return Value: + The PDC_scroll() function returns OK on success otherwise ERR is returned. + + PDCurses Errors: + An error will only be returned on the Flexos platform if s_copy() + fails. + + Portability: + PDCurses int PDC_scroll( int urow, int lcol, int rcol, + int nlines, chtype attr ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_scroll(int urow, int lcol, int lrow, int rcol, int nlines, chtype attr) +#else +int PDC_scroll(urow,lcol,lrow,rcol,nlines,attr) +int urow; +int lcol; +int lrow; +int rcol; +int nlines; +chtype attr; +#endif +/***********************************************************************/ +{ + extern unsigned char atrtab[MAX_ATRTAB]; + int phys_attr=chtype_attr(attr); +#ifdef FLEXOS + int srow=0; + int scol=0; + int drow=0; + int dcol=0; + int nrows=0; + int ncols=0; + char blank = (char) SP->blank; +#endif + +#ifndef EMXVIDEO + USHORT ch=(phys_attr | SP->blank); +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_scroll() - called: urow %d lcol %d lrow %d rcol %d nlines %d\n",urow,lcol,lrow,rcol,nlines); +#endif + +#ifdef EMXVIDEO + v_attrib (phys_attr); + if (nlines > 0) + v_scroll (lcol, urow, rcol, lrow, nlines, V_SCROLL_UP); + else + if (nlines < 0) + v_scroll (lcol, urow, rcol, lrow, -nlines, V_SCROLL_DOWN); + else /* this clears the whole screen */ + v_scroll (lcol, urow, rcol, lrow, -1, V_SCROLL_CLEAR); +#else + if (nlines > 0) + VioScrollUp(urow, lcol, lrow, rcol, nlines, (PBYTE)&ch, 0); + else + if (nlines < 0) + VioScrollDn(urow, lcol, lrow, rcol, nlines, (PBYTE)&ch, 0); + else +/* this clears the whole screen ?? */ + VioScrollUp(0, 0, -1, -1, -1, (PBYTE)&ch, 0); +#endif + return(OK); +} + +/*man-start********************************************************************* + + PDC_transform_line() - display a physical line of the screen + + PDCurses Description: + This is a private PDCurses function. + + Updates the given physical line to look like the corresponding + line in _curscr. + + PDCurses Return Value: + This routine returns TRUE if a premature refresh end + is allowed, and there is an input character pending. Otherwise, + FALSE is returned. + + PDCurses Errors: + No errors are defined for this routine. + + Portability: + PDCurses bool PDC_transform_line( int lineno ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +bool PDC_transform_line(register int lineno) +#else +bool PDC_transform_line(lineno) +register int lineno; +#endif +/***********************************************************************/ +{ +register chtype* dstp=NULL; +register chtype* srcp=NULL; + + int x=0; + int endx=0; + int len=0; + extern unsigned char atrtab[MAX_ATRTAB]; + + unsigned short temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ + unsigned short chr=0; + unsigned short* ch=NULL; + + register int j=0; + bool rc=FALSE; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_transform_line() - called: line %d\n",lineno); +#endif + + if (curscr == (WINDOW *)NULL) + return( FALSE ); + + x = curscr->_firstch[lineno]; + endx = curscr->_lastch[lineno]; + dstp = curscr->_y[lineno] + x; + srcp = curscr->_y[lineno] + x; + len = endx-x+1; + + ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */ + +/* replace the attribute part of the chtype with the actual colour value */ +/* replacing the number that points to the actual colour value. */ + + for (j=0;jdirect_video) + { +#ifdef EMXVIDEO + v_putline ((char*)ch, x, lineno, len); +#else + VioWrtCellStr ((PCH)ch, (USHORT)(len*sizeof(unsigned short)), (USHORT)lineno, (USHORT)x, 0); +#endif + } + else + { + for (; x <= endx; x++) + { + PDC_gotoxy(lineno, x); + PDC_putc( (*ch & A_CHARTEXT),(*ch & A_ATTRIBUTES) >> 8 ); + ch++; + } + } + curscr->_firstch[lineno] = _NO_CHANGE; + curscr->_lastch[lineno] = _NO_CHANGE; + + if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) + { + rc = PDC_breakout(); + if(rc) + return(TRUE); + } + return(FALSE); +} diff --git a/os2/pdcgetsc.c b/os2/pdcgetsc.c index 34d08bda..c138ed93 100644 --- a/os2/pdcgetsc.c +++ b/os2/pdcgetsc.c @@ -1,554 +1,554 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.1 2001/01/10 08:29:32 mark Exp $"; -#endif - -#if !defined( EMXVIDEO ) - VIOCONFIGINFO configInfo={0}; - VIOMODEINFO modeInfo={0}; -#endif - -/*man-start********************************************************************* - - PDC_get_cursor_pos() - return current cursor position - - PDCurses Description: - This is a private PDCurses function - - Gets the cursor position in video page 0. 'row' and 'column' - are the cursor address. At this time, there is no support for - use of multiple screen pages. - - PDCurses Return Value: - This routine will return OK upon success and otherwise ERR will be - returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_cursor_pos( int* row, int* col ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_cursor_pos(int *row, int *col) -#else -int PDC_get_cursor_pos(row,col) -int *row; -int *col; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cursor_pos() - called\n"); -#endif - -#ifdef EMXVIDEO - v_getxy (col, row); -#else - VioGetCurPos((PUSHORT)row,(PUSHORT)col,0); -#endif - return( OK ); -} - -/*man-start********************************************************************* - - PDC_get_cur_col() - get current column position of cursor - - PDCurses Description: - This is a private PDCurses function - - This routine returns the current column position of the cursor on - screen. - - PDCurses Return Value: - This routine returns the current column position of the cursor. No - error is returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_cur_col( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_cur_col(void) -#else -int PDC_get_cur_col() -#endif -/***********************************************************************/ -{ -#ifdef EMXVIDEO - int curCol=0, curRow=0; -#else - USHORT curCol=0, curRow=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cur_col() - called\n"); -#endif - - /* find the current cursor position */ -#ifdef EMXVIDEO - v_getxy (&curCol, &curRow); -#else - VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0); -#endif - return (curCol); - -} - -/*man-start********************************************************************* - - PDC_get_cur_row() - get current row position of cursor - - PDCurses Description: - This is a private PDCurses function - - This routine returns the current row position of the cursor on - screen. - - PDCurses Return Value: - This routine returns the current row position of the cursor. No - error is returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_cur_row( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_cur_row(void) -#else -int PDC_get_cur_row() -#endif -/***********************************************************************/ -{ -#ifdef EMXVIDEO - int curCol=0, curRow=0; -#else - USHORT curCol=0, curRow=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cur_row() - called\n"); -#endif - - /* find the current cursor position */ -#ifdef EMXVIDEO - v_getxy (&curCol, &curRow); -#else - VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0); -#endif - return (curRow); - -} - -/*man-start********************************************************************* - - PDC_get_attribute() - Get attribute at current cursor - - PDCurses Description: - This is a private PDCurses function - - Return the current attr at current cursor position on the screen. - - PDCurses Return Value: - This routine will return OK upon success and otherwise ERR will be - returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_attribute( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_attribute(void) -#else -int PDC_get_attribute() -#endif -/***********************************************************************/ -{ -#ifndef EMXVIDEO - USHORT cellLen = 2; -#endif - int curRow=0, curCol=0; - char Cell[4]; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_attribute() - called\n"); -#endif - - PDC_get_cursor_pos(&curRow, &curCol); -#ifdef EMXVIDEO - v_getline (Cell, curCol, curRow, 1); -#else - VioReadCellStr((PCH)&Cell, (PUSHORT)&cellLen, (USHORT)curRow, (USHORT)curCol, 0); -#endif - return ((int) Cell[1]); - -} - -/*man-start********************************************************************* - - PDC_get_columns() - return width of screen/viewport. - - PDCurses Description: - This is a private PDCurses function - - This function will return the width of the current screen. - - PDCurses Return Value: - This routine will return OK upon success and otherwise ERR will be - returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_columns( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_columns(void) -#else -int PDC_get_columns() -#endif -/***********************************************************************/ -{ -#ifdef EMXVIDEO - int rows=0; -#else - VIOMODEINFO modeInfo={0}; -#endif - int cols=0; - char *env_cols=NULL; - - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_columns() - called\n"); -#endif - -#ifdef EMXVIDEO - v_dimen (&cols, &rows); -#else - modeInfo.cb = sizeof(modeInfo); - VioGetMode(&modeInfo, 0); - cols = modeInfo.col; -#endif - - env_cols = (char *)getenv("COLS"); - if (env_cols != (char *)NULL) - { - cols = min(atoi(env_cols),cols); - } -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_columns() - returned: cols %d\n",cols); -#endif - return(cols); - -} - -/*man-start********************************************************************* - - PDC_get_cursor_mode() - Get the cursor start and stop scan lines. - - PDCurses Description: - Gets the cursor type to begin in scan line startrow and end in - scan line endrow. Both values should be 0-31. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_cursor_mode( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_cursor_mode(void) -#else -int PDC_get_cursor_mode() -#endif -/***********************************************************************/ -{ -#ifdef EMXVIDEO - int curstart=0, curend=0; -#else - VIOCURSORINFO cursorInfo; -#endif - short cmode=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cursor_mode() - called\n"); -#endif - -#ifdef EMXVIDEO - v_getctype (&curstart, &curend); - cmode = ((curstart << 8) | (curend)); -#else - VioGetCurType (&cursorInfo, 0); -/* I am not sure about this JGB */ - cmode = ((cursorInfo.yStart << 8) | (cursorInfo.cEnd)); -#endif - return(cmode); - -} - -/*man-start********************************************************************* - - PDC_get_font() - Get the current font size - - PDCurses Description: - This is a private PDCurses routine. - - This function returns the current font size. This function only - works if the #define FAST_VIDEO is true. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - An ERR will be returned if FAST_VIDEO is not true. - - Portability: - PDCurses int PDC_get_font( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_font(void) -#else -int PDC_get_font() -#endif -/***********************************************************************/ -{ -#ifdef EMXVIDEO - int retval=0; -#else - VIOMODEINFO modeInfo={0}; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_font() - called\n"); -#endif - -#ifdef EMXVIDEO - retval = v_hardware(); - return (retval == V_MONOCHROME) ? 14 : (retval == V_COLOR_8) ? 8 : 12; -#else - modeInfo.cb = sizeof(modeInfo); - /* set most parameters of modeInfo */ - VioGetMode(&modeInfo, 0); - return ( modeInfo.vres / modeInfo.row); -#endif -} - -/*man-start********************************************************************* - - PDC_get_rows() - Return number of screen rows. - - PDCurses Description: - This is a private PDCurses routine. - - Returns the maximum number of rows supported by the display. - e.g. 25, 28, 43, 50, 60, 66... - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_rows( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_rows(void) -#else -int PDC_get_rows() -#endif -/***********************************************************************/ -{ - -#ifdef EMXVIDEO - int cols=0; -#else - VIOMODEINFO modeInfo={0}; -#endif - int rows=0; - char *env_rows=NULL; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_rows() - called\n"); -#endif - -/* use the value from LINES environment variable, if set. MH 10-Jun-92 */ -/* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */ -#ifdef EMXVIDEO - v_dimen (&cols, &rows); -#else - modeInfo.cb = sizeof(modeInfo); - VioGetMode(&modeInfo, 0); - rows = modeInfo.row; -#endif - env_rows = (char *)getenv("LINES"); - if (env_rows != (char *)NULL) - rows = min(atoi(env_rows),rows); -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_rows() - returned: rows %d\n",rows); -#endif - return(rows); - -} - -/*man-start********************************************************************* - - PDC_get_scrn_mode() - Return the current BIOS video mode - - PDCurses Description: - This is a private PDCurses routine. - - - PDCurses Return Value: - Returns the current BIOS Video Mode Number. - - PDCurses Errors: - The FLEXOS version of this routine returns an ERR. - The UNIX version of this routine returns an ERR. - The EMXVIDEO version of this routine returns an ERR. - - Portability: - PDCurses int PDC_get_scrn_mode( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_scrn_mode(void) -#else -int PDC_get_scrn_mode() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_scrn_mode() - called\n"); -#endif - -#ifdef EMXVIDEO - return(ERR); -#else - VioGetMode (&modeInfo, 0); - return(OK); -#endif - -} - -/*man-start********************************************************************* - - PDC_query_adapter_type() - Determine PC video adapter type - - PDCurses Description: - This is a private PDCurses routine. - - Thanks to Jeff Duntemann, K16RA for providing the impetus - (through the Dr. Dobbs Journal, March 1989 issue) for getting - the routines below merged into Bjorn Larsson's PDCurses 1.3... - -- frotz@dri.com 900730 - - PDCurses Return Value: - This function returns a macro identifier indicating the adapter - type. See the list of adapter types in CURSPRIV.H. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_query_adapter_type( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_query_adapter_type(void) -#else -int PDC_query_adapter_type() -#endif -/***********************************************************************/ -{ - int retval = _NONE; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_query_adapter_type() - called\n"); -#endif - -#ifdef EMXVIDEO - SP->adapter = v_hardware(); - if (SP->adapter == V_MONOCHROME) - { - SP->mono = TRUE; - retval = _UNIX_MONO; - } - else - { - SP->mono = FALSE; - retval = _UNIX_COLOR; - } - SP->sizeable = TRUE; - SP->bogus_adapter = FALSE; - return(retval); -#else - VioGetConfig(0, &configInfo, 0); - SP->sizeable = TRUE; - return(OK); -#endif - -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#ifdef PDCDEBUG +char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.2 2001/01/10 08:29:33 mark Exp $"; +#endif + +#if !defined( EMXVIDEO ) + VIOCONFIGINFO configInfo={0}; + VIOMODEINFO modeInfo={0}; +#endif + +/*man-start********************************************************************* + + PDC_get_cursor_pos() - return current cursor position + + PDCurses Description: + This is a private PDCurses function + + Gets the cursor position in video page 0. 'row' and 'column' + are the cursor address. At this time, there is no support for + use of multiple screen pages. + + PDCurses Return Value: + This routine will return OK upon success and otherwise ERR will be + returned. + + PDCurses Errors: + There are no defined errors for this routine. + + Portability: + PDCurses int PDC_get_cursor_pos( int* row, int* col ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_cursor_pos(int *row, int *col) +#else +int PDC_get_cursor_pos(row,col) +int *row; +int *col; +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_cursor_pos() - called\n"); +#endif + +#ifdef EMXVIDEO + v_getxy (col, row); +#else + VioGetCurPos((PUSHORT)row,(PUSHORT)col,0); +#endif + return( OK ); +} + +/*man-start********************************************************************* + + PDC_get_cur_col() - get current column position of cursor + + PDCurses Description: + This is a private PDCurses function + + This routine returns the current column position of the cursor on + screen. + + PDCurses Return Value: + This routine returns the current column position of the cursor. No + error is returned. + + PDCurses Errors: + There are no defined errors for this routine. + + Portability: + PDCurses int PDC_get_cur_col( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_cur_col(void) +#else +int PDC_get_cur_col() +#endif +/***********************************************************************/ +{ +#ifdef EMXVIDEO + int curCol=0, curRow=0; +#else + USHORT curCol=0, curRow=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_cur_col() - called\n"); +#endif + + /* find the current cursor position */ +#ifdef EMXVIDEO + v_getxy (&curCol, &curRow); +#else + VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0); +#endif + return (curCol); + +} + +/*man-start********************************************************************* + + PDC_get_cur_row() - get current row position of cursor + + PDCurses Description: + This is a private PDCurses function + + This routine returns the current row position of the cursor on + screen. + + PDCurses Return Value: + This routine returns the current row position of the cursor. No + error is returned. + + PDCurses Errors: + There are no defined errors for this routine. + + Portability: + PDCurses int PDC_get_cur_row( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_cur_row(void) +#else +int PDC_get_cur_row() +#endif +/***********************************************************************/ +{ +#ifdef EMXVIDEO + int curCol=0, curRow=0; +#else + USHORT curCol=0, curRow=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_cur_row() - called\n"); +#endif + + /* find the current cursor position */ +#ifdef EMXVIDEO + v_getxy (&curCol, &curRow); +#else + VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0); +#endif + return (curRow); + +} + +/*man-start********************************************************************* + + PDC_get_attribute() - Get attribute at current cursor + + PDCurses Description: + This is a private PDCurses function + + Return the current attr at current cursor position on the screen. + + PDCurses Return Value: + This routine will return OK upon success and otherwise ERR will be + returned. + + PDCurses Errors: + There are no defined errors for this routine. + + Portability: + PDCurses int PDC_get_attribute( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_attribute(void) +#else +int PDC_get_attribute() +#endif +/***********************************************************************/ +{ +#ifndef EMXVIDEO + USHORT cellLen = 2; +#endif + int curRow=0, curCol=0; + char Cell[4]; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_attribute() - called\n"); +#endif + + PDC_get_cursor_pos(&curRow, &curCol); +#ifdef EMXVIDEO + v_getline (Cell, curCol, curRow, 1); +#else + VioReadCellStr((PCH)&Cell, (PUSHORT)&cellLen, (USHORT)curRow, (USHORT)curCol, 0); +#endif + return ((int) Cell[1]); + +} + +/*man-start********************************************************************* + + PDC_get_columns() - return width of screen/viewport. + + PDCurses Description: + This is a private PDCurses function + + This function will return the width of the current screen. + + PDCurses Return Value: + This routine will return OK upon success and otherwise ERR will be + returned. + + PDCurses Errors: + There are no defined errors for this routine. + + Portability: + PDCurses int PDC_get_columns( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_columns(void) +#else +int PDC_get_columns() +#endif +/***********************************************************************/ +{ +#ifdef EMXVIDEO + int rows=0; +#else + VIOMODEINFO modeInfo={0}; +#endif + int cols=0; + char *env_cols=NULL; + + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_columns() - called\n"); +#endif + +#ifdef EMXVIDEO + v_dimen (&cols, &rows); +#else + modeInfo.cb = sizeof(modeInfo); + VioGetMode(&modeInfo, 0); + cols = modeInfo.col; +#endif + + env_cols = (char *)getenv("COLS"); + if (env_cols != (char *)NULL) + { + cols = min(atoi(env_cols),cols); + } +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_columns() - returned: cols %d\n",cols); +#endif + return(cols); + +} + +/*man-start********************************************************************* + + PDC_get_cursor_mode() - Get the cursor start and stop scan lines. + + PDCurses Description: + Gets the cursor type to begin in scan line startrow and end in + scan line endrow. Both values should be 0-31. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_get_cursor_mode( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_cursor_mode(void) +#else +int PDC_get_cursor_mode() +#endif +/***********************************************************************/ +{ +#ifdef EMXVIDEO + int curstart=0, curend=0; +#else + VIOCURSORINFO cursorInfo; +#endif + short cmode=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_cursor_mode() - called\n"); +#endif + +#ifdef EMXVIDEO + v_getctype (&curstart, &curend); + cmode = ((curstart << 8) | (curend)); +#else + VioGetCurType (&cursorInfo, 0); +/* I am not sure about this JGB */ + cmode = ((cursorInfo.yStart << 8) | (cursorInfo.cEnd)); +#endif + return(cmode); + +} + +/*man-start********************************************************************* + + PDC_get_font() - Get the current font size + + PDCurses Description: + This is a private PDCurses routine. + + This function returns the current font size. This function only + works if the #define FAST_VIDEO is true. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + An ERR will be returned if FAST_VIDEO is not true. + + Portability: + PDCurses int PDC_get_font( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_font(void) +#else +int PDC_get_font() +#endif +/***********************************************************************/ +{ +#ifdef EMXVIDEO + int retval=0; +#else + VIOMODEINFO modeInfo={0}; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_font() - called\n"); +#endif + +#ifdef EMXVIDEO + retval = v_hardware(); + return (retval == V_MONOCHROME) ? 14 : (retval == V_COLOR_8) ? 8 : 12; +#else + modeInfo.cb = sizeof(modeInfo); + /* set most parameters of modeInfo */ + VioGetMode(&modeInfo, 0); + return ( modeInfo.vres / modeInfo.row); +#endif +} + +/*man-start********************************************************************* + + PDC_get_rows() - Return number of screen rows. + + PDCurses Description: + This is a private PDCurses routine. + + Returns the maximum number of rows supported by the display. + e.g. 25, 28, 43, 50, 60, 66... + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_get_rows( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_rows(void) +#else +int PDC_get_rows() +#endif +/***********************************************************************/ +{ + +#ifdef EMXVIDEO + int cols=0; +#else + VIOMODEINFO modeInfo={0}; +#endif + int rows=0; + char *env_rows=NULL; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_rows() - called\n"); +#endif + +/* use the value from LINES environment variable, if set. MH 10-Jun-92 */ +/* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */ +#ifdef EMXVIDEO + v_dimen (&cols, &rows); +#else + modeInfo.cb = sizeof(modeInfo); + VioGetMode(&modeInfo, 0); + rows = modeInfo.row; +#endif + env_rows = (char *)getenv("LINES"); + if (env_rows != (char *)NULL) + rows = min(atoi(env_rows),rows); +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_rows() - returned: rows %d\n",rows); +#endif + return(rows); + +} + +/*man-start********************************************************************* + + PDC_get_scrn_mode() - Return the current BIOS video mode + + PDCurses Description: + This is a private PDCurses routine. + + + PDCurses Return Value: + Returns the current BIOS Video Mode Number. + + PDCurses Errors: + The FLEXOS version of this routine returns an ERR. + The UNIX version of this routine returns an ERR. + The EMXVIDEO version of this routine returns an ERR. + + Portability: + PDCurses int PDC_get_scrn_mode( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_scrn_mode(void) +#else +int PDC_get_scrn_mode() +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_scrn_mode() - called\n"); +#endif + +#ifdef EMXVIDEO + return(ERR); +#else + VioGetMode (&modeInfo, 0); + return(OK); +#endif + +} + +/*man-start********************************************************************* + + PDC_query_adapter_type() - Determine PC video adapter type + + PDCurses Description: + This is a private PDCurses routine. + + Thanks to Jeff Duntemann, K16RA for providing the impetus + (through the Dr. Dobbs Journal, March 1989 issue) for getting + the routines below merged into Bjorn Larsson's PDCurses 1.3... + -- frotz@dri.com 900730 + + PDCurses Return Value: + This function returns a macro identifier indicating the adapter + type. See the list of adapter types in CURSPRIV.H. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_query_adapter_type( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_query_adapter_type(void) +#else +int PDC_query_adapter_type() +#endif +/***********************************************************************/ +{ + int retval = _NONE; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_query_adapter_type() - called\n"); +#endif + +#ifdef EMXVIDEO + SP->adapter = v_hardware(); + if (SP->adapter == V_MONOCHROME) + { + SP->mono = TRUE; + retval = _UNIX_MONO; + } + else + { + SP->mono = FALSE; + retval = _UNIX_COLOR; + } + SP->sizeable = TRUE; + SP->bogus_adapter = FALSE; + return(retval); +#else + VioGetConfig(0, &configInfo, 0); + SP->sizeable = TRUE; + return(OK); +#endif + +} diff --git a/os2/pdckbd.c b/os2/pdckbd.c index f0c0be14..abb69f48 100644 --- a/os2/pdckbd.c +++ b/os2/pdckbd.c @@ -1,728 +1,728 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ - -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#if defined (CURSES__32BIT__) || defined(CSET2) || defined(TC) -# include -#else -# define INCL_DOSSIGNALS -# define INCL_NOCOMMON -# include -#endif - -#ifdef PDCDEBUG -char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.1 2001/01/10 08:29:34 mark Exp $"; -#endif - -/******************************************************************************* -* Table for key code translation of function keys in keypad mode -* These values are for strict IBM keyboard compatibles only -*******************************************************************************/ - - -static int kptab[] = -{ - /* Normal Function Keys */ - 0x3b, KEY_F(1), 0x3c, KEY_F(2), 0x3d, KEY_F(3), 0x3e, KEY_F(4), - 0x3f, KEY_F(5), 0x40, KEY_F(6), 0x41, KEY_F(7), 0x42, KEY_F(8), - 0x43, KEY_F(9), 0x44, KEY_F(10), - - /* Normal Keypad */ - 0x47, KEY_HOME, 0x48, KEY_UP, 0x49, KEY_PPAGE, - 0x4b, KEY_LEFT, 0x4c, KEY_B2, 0x4d, KEY_RIGHT, - 0x4f, KEY_END, 0x50, KEY_DOWN, 0x51, KEY_NPAGE, - 0x52, KEY_IC, 0x53, KEY_DC, - - /* Shft-Function Keys */ - 0x54, KEY_F(13), 0x55, KEY_F(14), 0x56, KEY_F(15), 0x57, KEY_F(16), - 0x58, KEY_F(17), 0x59, KEY_F(18), 0x5a, KEY_F(19), 0x5b, KEY_F(20), - 0x5c, KEY_F(21), 0x5d, KEY_F(22), - - /* Ctl-Function Keys */ - 0x5e, KEY_F(25), 0x5f, KEY_F(26), 0x60, KEY_F(27), 0x61, KEY_F(28), - 0x62, KEY_F(29), 0x63, KEY_F(30), 0x64, KEY_F(31), 0x65, KEY_F(32), - 0x66, KEY_F(33), 0x67, KEY_F(34), - - /* Alt-Function Keys */ - 0x68, KEY_F(37), 0x69, KEY_F(38), 0x6a, KEY_F(39), 0x6b, KEY_F(40), - 0x6c, KEY_F(41), 0x6d, KEY_F(42), 0x6e, KEY_F(43), 0x6f, KEY_F(44), - 0x70, KEY_F(45), 0x71, KEY_F(46), - - /* Control-Keypad */ - 0x77, CTL_HOME, 0x84, CTL_PGUP, - 0x73, CTL_LEFT, 0x74, CTL_RIGHT, - 0x75, CTL_END, 0x76, CTL_PGDN, - - /* Alt-Numbers */ - 0x78, ALT_1, 0x79, ALT_2, 0x7a, ALT_3, 0x7b, ALT_4, - 0x7c, ALT_5, 0x7d, ALT_6, 0x7e, ALT_7, 0x7f, ALT_8, - 0x80, ALT_9, 0x81, ALT_0, - - /* Extended codes */ - 0x85, KEY_F(11), 0x86, KEY_F(12), 0x87, KEY_F(23), 0x88, KEY_F(24), - 0x89, KEY_F(35), 0x8a, KEY_F(36), 0x8b, KEY_F(47), 0x8c, KEY_F(48), - 0x03, 0, /* NULL */ - -#if defined(NUMKEYPAD) - 0xff, (int)'/', 0x0d, (int)'\n', - 0xfa, (int)'*', 0xfd, (int)'-', 0xfb, (int)'+', -#else - 0xff, PADSLASH, 0x0d, PADENTER, - 0xfa, PADSTAR, 0xfd, PADMINUS, 0xfb, PADPLUS, -#endif - - 0x0a, CTL_PADENTER, - 0xa6, ALT_PADENTER, 0x53, (int)'.', 0xfc, CTL_ENTER, - 0x93, CTL_DEL, 0x8f, CTL_PADCENTER, 0x90, CTL_PADPLUS, - 0x8e, CTL_PADMINUS, 0x95, CTL_PADSLASH, 0x96, CTL_PADSTAR, - 0x4e, ALT_PADPLUS, 0x4a, ALT_PADMINUS, 0xa4, ALT_PADSLASH, - 0x37, ALT_PADSTAR, 0x92, CTL_INS, 0xa2, ALT_INS, - 0xa3, ALT_DEL, 0x8d, CTL_UP, 0x91, CTL_DOWN, - 0x94, CTL_TAB, 0xa5, ALT_TAB, 0x82, ALT_MINUS, - 0x83, ALT_EQUAL, 0x99, ALT_PGUP, 0xa1, ALT_PGDN, - 0x9f, ALT_END, 0x98, ALT_UP, 0xa0, ALT_DOWN, - 0x9d, ALT_RIGHT, 0x9b, ALT_LEFT, 0x1c, ALT_ENTER, - 0x97, ALT_HOME, 0x01, ALT_ESC, 0x0e, ALT_BKSP, - 0x29, ALT_BQUOTE, 0x1a, ALT_LBRACKET, 0x1b, ALT_RBRACKET, - 0x27, ALT_SEMICOLON,0x28, ALT_FQUOTE, 0x33, ALT_COMMA, - 0x34, ALT_STOP, 0x35, ALT_FSLASH, 0x2b, ALT_BSLASH, - - /* Alt-Alphabet */ - 0x1e, ALT_A, 0x30, ALT_B, 0x2e, ALT_C, 0x20, ALT_D, - 0x12, ALT_E, 0x21, ALT_F, 0x22, ALT_G, 0x23, ALT_H, - 0x17, ALT_I, 0x24, ALT_J, 0x25, ALT_K, 0x26, ALT_L, - 0x32, ALT_M, 0x31, ALT_N, 0x18, ALT_O, 0x19, ALT_P, - 0x10, ALT_Q, 0x13, ALT_R, 0x1f, ALT_S, 0x14, ALT_T, - 0x16, ALT_U, 0x2f, ALT_V, 0x11, ALT_W, 0x2d, ALT_X, - 0x15, ALT_Y, 0x2c, ALT_Z, - 0x0f, KEY_BTAB, - 0x100, (-1) -}; - /* End of kptab[] */ - -static unsigned long pdc_key_modifiers=0L; -MOUSE_STATUS Trapped_Mouse_status; - -/*man-start********************************************************************* - - PDC_breakout() - check for type-ahead - - X/Open Description: - The curses package does the "line-breakout optimisation" by - looking for type-ahead periodically while updating the screen. - If input is found, the current update will be postponed until - refresh() or doupdate() are called again. This allows faster - response to commands typed in advance. Normally, the input FILE - pointer passed to newterm(), or stdin in the case when initscr() - was called, will be used to do this type-ahead checking. This routine - will do the actual check for PDcurses to see if input is pending. - - PDCurses Description: - This routine does what the PDcurses typeahead routine used to do. But - to make that routine consistent with its System V counterpart, all it - does now is set whether or not typeahead checking is performed. - - X/Open Return Value: - The PDC_breakout() routine returns TRUE if keyboard input is pending - otherwise FALSE is returned. - - Portability: - PDCurses bool PD_breakout( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_breakout( void ) -#else -bool PDC_breakout() -#endif -/***********************************************************************/ -{ -extern int c_pindex; /* putter index */ -extern int c_gindex; /* getter index */ -extern int c_ungind; /* wungetch() push index */ -#ifdef TC -# pragma argsused -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_breakout() - called\n"); -#endif - - if (c_ungind) - return (TRUE); /* ungotten char */ - if (c_pindex > c_gindex) - return (TRUE); /* buffered char */ - if (SP->raw_inp) - return((bool)PDC_check_bios_key());/* raw mode test */ - - return((bool)PDC_check_bios_key()); /* normal mode test */ -} - -/*man-start********************************************************************* - - PDC_get_input_fd() - Get file descriptor used for PDCurses input - - PDCurses Description: - This is a private PDCurses routine. - - This routine will return the file descriptor that PDCurses reads - its input from. It can be used for select(). - - PDCurses Return Value: - Returns a file descriptor. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_input_fd( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_input_fd(void) -#else -int PDC_get_input_fd() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_input_fd() - called\n"); -#endif - - return fileno(stdin); -} - -/*man-start********************************************************************* - - PDC_check_bios_key() - Check BIOS key data area for input - - PDCurses Description: - This is a private PDCurses routine. - - This routine will check the BIOS for any indication that - keystrokes are pending. - - PDCurses Return Value: - Returns 1 if a keyboard character is available, 0 otherwise. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses bool PDC_check_bios_key( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_check_bios_key(void) -#else -bool PDC_check_bios_key() -#endif -/***********************************************************************/ -{ -#if !defined(MSC) && !defined(EMXVIDEO) - KBDKEYINFO keyInfo={0}; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_check_bios_key() - called\n"); -#endif - -#ifdef EMXVIDEO - if (SP->tahead == -1) /* Nothing typed yet */ - { /* See if there's anything */ - SP->tahead = _read_kbd (0, 0, 0); - if (SP->tahead == 0) /* Read additional */ - SP->tahead = (_read_kbd (0, 1, 0) << 8); - } - return(SP->tahead != -1) ? 1 : 0; -#else -# if !defined(MSC) -/* KbdCharIn(&keyInfo, IO_NOWAIT, 0);*/ /* get a character */ - KbdPeek(&keyInfo, 0); /* peek at keyboard */ - return (keyInfo.fbStatus != 0); -# else - return(kbhit()); -# endif -#endif - -} - -/*man-start********************************************************************* - - PDC_get_bios_key() - Returns the next key available from the BIOS. - - PDCurses Description: - This is a private PDCurses routine. - - Returns the next key code struck at the keyboard. If the low 8 - bits are 0, the upper bits contain the extended character - code. If bit 0-7 are non-zero, the upper bits = 0. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_bios_key( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_bios_key(void) -#else -int PDC_get_bios_key() -#endif -/***********************************************************************/ -{ - int ascii=0,scan=0; -#ifndef EMXVIDEO - KBDKEYINFO keyInfo={0}; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_bios_key() - called\n"); -#endif - -#ifdef EMXVIDEO - if (SP->tahead == -1) - { - SP->tahead = _read_kbd (0, 1, 0); - if (SP->tahead == 0) /* Read additional */ - SP->tahead = (_read_kbd (0, 1, 0) << 8); - } - ascii = SP->tahead & 0xff; - scan = SP->tahead >> 8; - pdc_key_modifiers = 0L; - SP->tahead = -1; -#else - KbdCharIn(&keyInfo, IO_WAIT, 0); /* get a character */ - ascii = keyInfo.chChar; - scan = keyInfo.chScan; - pdc_key_modifiers = 0L; - if (SP->save_key_modifiers) - { - if (keyInfo.fsState & KBDSTF_ALT) - pdc_key_modifiers |= PDC_KEY_MODIFIER_ALT; - if (keyInfo.fsState & KBDSTF_CONTROL) - pdc_key_modifiers |= PDC_KEY_MODIFIER_CONTROL; - if (keyInfo.fsState & KBDSTF_NUMLOCK_ON) - pdc_key_modifiers |= PDC_KEY_MODIFIER_NUMLOCK; - if (keyInfo.fsState & KBDSTF_LEFTSHIFT - || keyInfo.fsState & KBDSTF_RIGHTSHIFT) - pdc_key_modifiers |= PDC_KEY_MODIFIER_SHIFT; - } -#endif - - if (scan == 0x1c && ascii == 0x0a) /* ^Enter */ - return ((int) (0xfc00)); - if ((scan == 0x03 && ascii == 0x00) /* ^@ - Null */ - || (scan == 0xe0 && ascii == 0x0d) /* PadEnter */ - || (scan == 0xe0 && ascii == 0x0a)) /* ^PadEnter */ - return ((int) (ascii << 8)); - if ((scan == 0x37 && ascii == 0x2a) /* Star */ - || (scan == 0x4a && ascii == 0x2d) /* Minus */ - || (scan == 0x4e && ascii == 0x2b) /* Plus */ - || (scan == 0xe0 && ascii == 0x2f)) /* Slash */ - return ((int) ((ascii & 0x0f) | 0xf0) << 8); - if (ascii == 0x00 || ascii == 0xe0) - return ((int) (scan << 8)); - return ((int) (ascii)); -} - -/*man-start********************************************************************* - - PDC_get_ctrl_break() - return OS control break state - - PDCurses Description: - This is a private PDCurses routine. - - Returns the current OS Control Break Check state. - - PDCurses Return Value: - DOS: - This function returns TRUE on if the Control Break - Check is enabled otherwise FALSE is returned. - - FLEXOS: - This function returns TRUE on if the Keyboard Mode - allows a break to bre reported otherwise FALSE is returned. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses bool PDC_get_ctrl_break( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_get_ctrl_break(void) -#else -bool PDC_get_ctrl_break() -#endif -/***********************************************************************/ -{ -#if defined(CURSES__32BIT__) || defined(CSET2) || defined(TC) -# if defined(TC) - void __cdecl (*oldAction) (int); -# else - void (*oldAction) (int); -# endif -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_ctrl_break() - called\n"); -#endif - -#if defined(CURSES__32BIT__) || defined(CSET2) || defined(TC) - oldAction = signal (SIGINT, SIG_DFL); - if (oldAction == SIG_ERR) return FALSE; - else signal (SIGINT, oldAction); - return (oldAction != SIG_IGN); -#else - PFNSIGHANDLER oldHandler, oldHandler1; - USHORT oldAction, oldAction1; - /* get the current state, and set to ignore */ - DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction, - SIGA_IGNORE, SIG_CTRLBREAK); - /* restore the previous state */ - DosSetSigHandler(oldHandler, &oldHandler1, &oldAction1, - oldAction, SIG_CTRLBREAK); - return(oldAction != SIGA_IGNORE); -#endif -} - -/*man-start********************************************************************* - - PDC_rawgetch() - Returns the next uninterpreted character (if available). - - PDCurses Description: - Gets a character without any interpretation at all and returns - it. If keypad mode is active for the designated window, - function key translation will be performed. Otherwise, - function keys are ignored. If nodelay mode is active in the - window, then PDC_rawgetch() returns -1 if no character is - available. - - WARNING: It is unknown whether the FUNCTION key translation - is performed at this level. --Frotz 911130 BUG - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_rawgetch( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_rawgetch(void) -#else -int PDC_rawgetch() -#endif -/***********************************************************************/ -{ -extern WINDOW* _getch_win_; -/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ - /* is the same window - all references to w changed*/ - /* to _getch_win_ - marked with @@ */ - - int c=0; - int oldc=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_rawgetch() - called\n"); -#endif - - if (_getch_win_ == (WINDOW *)NULL) /* @@ */ - return( -1 ); - - if (_getch_win_->_nodelay && !PDC_breakout()) /* @@ */ - return( -1 ); - - while (1) /* loop to get valid char */ - { - c = PDC_get_bios_key(); - oldc = c; - /* - * Return the key if it is not a special key. - */ - if ((c = PDC_validchar(c)) >= 0) - { /* get & check next char */ - return( c ); - } - if (_getch_win_->_use_keypad) - return( oldc ); - } -} - -/*man-start********************************************************************* - - PDC_set_ctrl_break() - Enables/Disables the host OS BREAK key check. - - PDCurses Description: - This is a private PDCurses routine. - - Enables/Disables the host OS BREAK key check. If the supplied setting - is TRUE, this enables CTRL/C and CTRL/BREAK to abort the process. - If FALSE, CTRL/C and CTRL/BREAK are ignored. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_set_ctrl_break( bool setting ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_ctrl_break(bool setting) -#else -int PDC_set_ctrl_break(setting) -bool setting; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_ctrl_break() - called\n"); -#endif - -#if defined (CURSES__32BIT__) || defined (CSET2) || defined(TC) - signal (SIGINT, (setting?SIG_DFL:SIG_IGN)); - signal (SIGBREAK, (setting?SIG_DFL:SIG_IGN)); - return( OK ); -#else - PFNSIGHANDLER oldHandler; - USHORT oldAction, Action; - - /* turn off control C checking */ - if (setting) - Action = SIGA_KILL; - else - Action = SIGA_IGNORE; - DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction, - Action, SIG_CTRLBREAK); - DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction, - Action, SIG_CTRLC); - return( OK ); -#endif - -} - -/*man-start********************************************************************* - - PDC_sysgetch() - Return a character using default system routines. - - PDCurses Description: - This is a private PDCurses function. - - Gets a character without normal ^S, ^Q, ^P and ^C interpretation - and returns it. If keypad mode is active for the designated - window, function key translation will be performed. Otherwise, - function keys are ignored. If nodelay mode is active in the - window, then sysgetch() returns -1 if no character is - available. - - PDCurses Return Value: - This function returns OK upon success otherwise ERR is returned. - - PDCurses Errors: - No errors are defined for this routine. - - Portability: - PDCurses int PDC_sysgetch( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_sysgetch(void) -#else -int PDC_sysgetch() -#endif -/***********************************************************************/ -{ -extern WINDOW* _getch_win_; -/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ - /* is the same window - all references to w changed*/ - /* to _getch_win_ - marked with @@ */ - - int c=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_sysgetch() - called\n"); -#endif - - if (_getch_win_ == (WINDOW *)NULL) /* @@ */ - return (-1); - - if (_getch_win_->_nodelay && !PDC_breakout()) - return (-1); - - while (1) - { - c = PDC_get_bios_key(); - /* - * Return the key if it is not a special key. - */ - if ((unsigned int)c < 256) - return(c); - if ((c = PDC_validchar(c)) >= 0) - { - return (c); /* get & check next char */ - } - } -} - -/*man-start********************************************************************* - - PDC_validchar() - validate/translate passed character - - PDCurses Description: - This is a private PDCurses function. - - Checks that 'c' is a valid character, and if so returns it, - with function key translation applied if 'w' has keypad mode - set. If char is invalid, returns -1. - - PDCurses Return Value: - This function returns -1 if the passed character is invalid, or - the WINDOW* 'w' is NULL, or 'w's keypad is not active. - - This function returns 0 under Flexos if the passed character - is 0x0300. (-:Forget why. --Frotz 911130:-) - - Otherwise, this function returns the PDCurses equivalent of the - passed character. See the function key and key macros in - - - PDCurses Errors: - There are no errors defined for this routine. - - Portability: - PDCurses int PDC_validchar( int c ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_validchar(int c) -#else -int PDC_validchar(c) -int c; -#endif -/***********************************************************************/ -{ -extern WINDOW* _getch_win_; -/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ - /* is the same window - all references to w changed*/ - /* to _getch_win_ - marked with @@ */ - - int *scanp=NULL; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_validchar() - called\n"); -#endif - - if (_getch_win_ == (WINDOW *)NULL) - return (-1); /* bad window pointer */ - - if ((unsigned int)c < 256) return (c); /* normal character */ - if (!(_getch_win_->_use_keypad)) return (-1); /* skip if keys if !keypad mode */ - - /* - * Under DOS, extended keys are in the upper byte. Shift down for a - * comparison. - */ - c = (c >> 8) & 0xFF; - - scanp = kptab; - while (*scanp > 0) /* search for value */ - { /* (stops on table entry 0x100) */ - if (*scanp++ == c) - { - return (*scanp); /* found, return it */ - } - scanp++; - } - return( -1 ); /* not found, invalid */ -} - -/*man-start********************************************************************* - - PDC_get_key_modifiers() - Returns the keyboard modifier(s) at time of last getch() - - PDCurses Description: - This is a private PDCurses routine. - - Returns the keyboard modifiers effective at the time of the last getch() - call only if PDC_save_key_modifiers(TRUE) has been called before the - getch(); - Use the macros; PDC_KEY_MODIFIER_* to determine which modifier(s) - were set. - - PDCurses Return Value: - This function returns the modifiers. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_key_modifiers( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -unsigned long PDC_get_key_modifiers(void) -#else -unsigned long PDC_get_key_modifiers() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_key_modifiers() - called\n"); -#endif - return(pdc_key_modifiers); -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ + +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#if defined (CURSES__32BIT__) || defined(CSET2) || defined(TC) +# include +#else +# define INCL_DOSSIGNALS +# define INCL_NOCOMMON +# include +#endif + +#ifdef PDCDEBUG +char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.2 2001/01/10 08:29:36 mark Exp $"; +#endif + +/******************************************************************************* +* Table for key code translation of function keys in keypad mode +* These values are for strict IBM keyboard compatibles only +*******************************************************************************/ + + +static int kptab[] = +{ + /* Normal Function Keys */ + 0x3b, KEY_F(1), 0x3c, KEY_F(2), 0x3d, KEY_F(3), 0x3e, KEY_F(4), + 0x3f, KEY_F(5), 0x40, KEY_F(6), 0x41, KEY_F(7), 0x42, KEY_F(8), + 0x43, KEY_F(9), 0x44, KEY_F(10), + + /* Normal Keypad */ + 0x47, KEY_HOME, 0x48, KEY_UP, 0x49, KEY_PPAGE, + 0x4b, KEY_LEFT, 0x4c, KEY_B2, 0x4d, KEY_RIGHT, + 0x4f, KEY_END, 0x50, KEY_DOWN, 0x51, KEY_NPAGE, + 0x52, KEY_IC, 0x53, KEY_DC, + + /* Shft-Function Keys */ + 0x54, KEY_F(13), 0x55, KEY_F(14), 0x56, KEY_F(15), 0x57, KEY_F(16), + 0x58, KEY_F(17), 0x59, KEY_F(18), 0x5a, KEY_F(19), 0x5b, KEY_F(20), + 0x5c, KEY_F(21), 0x5d, KEY_F(22), + + /* Ctl-Function Keys */ + 0x5e, KEY_F(25), 0x5f, KEY_F(26), 0x60, KEY_F(27), 0x61, KEY_F(28), + 0x62, KEY_F(29), 0x63, KEY_F(30), 0x64, KEY_F(31), 0x65, KEY_F(32), + 0x66, KEY_F(33), 0x67, KEY_F(34), + + /* Alt-Function Keys */ + 0x68, KEY_F(37), 0x69, KEY_F(38), 0x6a, KEY_F(39), 0x6b, KEY_F(40), + 0x6c, KEY_F(41), 0x6d, KEY_F(42), 0x6e, KEY_F(43), 0x6f, KEY_F(44), + 0x70, KEY_F(45), 0x71, KEY_F(46), + + /* Control-Keypad */ + 0x77, CTL_HOME, 0x84, CTL_PGUP, + 0x73, CTL_LEFT, 0x74, CTL_RIGHT, + 0x75, CTL_END, 0x76, CTL_PGDN, + + /* Alt-Numbers */ + 0x78, ALT_1, 0x79, ALT_2, 0x7a, ALT_3, 0x7b, ALT_4, + 0x7c, ALT_5, 0x7d, ALT_6, 0x7e, ALT_7, 0x7f, ALT_8, + 0x80, ALT_9, 0x81, ALT_0, + + /* Extended codes */ + 0x85, KEY_F(11), 0x86, KEY_F(12), 0x87, KEY_F(23), 0x88, KEY_F(24), + 0x89, KEY_F(35), 0x8a, KEY_F(36), 0x8b, KEY_F(47), 0x8c, KEY_F(48), + 0x03, 0, /* NULL */ + +#if defined(NUMKEYPAD) + 0xff, (int)'/', 0x0d, (int)'\n', + 0xfa, (int)'*', 0xfd, (int)'-', 0xfb, (int)'+', +#else + 0xff, PADSLASH, 0x0d, PADENTER, + 0xfa, PADSTAR, 0xfd, PADMINUS, 0xfb, PADPLUS, +#endif + + 0x0a, CTL_PADENTER, + 0xa6, ALT_PADENTER, 0x53, (int)'.', 0xfc, CTL_ENTER, + 0x93, CTL_DEL, 0x8f, CTL_PADCENTER, 0x90, CTL_PADPLUS, + 0x8e, CTL_PADMINUS, 0x95, CTL_PADSLASH, 0x96, CTL_PADSTAR, + 0x4e, ALT_PADPLUS, 0x4a, ALT_PADMINUS, 0xa4, ALT_PADSLASH, + 0x37, ALT_PADSTAR, 0x92, CTL_INS, 0xa2, ALT_INS, + 0xa3, ALT_DEL, 0x8d, CTL_UP, 0x91, CTL_DOWN, + 0x94, CTL_TAB, 0xa5, ALT_TAB, 0x82, ALT_MINUS, + 0x83, ALT_EQUAL, 0x99, ALT_PGUP, 0xa1, ALT_PGDN, + 0x9f, ALT_END, 0x98, ALT_UP, 0xa0, ALT_DOWN, + 0x9d, ALT_RIGHT, 0x9b, ALT_LEFT, 0x1c, ALT_ENTER, + 0x97, ALT_HOME, 0x01, ALT_ESC, 0x0e, ALT_BKSP, + 0x29, ALT_BQUOTE, 0x1a, ALT_LBRACKET, 0x1b, ALT_RBRACKET, + 0x27, ALT_SEMICOLON,0x28, ALT_FQUOTE, 0x33, ALT_COMMA, + 0x34, ALT_STOP, 0x35, ALT_FSLASH, 0x2b, ALT_BSLASH, + + /* Alt-Alphabet */ + 0x1e, ALT_A, 0x30, ALT_B, 0x2e, ALT_C, 0x20, ALT_D, + 0x12, ALT_E, 0x21, ALT_F, 0x22, ALT_G, 0x23, ALT_H, + 0x17, ALT_I, 0x24, ALT_J, 0x25, ALT_K, 0x26, ALT_L, + 0x32, ALT_M, 0x31, ALT_N, 0x18, ALT_O, 0x19, ALT_P, + 0x10, ALT_Q, 0x13, ALT_R, 0x1f, ALT_S, 0x14, ALT_T, + 0x16, ALT_U, 0x2f, ALT_V, 0x11, ALT_W, 0x2d, ALT_X, + 0x15, ALT_Y, 0x2c, ALT_Z, + 0x0f, KEY_BTAB, + 0x100, (-1) +}; + /* End of kptab[] */ + +static unsigned long pdc_key_modifiers=0L; +MOUSE_STATUS Trapped_Mouse_status; + +/*man-start********************************************************************* + + PDC_breakout() - check for type-ahead + + X/Open Description: + The curses package does the "line-breakout optimisation" by + looking for type-ahead periodically while updating the screen. + If input is found, the current update will be postponed until + refresh() or doupdate() are called again. This allows faster + response to commands typed in advance. Normally, the input FILE + pointer passed to newterm(), or stdin in the case when initscr() + was called, will be used to do this type-ahead checking. This routine + will do the actual check for PDcurses to see if input is pending. + + PDCurses Description: + This routine does what the PDcurses typeahead routine used to do. But + to make that routine consistent with its System V counterpart, all it + does now is set whether or not typeahead checking is performed. + + X/Open Return Value: + The PDC_breakout() routine returns TRUE if keyboard input is pending + otherwise FALSE is returned. + + Portability: + PDCurses bool PD_breakout( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +bool PDC_breakout( void ) +#else +bool PDC_breakout() +#endif +/***********************************************************************/ +{ +extern int c_pindex; /* putter index */ +extern int c_gindex; /* getter index */ +extern int c_ungind; /* wungetch() push index */ +#ifdef TC +# pragma argsused +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_breakout() - called\n"); +#endif + + if (c_ungind) + return (TRUE); /* ungotten char */ + if (c_pindex > c_gindex) + return (TRUE); /* buffered char */ + if (SP->raw_inp) + return((bool)PDC_check_bios_key());/* raw mode test */ + + return((bool)PDC_check_bios_key()); /* normal mode test */ +} + +/*man-start********************************************************************* + + PDC_get_input_fd() - Get file descriptor used for PDCurses input + + PDCurses Description: + This is a private PDCurses routine. + + This routine will return the file descriptor that PDCurses reads + its input from. It can be used for select(). + + PDCurses Return Value: + Returns a file descriptor. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_get_input_fd( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_input_fd(void) +#else +int PDC_get_input_fd() +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_input_fd() - called\n"); +#endif + + return fileno(stdin); +} + +/*man-start********************************************************************* + + PDC_check_bios_key() - Check BIOS key data area for input + + PDCurses Description: + This is a private PDCurses routine. + + This routine will check the BIOS for any indication that + keystrokes are pending. + + PDCurses Return Value: + Returns 1 if a keyboard character is available, 0 otherwise. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses bool PDC_check_bios_key( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +bool PDC_check_bios_key(void) +#else +bool PDC_check_bios_key() +#endif +/***********************************************************************/ +{ +#if !defined(MSC) && !defined(EMXVIDEO) + KBDKEYINFO keyInfo={0}; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_check_bios_key() - called\n"); +#endif + +#ifdef EMXVIDEO + if (SP->tahead == -1) /* Nothing typed yet */ + { /* See if there's anything */ + SP->tahead = _read_kbd (0, 0, 0); + if (SP->tahead == 0) /* Read additional */ + SP->tahead = (_read_kbd (0, 1, 0) << 8); + } + return(SP->tahead != -1) ? 1 : 0; +#else +# if !defined(MSC) +/* KbdCharIn(&keyInfo, IO_NOWAIT, 0);*/ /* get a character */ + KbdPeek(&keyInfo, 0); /* peek at keyboard */ + return (keyInfo.fbStatus != 0); +# else + return(kbhit()); +# endif +#endif + +} + +/*man-start********************************************************************* + + PDC_get_bios_key() - Returns the next key available from the BIOS. + + PDCurses Description: + This is a private PDCurses routine. + + Returns the next key code struck at the keyboard. If the low 8 + bits are 0, the upper bits contain the extended character + code. If bit 0-7 are non-zero, the upper bits = 0. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_get_bios_key( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_get_bios_key(void) +#else +int PDC_get_bios_key() +#endif +/***********************************************************************/ +{ + int ascii=0,scan=0; +#ifndef EMXVIDEO + KBDKEYINFO keyInfo={0}; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_bios_key() - called\n"); +#endif + +#ifdef EMXVIDEO + if (SP->tahead == -1) + { + SP->tahead = _read_kbd (0, 1, 0); + if (SP->tahead == 0) /* Read additional */ + SP->tahead = (_read_kbd (0, 1, 0) << 8); + } + ascii = SP->tahead & 0xff; + scan = SP->tahead >> 8; + pdc_key_modifiers = 0L; + SP->tahead = -1; +#else + KbdCharIn(&keyInfo, IO_WAIT, 0); /* get a character */ + ascii = keyInfo.chChar; + scan = keyInfo.chScan; + pdc_key_modifiers = 0L; + if (SP->save_key_modifiers) + { + if (keyInfo.fsState & KBDSTF_ALT) + pdc_key_modifiers |= PDC_KEY_MODIFIER_ALT; + if (keyInfo.fsState & KBDSTF_CONTROL) + pdc_key_modifiers |= PDC_KEY_MODIFIER_CONTROL; + if (keyInfo.fsState & KBDSTF_NUMLOCK_ON) + pdc_key_modifiers |= PDC_KEY_MODIFIER_NUMLOCK; + if (keyInfo.fsState & KBDSTF_LEFTSHIFT + || keyInfo.fsState & KBDSTF_RIGHTSHIFT) + pdc_key_modifiers |= PDC_KEY_MODIFIER_SHIFT; + } +#endif + + if (scan == 0x1c && ascii == 0x0a) /* ^Enter */ + return ((int) (0xfc00)); + if ((scan == 0x03 && ascii == 0x00) /* ^@ - Null */ + || (scan == 0xe0 && ascii == 0x0d) /* PadEnter */ + || (scan == 0xe0 && ascii == 0x0a)) /* ^PadEnter */ + return ((int) (ascii << 8)); + if ((scan == 0x37 && ascii == 0x2a) /* Star */ + || (scan == 0x4a && ascii == 0x2d) /* Minus */ + || (scan == 0x4e && ascii == 0x2b) /* Plus */ + || (scan == 0xe0 && ascii == 0x2f)) /* Slash */ + return ((int) ((ascii & 0x0f) | 0xf0) << 8); + if (ascii == 0x00 || ascii == 0xe0) + return ((int) (scan << 8)); + return ((int) (ascii)); +} + +/*man-start********************************************************************* + + PDC_get_ctrl_break() - return OS control break state + + PDCurses Description: + This is a private PDCurses routine. + + Returns the current OS Control Break Check state. + + PDCurses Return Value: + DOS: + This function returns TRUE on if the Control Break + Check is enabled otherwise FALSE is returned. + + FLEXOS: + This function returns TRUE on if the Keyboard Mode + allows a break to bre reported otherwise FALSE is returned. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses bool PDC_get_ctrl_break( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +bool PDC_get_ctrl_break(void) +#else +bool PDC_get_ctrl_break() +#endif +/***********************************************************************/ +{ +#if defined(CURSES__32BIT__) || defined(CSET2) || defined(TC) +# if defined(TC) + void __cdecl (*oldAction) (int); +# else + void (*oldAction) (int); +# endif +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_ctrl_break() - called\n"); +#endif + +#if defined(CURSES__32BIT__) || defined(CSET2) || defined(TC) + oldAction = signal (SIGINT, SIG_DFL); + if (oldAction == SIG_ERR) return FALSE; + else signal (SIGINT, oldAction); + return (oldAction != SIG_IGN); +#else + PFNSIGHANDLER oldHandler, oldHandler1; + USHORT oldAction, oldAction1; + /* get the current state, and set to ignore */ + DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction, + SIGA_IGNORE, SIG_CTRLBREAK); + /* restore the previous state */ + DosSetSigHandler(oldHandler, &oldHandler1, &oldAction1, + oldAction, SIG_CTRLBREAK); + return(oldAction != SIGA_IGNORE); +#endif +} + +/*man-start********************************************************************* + + PDC_rawgetch() - Returns the next uninterpreted character (if available). + + PDCurses Description: + Gets a character without any interpretation at all and returns + it. If keypad mode is active for the designated window, + function key translation will be performed. Otherwise, + function keys are ignored. If nodelay mode is active in the + window, then PDC_rawgetch() returns -1 if no character is + available. + + WARNING: It is unknown whether the FUNCTION key translation + is performed at this level. --Frotz 911130 BUG + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_rawgetch( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_rawgetch(void) +#else +int PDC_rawgetch() +#endif +/***********************************************************************/ +{ +extern WINDOW* _getch_win_; +/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ + /* is the same window - all references to w changed*/ + /* to _getch_win_ - marked with @@ */ + + int c=0; + int oldc=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_rawgetch() - called\n"); +#endif + + if (_getch_win_ == (WINDOW *)NULL) /* @@ */ + return( -1 ); + + if (_getch_win_->_nodelay && !PDC_breakout()) /* @@ */ + return( -1 ); + + while (1) /* loop to get valid char */ + { + c = PDC_get_bios_key(); + oldc = c; + /* + * Return the key if it is not a special key. + */ + if ((c = PDC_validchar(c)) >= 0) + { /* get & check next char */ + return( c ); + } + if (_getch_win_->_use_keypad) + return( oldc ); + } +} + +/*man-start********************************************************************* + + PDC_set_ctrl_break() - Enables/Disables the host OS BREAK key check. + + PDCurses Description: + This is a private PDCurses routine. + + Enables/Disables the host OS BREAK key check. If the supplied setting + is TRUE, this enables CTRL/C and CTRL/BREAK to abort the process. + If FALSE, CTRL/C and CTRL/BREAK are ignored. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_set_ctrl_break( bool setting ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_ctrl_break(bool setting) +#else +int PDC_set_ctrl_break(setting) +bool setting; +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_ctrl_break() - called\n"); +#endif + +#if defined (CURSES__32BIT__) || defined (CSET2) || defined(TC) + signal (SIGINT, (setting?SIG_DFL:SIG_IGN)); + signal (SIGBREAK, (setting?SIG_DFL:SIG_IGN)); + return( OK ); +#else + PFNSIGHANDLER oldHandler; + USHORT oldAction, Action; + + /* turn off control C checking */ + if (setting) + Action = SIGA_KILL; + else + Action = SIGA_IGNORE; + DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction, + Action, SIG_CTRLBREAK); + DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction, + Action, SIG_CTRLC); + return( OK ); +#endif + +} + +/*man-start********************************************************************* + + PDC_sysgetch() - Return a character using default system routines. + + PDCurses Description: + This is a private PDCurses function. + + Gets a character without normal ^S, ^Q, ^P and ^C interpretation + and returns it. If keypad mode is active for the designated + window, function key translation will be performed. Otherwise, + function keys are ignored. If nodelay mode is active in the + window, then sysgetch() returns -1 if no character is + available. + + PDCurses Return Value: + This function returns OK upon success otherwise ERR is returned. + + PDCurses Errors: + No errors are defined for this routine. + + Portability: + PDCurses int PDC_sysgetch( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_sysgetch(void) +#else +int PDC_sysgetch() +#endif +/***********************************************************************/ +{ +extern WINDOW* _getch_win_; +/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ + /* is the same window - all references to w changed*/ + /* to _getch_win_ - marked with @@ */ + + int c=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_sysgetch() - called\n"); +#endif + + if (_getch_win_ == (WINDOW *)NULL) /* @@ */ + return (-1); + + if (_getch_win_->_nodelay && !PDC_breakout()) + return (-1); + + while (1) + { + c = PDC_get_bios_key(); + /* + * Return the key if it is not a special key. + */ + if ((unsigned int)c < 256) + return(c); + if ((c = PDC_validchar(c)) >= 0) + { + return (c); /* get & check next char */ + } + } +} + +/*man-start********************************************************************* + + PDC_validchar() - validate/translate passed character + + PDCurses Description: + This is a private PDCurses function. + + Checks that 'c' is a valid character, and if so returns it, + with function key translation applied if 'w' has keypad mode + set. If char is invalid, returns -1. + + PDCurses Return Value: + This function returns -1 if the passed character is invalid, or + the WINDOW* 'w' is NULL, or 'w's keypad is not active. + + This function returns 0 under Flexos if the passed character + is 0x0300. (-:Forget why. --Frotz 911130:-) + + Otherwise, this function returns the PDCurses equivalent of the + passed character. See the function key and key macros in + + + PDCurses Errors: + There are no errors defined for this routine. + + Portability: + PDCurses int PDC_validchar( int c ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_validchar(int c) +#else +int PDC_validchar(c) +int c; +#endif +/***********************************************************************/ +{ +extern WINDOW* _getch_win_; +/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ + /* is the same window - all references to w changed*/ + /* to _getch_win_ - marked with @@ */ + + int *scanp=NULL; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_validchar() - called\n"); +#endif + + if (_getch_win_ == (WINDOW *)NULL) + return (-1); /* bad window pointer */ + + if ((unsigned int)c < 256) return (c); /* normal character */ + if (!(_getch_win_->_use_keypad)) return (-1); /* skip if keys if !keypad mode */ + + /* + * Under DOS, extended keys are in the upper byte. Shift down for a + * comparison. + */ + c = (c >> 8) & 0xFF; + + scanp = kptab; + while (*scanp > 0) /* search for value */ + { /* (stops on table entry 0x100) */ + if (*scanp++ == c) + { + return (*scanp); /* found, return it */ + } + scanp++; + } + return( -1 ); /* not found, invalid */ +} + +/*man-start********************************************************************* + + PDC_get_key_modifiers() - Returns the keyboard modifier(s) at time of last getch() + + PDCurses Description: + This is a private PDCurses routine. + + Returns the keyboard modifiers effective at the time of the last getch() + call only if PDC_save_key_modifiers(TRUE) has been called before the + getch(); + Use the macros; PDC_KEY_MODIFIER_* to determine which modifier(s) + were set. + + PDCurses Return Value: + This function returns the modifiers. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_get_key_modifiers( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +unsigned long PDC_get_key_modifiers(void) +#else +unsigned long PDC_get_key_modifiers() +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_get_key_modifiers() - called\n"); +#endif + return(pdc_key_modifiers); +} diff --git a/os2/pdcprint.c b/os2/pdcprint.c index 7fecf53c..ff249076 100644 --- a/os2/pdcprint.c +++ b/os2/pdcprint.c @@ -1,89 +1,89 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCprint = "$Id: pdcprint.c,v 1.1 2001/01/10 08:29:37 mark Exp $"; -#endif - -#if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(MSC) &&!defined(TC) -#define INCL_DOS -#include -#endif - -char Printer[]="LPT1:"; - -/*man-start********************************************************************* - - PDC_print() - Provides primitive access to the BIOS printer functions - - PDCurses Description: - This is a private PDCurses routine. - - Implements write/init/read printer services at the BIOS level. - - This provides the basic support that PDCurses needs to dump the - contents of windows or pads to the printer attached to the BIOS - printer port. - - PDCurses Return Value: - See the BIOS INT 0x17 specifications. - - PDCurses Errors: - See the BIOS INT 0x17 specifications. - - Portability: - PDCurses int PDC_print( int cmd, int byte, int port ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_print(int cmd, int byte, int port) -#else -int PDC_print(cmd,byte,port) -int cmd; -int byte; -int port; -#endif -/***********************************************************************/ -{ -#if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(TC) - HFILE Lpt; - USHORT Action=0; - USHORT NoWritten=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_print() - called\n"); -#endif - -#if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(TC) - if (DosOpen((PSZ)Printer, &Lpt, &Action, 0,0,0,0,0) != 0) - return(ERR); - DosWrite(Lpt,&byte,1,&NoWritten); - DosClose(Lpt); - return(NoWritten == 1); -#endif -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#ifdef PDCDEBUG +char *rcsid_PDCprint = "$Id: pdcprint.c,v 1.2 2001/01/10 08:29:38 mark Exp $"; +#endif + +#if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(MSC) &&!defined(TC) +#define INCL_DOS +#include +#endif + +char Printer[]="LPT1:"; + +/*man-start********************************************************************* + + PDC_print() - Provides primitive access to the BIOS printer functions + + PDCurses Description: + This is a private PDCurses routine. + + Implements write/init/read printer services at the BIOS level. + + This provides the basic support that PDCurses needs to dump the + contents of windows or pads to the printer attached to the BIOS + printer port. + + PDCurses Return Value: + See the BIOS INT 0x17 specifications. + + PDCurses Errors: + See the BIOS INT 0x17 specifications. + + Portability: + PDCurses int PDC_print( int cmd, int byte, int port ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_print(int cmd, int byte, int port) +#else +int PDC_print(cmd,byte,port) +int cmd; +int byte; +int port; +#endif +/***********************************************************************/ +{ +#if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(TC) + HFILE Lpt; + USHORT Action=0; + USHORT NoWritten=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_print() - called\n"); +#endif + +#if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(TC) + if (DosOpen((PSZ)Printer, &Lpt, &Action, 0,0,0,0,0) != 0) + return(ERR); + DosWrite(Lpt,&byte,1,&NoWritten); + DosClose(Lpt); + return(NoWritten == 1); +#endif +} diff --git a/os2/pdcscrn.c b/os2/pdcscrn.c index 4a55363f..339bd0b1 100644 --- a/os2/pdcscrn.c +++ b/os2/pdcscrn.c @@ -1,319 +1,319 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCscrn = "$Id: pdcscrn.c,v 1.1 2001/01/10 08:29:39 mark Exp $"; -#endif - -#ifdef EMXVIDEO - static unsigned char *saved_screen = NULL; - static int saved_lines = 0; - static int saved_cols = 0; -#else - static PCH saved_screen = NULL; - static USHORT saved_lines = 0; - static USHORT saved_cols = 0; -#endif - -/*man-start********************************************************************* - - PDC_scr_close() - Internal low-level binding to close the physical screen - - PDCurses Description: - This function provides a low-level binding for the Flexos - platform which must close the screen before writing to it. - This is a nop for the DOS platform. - - This function is provided in order to reset the FlexOS 16 bit - character set for input rather than the limited input - character set associated with the VT52. - - PDCurses Return Value: - This function returns OK on success, otherwise an ERR is returned. - - PDCurses Errors: - The DOS platform will never fail. The Flexos platform may fail - depending on the ability to close the current virtual console in - 8 (as opposed to 16) bit mode. - - Portability: - PDCurses int PDC_scr_close( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_scr_close(void) -#else -int PDC_scr_close() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scr_close() - called\n"); -#endif - if (getenv("PDC_RESTORE_SCREEN") != NULL) - { - if (saved_screen == NULL) - return( OK ); -#ifdef EMXVIDEO - v_putline(saved_screen,0,0,saved_lines*saved_cols); -#else - VioWrtCellStr(saved_screen,saved_lines*saved_cols*2,0,0,(HVIO)NULL); -#endif - free(saved_screen); - saved_screen = NULL; - } - return( OK ); -} - -/*man-start********************************************************************* - - PDC_scrn_modes_equal() - Decide if two screen modes are equal - - PDCurses Description: - Mainly required for OS/2. It decides if two screen modes - (VIOMODEINFO structure) are equal. Under DOS it just compares - two integers - - PDCurses Return Value: - This function returns TRUE if equal else FALSe. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_scrn_modes_equal( int mode1, int mode2 ); - OS2 PDCurses int PDC_scrn_modes_equal( VIOMODEINFO mode1, VIOMODEINFO mode2 ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#if !defined( EMXVIDEO ) -bool PDC_scrn_modes_equal(VIOMODEINFO mode1, VIOMODEINFO mode2) -#else -# ifdef HAVE_PROTO -bool PDC_scrn_modes_equal(int mode1, int mode2) -# else -bool PDC_scrn_modes_equal(mode1,mode2) -int mode1; -int mode2; -# endif -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scrn_modes_equal() - called\n"); -#endif - -#if !defined( EMXVIDEO ) - return ((mode1.cb == mode2.cb) && (mode1.fbType == mode2.fbType) - && (mode1.color == mode2.color) && (mode1.col == mode2.col) - && (mode1.row == mode2.row) && (mode1.hres == mode2.vres) - && (mode1.vres == mode2.vres) ); -#else - return (mode1 == mode2); -#endif -} - -/*man-start********************************************************************* - - PDC_scr_open() - Internal low-level binding to open the physical screen - - PDCurses Description: - This function provides a low-level binding for the Flexos - platform which must open the screen before writing to it. - - This function is provided in order to access the FlexOS 16 bit - character set for input rather than the limited input - character set associated with the VT52. - - PDCurses Return Value: - This function returns OK on success, otherwise an ERR is returned. - - PDCurses Errors: - The DOS platform will never fail. The Flexos platform may fail - depending on the ability to open the current virtual console in - 8 (as opposed to 16) bit mode. - - Portability: - PDCurses int PDC_scr_open( SCREEN* internal, bool echo ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_scr_open(SCREEN *internal, bool echo) -#else -int PDC_scr_open(internal,echo) -SCREEN *internal; -bool echo; -#endif -/***********************************************************************/ -{ -#if !defined( EMXVIDEO ) - extern VIOCONFIGINFO configInfo; - extern VIOMODEINFO modeInfo; - USHORT totchars=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scr_open() - called\n"); -#endif - - internal->orig_attr = 0; - internal->orig_emulation = 0; - PDC_get_cursor_pos(&internal->cursrow, &internal->curscol); - internal->direct_video = TRUE; /* Assume that we can */ - internal->autocr = TRUE; /* lf -> crlf by default */ - internal->raw_out = FALSE; /* tty I/O modes */ - internal->raw_inp = FALSE; /* tty I/O modes */ - internal->cbreak = TRUE; - internal->save_key_modifiers = FALSE; - internal->return_key_modifiers = FALSE; - internal->echo = echo; -/* under System V Curses, typeahead checking is enabled by default */ - internal->refrbrk = TRUE; /* allow premature end of refresh*/ - internal->video_page = 0; /* Current Video Page */ - internal->visible_cursor= TRUE; /* Assume that it is visible */ - internal->cursor = PDC_get_cursor_mode(); -#if defined(EMXVIDEO) - internal->tahead = -1; -#endif - -#if !defined(EMXVIDEO) - (void)PDC_query_adapter_type(); - memcpy((char *)&internal->adapter,(char *)&configInfo,sizeof(VIOCONFIGINFO)); - (void)PDC_get_scrn_mode(); - memcpy((char *)&internal->scrnmode,(char *)&modeInfo,sizeof(VIOMODEINFO)); -#else - internal->adapter = PDC_query_adapter_type(); -#endif - - internal->orig_font = internal->font = PDC_get_font(); - internal->lines = PDC_get_rows(); - internal->cols = PDC_get_columns(); - internal->audible = TRUE; - internal->visibility = 1; - internal->orig_cursor = internal->cursor; - internal->orgcbr = PDC_get_ctrl_break(); - internal->blank = ' '; - internal->resized = FALSE; - internal->shell = FALSE; - internal->_trap_mbe = 0L; - internal->_map_mbe_to_key = 0L; - internal->linesrippedoff = 0; - internal->linesrippedoffontop = 0; - internal->delaytenths = 0; -/* - * This code for preserving the current screen... - */ - if (getenv("PDC_RESTORE_SCREEN") != NULL) - { - saved_lines = internal->lines; - saved_cols = internal->cols; -#ifdef EMXVIDEO - if ((saved_screen = (unsigned char*)malloc(2*saved_lines*saved_cols*sizeof(unsigned char))) == NULL) - return(ERR); - v_getline(saved_screen,0,0,saved_lines*saved_cols); -#else - if ((saved_screen = (PCH)malloc(2*saved_lines*saved_cols*sizeof(unsigned char))) == NULL) - return(ERR); - totchars = saved_lines*saved_cols*2; - VioReadCellStr((PCH)saved_screen,&totchars,0,0,(HVIO)NULL); -#endif - } - - if (getenv("PDC_PRESERVE_SCREEN") != NULL) - internal->_preserve = TRUE; - else - internal->_preserve = FALSE; - - return( OK ); -} - -/*man-start********************************************************************* - - PDC_resize_screen() - Internal low-level function to resize screen - - PDCurses Description: - This function provides a means for the application program to - resize the overall dimensions of the screen. Under DOS and OS/2 - the application can tell PDCurses what size to make the screen; - under X11, resizing is done by the user and this function simply - adjusts its internal structures to fit the new size. - - PDCurses Return Value: - This function returns OK on success, otherwise an ERR is returned. - - PDCurses Errors: - - Portability: - PDCurses int PDC_resize_screen( int, int ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_resize_screen(int nlines, int ncols) -#else -int PDC_resize_screen(nlines, ncols) -int nlines,ncols; -#endif -/***********************************************************************/ -{ - int rc=OK; -#ifndef EMXVIDEO - VIOMODEINFO modeInfo={0}; - USHORT result=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_resize_screen() - called. Lines: %d Cols: %d\n",nlines,ncols); -#endif - -#if 0 - if (nlines >= 43) PDC_set_font(_FONT8); - else if (nlines > 25) PDC_set_font(_FONT14); - else PDC_set_80x25(); - return ( rc ); -#else - -# ifdef EMXVIDEO - return (ERR); -# else - modeInfo.cb = sizeof(modeInfo); - /* set most parameters of modeInfo */ - VioGetMode(&modeInfo, 0); - modeInfo.fbType = 1; - modeInfo.row = nlines; - modeInfo.col = ncols; - result = VioSetMode(&modeInfo, 0); - LINES = PDC_get_rows(); - COLS = PDC_get_columns(); - return ((result == 0) ? OK : ERR); -# endif -#endif -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#ifdef PDCDEBUG +char *rcsid_PDCscrn = "$Id: pdcscrn.c,v 1.2 2001/01/10 08:29:40 mark Exp $"; +#endif + +#ifdef EMXVIDEO + static unsigned char *saved_screen = NULL; + static int saved_lines = 0; + static int saved_cols = 0; +#else + static PCH saved_screen = NULL; + static USHORT saved_lines = 0; + static USHORT saved_cols = 0; +#endif + +/*man-start********************************************************************* + + PDC_scr_close() - Internal low-level binding to close the physical screen + + PDCurses Description: + This function provides a low-level binding for the Flexos + platform which must close the screen before writing to it. + This is a nop for the DOS platform. + + This function is provided in order to reset the FlexOS 16 bit + character set for input rather than the limited input + character set associated with the VT52. + + PDCurses Return Value: + This function returns OK on success, otherwise an ERR is returned. + + PDCurses Errors: + The DOS platform will never fail. The Flexos platform may fail + depending on the ability to close the current virtual console in + 8 (as opposed to 16) bit mode. + + Portability: + PDCurses int PDC_scr_close( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_scr_close(void) +#else +int PDC_scr_close() +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_scr_close() - called\n"); +#endif + if (getenv("PDC_RESTORE_SCREEN") != NULL) + { + if (saved_screen == NULL) + return( OK ); +#ifdef EMXVIDEO + v_putline(saved_screen,0,0,saved_lines*saved_cols); +#else + VioWrtCellStr(saved_screen,saved_lines*saved_cols*2,0,0,(HVIO)NULL); +#endif + free(saved_screen); + saved_screen = NULL; + } + return( OK ); +} + +/*man-start********************************************************************* + + PDC_scrn_modes_equal() - Decide if two screen modes are equal + + PDCurses Description: + Mainly required for OS/2. It decides if two screen modes + (VIOMODEINFO structure) are equal. Under DOS it just compares + two integers + + PDCurses Return Value: + This function returns TRUE if equal else FALSe. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_scrn_modes_equal( int mode1, int mode2 ); + OS2 PDCurses int PDC_scrn_modes_equal( VIOMODEINFO mode1, VIOMODEINFO mode2 ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#if !defined( EMXVIDEO ) +bool PDC_scrn_modes_equal(VIOMODEINFO mode1, VIOMODEINFO mode2) +#else +# ifdef HAVE_PROTO +bool PDC_scrn_modes_equal(int mode1, int mode2) +# else +bool PDC_scrn_modes_equal(mode1,mode2) +int mode1; +int mode2; +# endif +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_scrn_modes_equal() - called\n"); +#endif + +#if !defined( EMXVIDEO ) + return ((mode1.cb == mode2.cb) && (mode1.fbType == mode2.fbType) + && (mode1.color == mode2.color) && (mode1.col == mode2.col) + && (mode1.row == mode2.row) && (mode1.hres == mode2.vres) + && (mode1.vres == mode2.vres) ); +#else + return (mode1 == mode2); +#endif +} + +/*man-start********************************************************************* + + PDC_scr_open() - Internal low-level binding to open the physical screen + + PDCurses Description: + This function provides a low-level binding for the Flexos + platform which must open the screen before writing to it. + + This function is provided in order to access the FlexOS 16 bit + character set for input rather than the limited input + character set associated with the VT52. + + PDCurses Return Value: + This function returns OK on success, otherwise an ERR is returned. + + PDCurses Errors: + The DOS platform will never fail. The Flexos platform may fail + depending on the ability to open the current virtual console in + 8 (as opposed to 16) bit mode. + + Portability: + PDCurses int PDC_scr_open( SCREEN* internal, bool echo ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_scr_open(SCREEN *internal, bool echo) +#else +int PDC_scr_open(internal,echo) +SCREEN *internal; +bool echo; +#endif +/***********************************************************************/ +{ +#if !defined( EMXVIDEO ) + extern VIOCONFIGINFO configInfo; + extern VIOMODEINFO modeInfo; + USHORT totchars=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_scr_open() - called\n"); +#endif + + internal->orig_attr = 0; + internal->orig_emulation = 0; + PDC_get_cursor_pos(&internal->cursrow, &internal->curscol); + internal->direct_video = TRUE; /* Assume that we can */ + internal->autocr = TRUE; /* lf -> crlf by default */ + internal->raw_out = FALSE; /* tty I/O modes */ + internal->raw_inp = FALSE; /* tty I/O modes */ + internal->cbreak = TRUE; + internal->save_key_modifiers = FALSE; + internal->return_key_modifiers = FALSE; + internal->echo = echo; +/* under System V Curses, typeahead checking is enabled by default */ + internal->refrbrk = TRUE; /* allow premature end of refresh*/ + internal->video_page = 0; /* Current Video Page */ + internal->visible_cursor= TRUE; /* Assume that it is visible */ + internal->cursor = PDC_get_cursor_mode(); +#if defined(EMXVIDEO) + internal->tahead = -1; +#endif + +#if !defined(EMXVIDEO) + (void)PDC_query_adapter_type(); + memcpy((char *)&internal->adapter,(char *)&configInfo,sizeof(VIOCONFIGINFO)); + (void)PDC_get_scrn_mode(); + memcpy((char *)&internal->scrnmode,(char *)&modeInfo,sizeof(VIOMODEINFO)); +#else + internal->adapter = PDC_query_adapter_type(); +#endif + + internal->orig_font = internal->font = PDC_get_font(); + internal->lines = PDC_get_rows(); + internal->cols = PDC_get_columns(); + internal->audible = TRUE; + internal->visibility = 1; + internal->orig_cursor = internal->cursor; + internal->orgcbr = PDC_get_ctrl_break(); + internal->blank = ' '; + internal->resized = FALSE; + internal->shell = FALSE; + internal->_trap_mbe = 0L; + internal->_map_mbe_to_key = 0L; + internal->linesrippedoff = 0; + internal->linesrippedoffontop = 0; + internal->delaytenths = 0; +/* + * This code for preserving the current screen... + */ + if (getenv("PDC_RESTORE_SCREEN") != NULL) + { + saved_lines = internal->lines; + saved_cols = internal->cols; +#ifdef EMXVIDEO + if ((saved_screen = (unsigned char*)malloc(2*saved_lines*saved_cols*sizeof(unsigned char))) == NULL) + return(ERR); + v_getline(saved_screen,0,0,saved_lines*saved_cols); +#else + if ((saved_screen = (PCH)malloc(2*saved_lines*saved_cols*sizeof(unsigned char))) == NULL) + return(ERR); + totchars = saved_lines*saved_cols*2; + VioReadCellStr((PCH)saved_screen,&totchars,0,0,(HVIO)NULL); +#endif + } + + if (getenv("PDC_PRESERVE_SCREEN") != NULL) + internal->_preserve = TRUE; + else + internal->_preserve = FALSE; + + return( OK ); +} + +/*man-start********************************************************************* + + PDC_resize_screen() - Internal low-level function to resize screen + + PDCurses Description: + This function provides a means for the application program to + resize the overall dimensions of the screen. Under DOS and OS/2 + the application can tell PDCurses what size to make the screen; + under X11, resizing is done by the user and this function simply + adjusts its internal structures to fit the new size. + + PDCurses Return Value: + This function returns OK on success, otherwise an ERR is returned. + + PDCurses Errors: + + Portability: + PDCurses int PDC_resize_screen( int, int ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_resize_screen(int nlines, int ncols) +#else +int PDC_resize_screen(nlines, ncols) +int nlines,ncols; +#endif +/***********************************************************************/ +{ + int rc=OK; +#ifndef EMXVIDEO + VIOMODEINFO modeInfo={0}; + USHORT result=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_resize_screen() - called. Lines: %d Cols: %d\n",nlines,ncols); +#endif + +#if 0 + if (nlines >= 43) PDC_set_font(_FONT8); + else if (nlines > 25) PDC_set_font(_FONT14); + else PDC_set_80x25(); + return ( rc ); +#else + +# ifdef EMXVIDEO + return (ERR); +# else + modeInfo.cb = sizeof(modeInfo); + /* set most parameters of modeInfo */ + VioGetMode(&modeInfo, 0); + modeInfo.fbType = 1; + modeInfo.row = nlines; + modeInfo.col = ncols; + result = VioSetMode(&modeInfo, 0); + LINES = PDC_get_rows(); + COLS = PDC_get_columns(); + return ((result == 0) ? OK : ERR); +# endif +#endif +} diff --git a/os2/pdcsetsc.c b/os2/pdcsetsc.c index 6508c6d8..1409c201 100644 --- a/os2/pdcsetsc.c +++ b/os2/pdcsetsc.c @@ -1,399 +1,399 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCsetsc = "$Id: pdcsetsc.c,v 1.1 2001/01/10 08:29:41 mark Exp $"; -#endif - -/*man-start********************************************************************* - - PDC_set_80x25() - force a known screen state: 80x25 text mode. - - PDCurses Description: - This is a private PDCurses function. - - Forces the appropriate 80x25 alpha mode given the display adapter. - - Since we currently do not support changing the virtual console size, - this routine is a NOP under Flexos. - - PDCurses Return Value: - This function returns OK upon success otherwise ERR is returned. - - PDCurses Errors: - No errors are defined for this routine. - - Portability: - PDCurses int PDC_set_80x25( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_80x25(void) -#else -int PDC_set_80x25() -#endif -/***********************************************************************/ -{ -#ifndef EMXVIDEO - VIOMODEINFO modeInfo={0}; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_80x25() - called\n"); -#endif - -#ifndef EMXVIDEO - modeInfo.cb = sizeof(modeInfo); - /* set most parameters of modeInfo */ - VioGetMode(&modeInfo, 0); - modeInfo.fbType = 1; - VioSetMode(&modeInfo, 0); -#endif - return( OK ); -} - -/*man-start********************************************************************* - - PDC_set_cursor_mode() - Set the cursor start and stop scan lines. - - PDCurses Description: - Sets the cursor type to begin in scan line startrow and end in - scan line endrow. Both values should be 0-31. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_set_cursor_mode( int startrow, int endrow ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_cursor_mode( int startrow, int endrow ) -#else -int PDC_set_cursor_mode(startrow,endrow) -int startrow; -int endrow; -#endif -/***********************************************************************/ -{ -#ifndef EMXVIDEO - VIOCURSORINFO cursorInfo={0}; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_cursor_mode() - called: startrow %d endrow %d\n",startrow,endrow); -#endif - -#ifdef EMXVIDEO - if (endrow <= startrow) - v_hidecursor(); - else - v_ctype (startrow, endrow); - return( OK ); -#else - cursorInfo.yStart = startrow; - cursorInfo.cEnd = endrow; - cursorInfo.cx = 1; - cursorInfo.attr = 0; - return (VioSetCurType (&cursorInfo, 0) == 0); -#endif -} - -/*man-start********************************************************************* - - PDC_set_font() - sets the current font size - - PDCurses Description: - This is a private PDCurses function. - - This routine sets the current font size, if the adapter allows - such a change. - - PDCurses Return Value: - This function returns OK upon success otherwise ERR is returned. - - PDCurses Errors: - It is an error to attempt to change the font size on a "bogus" - adapter. The reason for this is that we have a known video - adapter identity problem. e.g. Two adapters report the same - identifying characteristics. - - It is also an error to attempt to change the size of the Flexos - console (as there is currently no support for that). - - Portability: - PDCurses int PDC_set_font( int size ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_font(int size) -#else -int PDC_set_font(size) -int size; -#endif -/***********************************************************************/ -{ -#ifndef EMXVIDEO - VIOMODEINFO modeInfo={0}; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_font() - called\n"); -#endif - -#ifndef EMXVIDEO - if (SP->sizeable && (SP->font != size)) - { - modeInfo.cb = sizeof(modeInfo); - /* set most parameters of modeInfo */ - VioGetMode(&modeInfo, 0); - modeInfo.cb = 8; /* ignore horiz an vert resolution */ - modeInfo.row = modeInfo.vres / size; - VioSetMode(&modeInfo, 0); - } - if (SP->visible_cursor) - PDC_cursor_on(); - else - PDC_cursor_off(); - SP->font = PDC_get_font(); -#endif - return( OK ); - -} - -/*man-start********************************************************************* - - PDC_set_rows() - sets the physical number of rows on screen - - PDCurses Description: - This is a private PDCurses function. - - This routine attempts to set the number of rows on the physical - screen to the passed value. - - PDCurses Return Value: - This function returns OK upon success otherwise ERR is returned. - - PDCurses Errors: - It is an error to attempt to change the screen size on a "bogus" - adapter. The reason for this is that we have a known video - adapter identity problem. e.g. Two adapters report the same - identifying characteristics. - - It is also an error to attempt to change the size of the Flexos - console (as there is currently no support for that). - - Portability: - PDCurses int PDC_set_rows( int rows ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_rows(int rows) -#else -int PDC_set_rows(rows) -int rows; -#endif -/***********************************************************************/ -{ -#ifndef EMXVIDEO - VIOMODEINFO modeInfo={0}; - USHORT result=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_rows() - called\n"); -#endif - -#ifdef EMXVIDEO - return (ERR); -#else - modeInfo.cb = sizeof(modeInfo); - /* set most parameters of modeInfo */ - VioGetMode(&modeInfo, 0); - modeInfo.fbType = 1; - modeInfo.row = rows; - result = VioSetMode(&modeInfo, 0); - SP->font = PDC_get_font(); - LINES = PDC_get_rows(); - COLS = PDC_get_columns(); - return ((result == 0) ? OK : ERR); -#endif -} - -/*man-start********************************************************************* - - PDC_set_scrn_mode() - Set BIOS Video Mode - - PDCurses Description: - Sets the BIOS Video Mode Number ONLY if it is different from - the current video mode. This routine is for DOS systems only. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_set_scrn_mode( int new_mode ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#if !defined( EMXVIDEO ) -int PDC_set_scrn_mode(VIOMODEINFO new_mode) -#else -# ifdef HAVE_PROTO -int PDC_set_scrn_mode(int new_mode) -# else -int PDC_set_scrn_mode(new_mode) -int new_mode; -# endif -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_scrn_mode() - called\n"); -#endif - -#ifdef EMXVIDEO - return ( OK ); -#else - if (VioSetMode (&new_mode, 0) != 0) - { - SP->font = PDC_get_font(); - memcpy((char *)&SP->scrnmode,(char *)&new_mode,sizeof(VIOMODEINFO)); - LINES = PDC_get_rows(); - COLS = PDC_get_columns(); - return( OK ); - } - else - return (ERR); -#endif -} -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_curs_set(int visibility) -#else -int PDC_curs_set(visibility) -int visibility; -#endif -/***********************************************************************/ -{ -#ifndef EMXVIDEO - VIOCURSORINFO pvioCursorInfo; -#endif - int start=0,end=0; - int ret_vis=0,hidden=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_curs_set() - called: visibility=%d\n",visibility); -#endif - - ret_vis = SP->visibility; - SP->visibility = visibility; - - switch(visibility) - { - case 0: /* invisible */ -#ifdef EMXVIDEO - start = end = 0; -#else - start = SP->font / 4; - end = SP->font; -#endif - hidden = (-1); - break; - case 2: /* highly visible */ - start = 2; /* almost full-height block */ - end = SP->font-1; - break; - default: /* normal visibility */ - start = SP->font - (SP->font / 4); - end = SP->font-1; - break; - } - -#ifdef EMXVIDEO - if (!visibility) - v_hidecursor(); - else - v_ctype (start, end); -#else - pvioCursorInfo.yStart = (USHORT)start; - pvioCursorInfo.cEnd = (USHORT)end; - pvioCursorInfo.cx = (USHORT)1; - pvioCursorInfo.attr = hidden; - VioSetCurType((PVIOCURSORINFO)&pvioCursorInfo,0); -#endif - - return( ret_vis ); -} - -/*man-start********************************************************************* - - PDC_set_title() - Set window title - - PDCurses Description: - Sets the title of the window in which the curses program is running. - This function may not do anything on some platforms. - - PDCurses Return Value: - N/A - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses void PDC_set_title( char *title ); - -**man-end**********************************************************************/ -/***********************************************************************/ -#ifdef HAVE_PROTO -void PDC_set_title(char *title) -#else -void PDC_set_title(title) -char *title; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_title() - called:<%s>\n",title); -#endif - - return; -} +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 +#ifdef HAVE_CONFIG_H +# include +#endif +#include + +#ifdef PDCDEBUG +char *rcsid_PDCsetsc = "$Id: pdcsetsc.c,v 1.2 2001/01/10 08:29:42 mark Exp $"; +#endif + +/*man-start********************************************************************* + + PDC_set_80x25() - force a known screen state: 80x25 text mode. + + PDCurses Description: + This is a private PDCurses function. + + Forces the appropriate 80x25 alpha mode given the display adapter. + + Since we currently do not support changing the virtual console size, + this routine is a NOP under Flexos. + + PDCurses Return Value: + This function returns OK upon success otherwise ERR is returned. + + PDCurses Errors: + No errors are defined for this routine. + + Portability: + PDCurses int PDC_set_80x25( void ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_80x25(void) +#else +int PDC_set_80x25() +#endif +/***********************************************************************/ +{ +#ifndef EMXVIDEO + VIOMODEINFO modeInfo={0}; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_80x25() - called\n"); +#endif + +#ifndef EMXVIDEO + modeInfo.cb = sizeof(modeInfo); + /* set most parameters of modeInfo */ + VioGetMode(&modeInfo, 0); + modeInfo.fbType = 1; + VioSetMode(&modeInfo, 0); +#endif + return( OK ); +} + +/*man-start********************************************************************* + + PDC_set_cursor_mode() - Set the cursor start and stop scan lines. + + PDCurses Description: + Sets the cursor type to begin in scan line startrow and end in + scan line endrow. Both values should be 0-31. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_set_cursor_mode( int startrow, int endrow ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_cursor_mode( int startrow, int endrow ) +#else +int PDC_set_cursor_mode(startrow,endrow) +int startrow; +int endrow; +#endif +/***********************************************************************/ +{ +#ifndef EMXVIDEO + VIOCURSORINFO cursorInfo={0}; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_cursor_mode() - called: startrow %d endrow %d\n",startrow,endrow); +#endif + +#ifdef EMXVIDEO + if (endrow <= startrow) + v_hidecursor(); + else + v_ctype (startrow, endrow); + return( OK ); +#else + cursorInfo.yStart = startrow; + cursorInfo.cEnd = endrow; + cursorInfo.cx = 1; + cursorInfo.attr = 0; + return (VioSetCurType (&cursorInfo, 0) == 0); +#endif +} + +/*man-start********************************************************************* + + PDC_set_font() - sets the current font size + + PDCurses Description: + This is a private PDCurses function. + + This routine sets the current font size, if the adapter allows + such a change. + + PDCurses Return Value: + This function returns OK upon success otherwise ERR is returned. + + PDCurses Errors: + It is an error to attempt to change the font size on a "bogus" + adapter. The reason for this is that we have a known video + adapter identity problem. e.g. Two adapters report the same + identifying characteristics. + + It is also an error to attempt to change the size of the Flexos + console (as there is currently no support for that). + + Portability: + PDCurses int PDC_set_font( int size ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_font(int size) +#else +int PDC_set_font(size) +int size; +#endif +/***********************************************************************/ +{ +#ifndef EMXVIDEO + VIOMODEINFO modeInfo={0}; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_font() - called\n"); +#endif + +#ifndef EMXVIDEO + if (SP->sizeable && (SP->font != size)) + { + modeInfo.cb = sizeof(modeInfo); + /* set most parameters of modeInfo */ + VioGetMode(&modeInfo, 0); + modeInfo.cb = 8; /* ignore horiz an vert resolution */ + modeInfo.row = modeInfo.vres / size; + VioSetMode(&modeInfo, 0); + } + if (SP->visible_cursor) + PDC_cursor_on(); + else + PDC_cursor_off(); + SP->font = PDC_get_font(); +#endif + return( OK ); + +} + +/*man-start********************************************************************* + + PDC_set_rows() - sets the physical number of rows on screen + + PDCurses Description: + This is a private PDCurses function. + + This routine attempts to set the number of rows on the physical + screen to the passed value. + + PDCurses Return Value: + This function returns OK upon success otherwise ERR is returned. + + PDCurses Errors: + It is an error to attempt to change the screen size on a "bogus" + adapter. The reason for this is that we have a known video + adapter identity problem. e.g. Two adapters report the same + identifying characteristics. + + It is also an error to attempt to change the size of the Flexos + console (as there is currently no support for that). + + Portability: + PDCurses int PDC_set_rows( int rows ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_set_rows(int rows) +#else +int PDC_set_rows(rows) +int rows; +#endif +/***********************************************************************/ +{ +#ifndef EMXVIDEO + VIOMODEINFO modeInfo={0}; + USHORT result=0; +#endif + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_rows() - called\n"); +#endif + +#ifdef EMXVIDEO + return (ERR); +#else + modeInfo.cb = sizeof(modeInfo); + /* set most parameters of modeInfo */ + VioGetMode(&modeInfo, 0); + modeInfo.fbType = 1; + modeInfo.row = rows; + result = VioSetMode(&modeInfo, 0); + SP->font = PDC_get_font(); + LINES = PDC_get_rows(); + COLS = PDC_get_columns(); + return ((result == 0) ? OK : ERR); +#endif +} + +/*man-start********************************************************************* + + PDC_set_scrn_mode() - Set BIOS Video Mode + + PDCurses Description: + Sets the BIOS Video Mode Number ONLY if it is different from + the current video mode. This routine is for DOS systems only. + + PDCurses Return Value: + This function returns OK on success and ERR on error. + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses int PDC_set_scrn_mode( int new_mode ); + +**man-end**********************************************************************/ + +/***********************************************************************/ +#if !defined( EMXVIDEO ) +int PDC_set_scrn_mode(VIOMODEINFO new_mode) +#else +# ifdef HAVE_PROTO +int PDC_set_scrn_mode(int new_mode) +# else +int PDC_set_scrn_mode(new_mode) +int new_mode; +# endif +#endif +/***********************************************************************/ +{ + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_scrn_mode() - called\n"); +#endif + +#ifdef EMXVIDEO + return ( OK ); +#else + if (VioSetMode (&new_mode, 0) != 0) + { + SP->font = PDC_get_font(); + memcpy((char *)&SP->scrnmode,(char *)&new_mode,sizeof(VIOMODEINFO)); + LINES = PDC_get_rows(); + COLS = PDC_get_columns(); + return( OK ); + } + else + return (ERR); +#endif +} +/***********************************************************************/ +#ifdef HAVE_PROTO +int PDC_curs_set(int visibility) +#else +int PDC_curs_set(visibility) +int visibility; +#endif +/***********************************************************************/ +{ +#ifndef EMXVIDEO + VIOCURSORINFO pvioCursorInfo; +#endif + int start=0,end=0; + int ret_vis=0,hidden=0; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_curs_set() - called: visibility=%d\n",visibility); +#endif + + ret_vis = SP->visibility; + SP->visibility = visibility; + + switch(visibility) + { + case 0: /* invisible */ +#ifdef EMXVIDEO + start = end = 0; +#else + start = SP->font / 4; + end = SP->font; +#endif + hidden = (-1); + break; + case 2: /* highly visible */ + start = 2; /* almost full-height block */ + end = SP->font-1; + break; + default: /* normal visibility */ + start = SP->font - (SP->font / 4); + end = SP->font-1; + break; + } + +#ifdef EMXVIDEO + if (!visibility) + v_hidecursor(); + else + v_ctype (start, end); +#else + pvioCursorInfo.yStart = (USHORT)start; + pvioCursorInfo.cEnd = (USHORT)end; + pvioCursorInfo.cx = (USHORT)1; + pvioCursorInfo.attr = hidden; + VioSetCurType((PVIOCURSORINFO)&pvioCursorInfo,0); +#endif + + return( ret_vis ); +} + +/*man-start********************************************************************* + + PDC_set_title() - Set window title + + PDCurses Description: + Sets the title of the window in which the curses program is running. + This function may not do anything on some platforms. + + PDCurses Return Value: + N/A + + PDCurses Errors: + No errors are defined for this function. + + Portability: + PDCurses void PDC_set_title( char *title ); + +**man-end**********************************************************************/ +/***********************************************************************/ +#ifdef HAVE_PROTO +void PDC_set_title(char *title) +#else +void PDC_set_title(title) +char *title; +#endif +/***********************************************************************/ +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_set_title() - called:<%s>\n",title); +#endif + + return; +} diff --git a/os2/pdcurses.def b/os2/pdcurses.def index ad019563..c346f648 100644 --- a/os2/pdcurses.def +++ b/os2/pdcurses.def @@ -1,140 +1,140 @@ -LIBRARY PDCURSES - -DESCRIPTION 'PDcurses 2.4 Dynamic Linking library' - -PROTMODE - -DATA MULTIPLE READWRITE LOADONCALL - -CODE LOADONCALL - -EXPORTS - SP - LINES - COLS - COLORS - COLOR_PAIRS - PDC_chadd - PDC_chins - PDC_getclipboard - PDC_setclipboard - PDC_set_title - stdscr - curscr - trace_on - baudrate - beep - border - box - can_change_color - cbreak - clearok - color_content - copywin - curs_set - def_prog_mode - def_shell_mode - delay_output - delwin - doupdate - echo - endwin - erasechar - flash - flushinp - has_colors - has_ic - has_il - idlok - init_color - init_pair - initscr - intrflush - is_termresized - keyname - keypad - killchar - leaveok - longname - meta - mvcur - mvprintw - mvscanw - mvwin - mvwinsertln - mvwprintw - mvwscanw - newpad - newwin - nl - nocbreak - nodelay - noecho - nonl - noraw - notimeout - overlay - overwrite - pair_content - pnoutrefresh - prefresh - printw - raw - raw_output - refresh - resetty - reset_prog_mode - reset_shell_mode - resize_term - resize_window - savetty - scanw - scroll - scrollok - setscrreg - set_term - slk_clear - slk_init - slk_noutrefresh - slk_set - slk_touch - standend - standout - start_color - subwin - touchline - touchwin - traceoff - traceon - typeahead - unctrl - waddch - waddchnstr - waddstr - wattroff - wattron - wattrset - wbkgd - wborder - wclear - wclrtobot - wclrtoeol - wdelch - wdeleteln - werase - wgetch - wgetstr - winch - winsch - winsertln - wmove - wnoutrefresh - wordchar - wprintw - wrefresh - wscanw - wsetscrreg - wstandend - wstandout - wtouchln - wvline +LIBRARY PDCURSES + +DESCRIPTION 'PDcurses 2.4 Dynamic Linking library' + +PROTMODE + +DATA MULTIPLE READWRITE LOADONCALL + +CODE LOADONCALL + +EXPORTS + SP + LINES + COLS + COLORS + COLOR_PAIRS + PDC_chadd + PDC_chins + PDC_getclipboard + PDC_setclipboard + PDC_set_title + stdscr + curscr + trace_on + baudrate + beep + border + box + can_change_color + cbreak + clearok + color_content + copywin + curs_set + def_prog_mode + def_shell_mode + delay_output + delwin + doupdate + echo + endwin + erasechar + flash + flushinp + has_colors + has_ic + has_il + idlok + init_color + init_pair + initscr + intrflush + is_termresized + keyname + keypad + killchar + leaveok + longname + meta + mvcur + mvprintw + mvscanw + mvwin + mvwinsertln + mvwprintw + mvwscanw + newpad + newwin + nl + nocbreak + nodelay + noecho + nonl + noraw + notimeout + overlay + overwrite + pair_content + pnoutrefresh + prefresh + printw + raw + raw_output + refresh + resetty + reset_prog_mode + reset_shell_mode + resize_term + resize_window + savetty + scanw + scroll + scrollok + setscrreg + set_term + slk_clear + slk_init + slk_noutrefresh + slk_set + slk_touch + standend + standout + start_color + subwin + touchline + touchwin + traceoff + traceon + typeahead + unctrl + waddch + waddchnstr + waddstr + wattroff + wattron + wattrset + wbkgd + wborder + wclear + wclrtobot + wclrtoeol + wdelch + wdeleteln + werase + wgetch + wgetstr + winch + winsch + winsertln + wmove + wnoutrefresh + wordchar + wprintw + wrefresh + wscanw + wsetscrreg + wstandend + wstandout + wtouchln + wvline diff --git a/os2/pdcurses.lnk b/os2/pdcurses.lnk index bd5740f9..3de33517 100644 --- a/os2/pdcurses.lnk +++ b/os2/pdcurses.lnk @@ -1,175 +1,175 @@ -dll-obj\baudrate.obj + -dll-obj\beep.obj + -dll-obj\box.obj + -dll-obj\canchang.obj + -dll-obj\cbreak.obj + -dll-obj\clearok.obj + -dll-obj\colorcon.obj + -dll-obj\def_prog.obj + -dll-obj\def_shel.obj + -dll-obj\delay_ou.obj + -dll-obj\delwin.obj + -dll-obj\doupdate.obj + -dll-obj\echo.obj + -dll-obj\endwin.obj + -dll-obj\erasecha.obj + -dll-obj\fixterm.obj + -dll-obj\flash.obj + -dll-obj\flushinp.obj + -dll-obj\gettmode.obj + -dll-obj\getyx.obj + -dll-obj\has_ic.obj + -dll-obj\has_il.obj + -dll-obj\hascolor.obj + -dll-obj\idlok.obj + -dll-obj\initcolo.obj + -dll-obj\initpair.obj + -dll-obj\initscr.obj + -dll-obj\intrflus.obj + -dll-obj\keyname.obj + -dll-obj\keypad.obj + -dll-obj\killchar.obj + -dll-obj\leaveok.obj + -dll-obj\longname.obj + -dll-obj\meta.obj + -dll-obj\mvcur.obj + -dll-obj\mvprintw.obj + -dll-obj\mvscanw.obj + -dll-obj\mvwin.obj + -dll-obj\mvwprint.obj + -dll-obj\mvwscanw.obj + -dll-obj\newpad.obj + -dll-obj\newterm.obj + -dll-obj\newwin.obj + -dll-obj\nl.obj + -dll-obj\nocbreak.obj + -dll-obj\nodelay.obj + -dll-obj\noecho.obj + -dll-obj\noraw.obj + -dll-obj\overlay.obj + -dll-obj\overwrit.obj + -dll-obj\paircont.obj + -dll-obj\pnoutref.obj + -dll-obj\prefresh.obj + -dll-obj\printw.obj + -dll-obj\raw.obj + -dll-obj\refresh.obj + -dll-obj\reset_pr.obj + -dll-obj\reset_sh.obj + -dll-obj\resetter.obj + -dll-obj\resetty.obj + -dll-obj\saveoldt.obj + -dll-obj\saveterm.obj + -dll-obj\savetty.obj + -dll-obj\scanw.obj + -dll-obj\scroll.obj + -dll-obj\scrollok.obj + -dll-obj\set_term.obj + -dll-obj\setscrrg.obj + -dll-obj\standend.obj + -dll-obj\standout.obj + -dll-obj\startcol.obj + -dll-obj\subwin.obj + -dll-obj\touchlin.obj + -dll-obj\touchwin.obj + -dll-obj\typeahea.obj + -dll-obj\unctrl.obj + -dll-obj\ungetch.obj + -dll-obj\waddch.obj + -dll-obj\waddstr.obj + -dll-obj\wattroff.obj + -dll-obj\wattron.obj + -dll-obj\wattrset.obj + -dll-obj\wclear.obj + -dll-obj\wclrtobo.obj + -dll-obj\wclrtoeo.obj + -dll-obj\wdelch.obj + -dll-obj\wdeletel.obj + -dll-obj\werase.obj + -dll-obj\wgetch.obj + -dll-obj\wgetstr.obj + -dll-obj\winch.obj + -dll-obj\winsch.obj + -dll-obj\winsertl.obj + -dll-obj\wmove.obj + -dll-obj\wnoutref.obj + -dll-obj\wprintw.obj + -dll-obj\wrefresh.obj + -dll-obj\wscanw.obj + -dll-obj\wsetscrr.obj + -dll-obj\wstanden.obj + -dll-obj\wstandou.obj + -dll-obj\curs_set.obj + -dll-obj\nonl.obj + -dll-obj\copywin.obj + -dll-obj\traceon.obj + -dll-obj\traceoff.obj + -dll-obj\border.obj + -dll-obj\breakcha.obj + -dll-obj\cursoff.obj + -dll-obj\curson.obj + -dll-obj\mvwinser.obj + -dll-obj\rawout.obj + -dll-obj\resize.obj + -dll-obj\resizew.obj + -dll-obj\tabsize.obj + -dll-obj\waddraws.obj + -dll-obj\wborder.obj + -dll-obj\winprint.obj + -dll-obj\wordchar.obj + -dll-obj\wtabsize.obj + -dll-obj\_addtail.obj + -dll-obj\_addwin.obj + -dll-obj\_backchr.obj + -dll-obj\_cattr.obj + -dll-obj\_chadd.obj + -dll-obj\_chgattr.obj + -dll-obj\_chins.obj + -dll-obj\_ckbiosk.obj + -dll-obj\_clrscr.obj + -dll-obj\_clrupda.obj + -dll-obj\_findwin.obj + -dll-obj\_fixcurs.obj + -dll-obj\_gbiosky.obj + -dll-obj\_gcrspos.obj + -dll-obj\_gcurcol.obj + -dll-obj\_gcurrow.obj + -dll-obj\_getattr.obj + -dll-obj\_getcbrk.obj + -dll-obj\_getcols.obj + -dll-obj\_getcrsr.obj + -dll-obj\_getfont.obj + -dll-obj\_getrows.obj + -dll-obj\_getscrn.obj + -dll-obj\_gotoxy.obj + -dll-obj\_inswin.obj + -dll-obj\_makenew.obj + -dll-obj\_newline.obj + -dll-obj\_print.obj + -dll-obj\_putc.obj + -dll-obj\_putctty.obj + -dll-obj\_queryad.obj + -dll-obj\_rawgetc.obj + -dll-obj\_rmwin.obj + -dll-obj\_sanity.obj + -dll-obj\_scb.obj + -dll-obj\_scrclos.obj + -dll-obj\_scrnmod.obj + -dll-obj\_scroll.obj + -dll-obj\_scropen.obj + -dll-obj\_set8025.obj + -dll-obj\_setcrsr.obj + -dll-obj\_setfont.obj + -dll-obj\_setrows.obj + -dll-obj\_setscrn.obj + -dll-obj\_sgetnl.obj + -dll-obj\_splitpl.obj + -dll-obj\_sysgetc.obj + -dll-obj\_validch.obj + -dll-obj\_xfrmlin.obj + -dll-obj\_vsscanf.obj + -dll-obj\_usleep.obj + -dll-obj\_debug.obj + -dll-obj\_copywin.obj + -dll-obj\_memmove.obj + -/map +dll-obj\baudrate.obj + +dll-obj\beep.obj + +dll-obj\box.obj + +dll-obj\canchang.obj + +dll-obj\cbreak.obj + +dll-obj\clearok.obj + +dll-obj\colorcon.obj + +dll-obj\def_prog.obj + +dll-obj\def_shel.obj + +dll-obj\delay_ou.obj + +dll-obj\delwin.obj + +dll-obj\doupdate.obj + +dll-obj\echo.obj + +dll-obj\endwin.obj + +dll-obj\erasecha.obj + +dll-obj\fixterm.obj + +dll-obj\flash.obj + +dll-obj\flushinp.obj + +dll-obj\gettmode.obj + +dll-obj\getyx.obj + +dll-obj\has_ic.obj + +dll-obj\has_il.obj + +dll-obj\hascolor.obj + +dll-obj\idlok.obj + +dll-obj\initcolo.obj + +dll-obj\initpair.obj + +dll-obj\initscr.obj + +dll-obj\intrflus.obj + +dll-obj\keyname.obj + +dll-obj\keypad.obj + +dll-obj\killchar.obj + +dll-obj\leaveok.obj + +dll-obj\longname.obj + +dll-obj\meta.obj + +dll-obj\mvcur.obj + +dll-obj\mvprintw.obj + +dll-obj\mvscanw.obj + +dll-obj\mvwin.obj + +dll-obj\mvwprint.obj + +dll-obj\mvwscanw.obj + +dll-obj\newpad.obj + +dll-obj\newterm.obj + +dll-obj\newwin.obj + +dll-obj\nl.obj + +dll-obj\nocbreak.obj + +dll-obj\nodelay.obj + +dll-obj\noecho.obj + +dll-obj\noraw.obj + +dll-obj\overlay.obj + +dll-obj\overwrit.obj + +dll-obj\paircont.obj + +dll-obj\pnoutref.obj + +dll-obj\prefresh.obj + +dll-obj\printw.obj + +dll-obj\raw.obj + +dll-obj\refresh.obj + +dll-obj\reset_pr.obj + +dll-obj\reset_sh.obj + +dll-obj\resetter.obj + +dll-obj\resetty.obj + +dll-obj\saveoldt.obj + +dll-obj\saveterm.obj + +dll-obj\savetty.obj + +dll-obj\scanw.obj + +dll-obj\scroll.obj + +dll-obj\scrollok.obj + +dll-obj\set_term.obj + +dll-obj\setscrrg.obj + +dll-obj\standend.obj + +dll-obj\standout.obj + +dll-obj\startcol.obj + +dll-obj\subwin.obj + +dll-obj\touchlin.obj + +dll-obj\touchwin.obj + +dll-obj\typeahea.obj + +dll-obj\unctrl.obj + +dll-obj\ungetch.obj + +dll-obj\waddch.obj + +dll-obj\waddstr.obj + +dll-obj\wattroff.obj + +dll-obj\wattron.obj + +dll-obj\wattrset.obj + +dll-obj\wclear.obj + +dll-obj\wclrtobo.obj + +dll-obj\wclrtoeo.obj + +dll-obj\wdelch.obj + +dll-obj\wdeletel.obj + +dll-obj\werase.obj + +dll-obj\wgetch.obj + +dll-obj\wgetstr.obj + +dll-obj\winch.obj + +dll-obj\winsch.obj + +dll-obj\winsertl.obj + +dll-obj\wmove.obj + +dll-obj\wnoutref.obj + +dll-obj\wprintw.obj + +dll-obj\wrefresh.obj + +dll-obj\wscanw.obj + +dll-obj\wsetscrr.obj + +dll-obj\wstanden.obj + +dll-obj\wstandou.obj + +dll-obj\curs_set.obj + +dll-obj\nonl.obj + +dll-obj\copywin.obj + +dll-obj\traceon.obj + +dll-obj\traceoff.obj + +dll-obj\border.obj + +dll-obj\breakcha.obj + +dll-obj\cursoff.obj + +dll-obj\curson.obj + +dll-obj\mvwinser.obj + +dll-obj\rawout.obj + +dll-obj\resize.obj + +dll-obj\resizew.obj + +dll-obj\tabsize.obj + +dll-obj\waddraws.obj + +dll-obj\wborder.obj + +dll-obj\winprint.obj + +dll-obj\wordchar.obj + +dll-obj\wtabsize.obj + +dll-obj\_addtail.obj + +dll-obj\_addwin.obj + +dll-obj\_backchr.obj + +dll-obj\_cattr.obj + +dll-obj\_chadd.obj + +dll-obj\_chgattr.obj + +dll-obj\_chins.obj + +dll-obj\_ckbiosk.obj + +dll-obj\_clrscr.obj + +dll-obj\_clrupda.obj + +dll-obj\_findwin.obj + +dll-obj\_fixcurs.obj + +dll-obj\_gbiosky.obj + +dll-obj\_gcrspos.obj + +dll-obj\_gcurcol.obj + +dll-obj\_gcurrow.obj + +dll-obj\_getattr.obj + +dll-obj\_getcbrk.obj + +dll-obj\_getcols.obj + +dll-obj\_getcrsr.obj + +dll-obj\_getfont.obj + +dll-obj\_getrows.obj + +dll-obj\_getscrn.obj + +dll-obj\_gotoxy.obj + +dll-obj\_inswin.obj + +dll-obj\_makenew.obj + +dll-obj\_newline.obj + +dll-obj\_print.obj + +dll-obj\_putc.obj + +dll-obj\_putctty.obj + +dll-obj\_queryad.obj + +dll-obj\_rawgetc.obj + +dll-obj\_rmwin.obj + +dll-obj\_sanity.obj + +dll-obj\_scb.obj + +dll-obj\_scrclos.obj + +dll-obj\_scrnmod.obj + +dll-obj\_scroll.obj + +dll-obj\_scropen.obj + +dll-obj\_set8025.obj + +dll-obj\_setcrsr.obj + +dll-obj\_setfont.obj + +dll-obj\_setrows.obj + +dll-obj\_setscrn.obj + +dll-obj\_sgetnl.obj + +dll-obj\_splitpl.obj + +dll-obj\_sysgetc.obj + +dll-obj\_validch.obj + +dll-obj\_xfrmlin.obj + +dll-obj\_vsscanf.obj + +dll-obj\_usleep.obj + +dll-obj\_debug.obj + +dll-obj\_copywin.obj + +dll-obj\_memmove.obj + +/map diff --git a/os2/wccos2.lrf b/os2/wccos2.lrf index e94ef1fa..72f8cddf 100644 --- a/os2/wccos2.lrf +++ b/os2/wccos2.lrf @@ -1,47 +1,47 @@ -+addch.obj -+addchstr.obj -+addstr.obj -+attr.obj -+beep.obj -+bkgd.obj -+border.obj -+clear.obj -+color.obj -+delch.obj -+deleteln.obj -+getch.obj -+getstr.obj -+getyx.obj -+inch.obj -+inchstr.obj -+initscr.obj -+inopts.obj -+insch.obj -+insstr.obj -+instr.obj -+kernel.obj -+mouse.obj -+move.obj -+outopts.obj -+overlay.obj -+pad.obj -+printw.obj -+refresh.obj -+scanw.obj -+scroll.obj -+slk.obj -+termattr.obj -+terminfo.obj -+touch.obj -+util.obj -+window.obj -+pdcdebug.obj -+pdcdisp.obj -+pdcgetsc.obj -+pdckbd.obj -+pdcprint.obj -+pdcscrn.obj -+pdcsetsc.obj -+pdcutil.obj -+pdcwin.obj -+pdcclip.obj ++addch.obj ++addchstr.obj ++addstr.obj ++attr.obj ++beep.obj ++bkgd.obj ++border.obj ++clear.obj ++color.obj ++delch.obj ++deleteln.obj ++getch.obj ++getstr.obj ++getyx.obj ++inch.obj ++inchstr.obj ++initscr.obj ++inopts.obj ++insch.obj ++insstr.obj ++instr.obj ++kernel.obj ++mouse.obj ++move.obj ++outopts.obj ++overlay.obj ++pad.obj ++printw.obj ++refresh.obj ++scanw.obj ++scroll.obj ++slk.obj ++termattr.obj ++terminfo.obj ++touch.obj ++util.obj ++window.obj ++pdcdebug.obj ++pdcdisp.obj ++pdcgetsc.obj ++pdckbd.obj ++pdcprint.obj ++pdcscrn.obj ++pdcsetsc.obj ++pdcutil.obj ++pdcwin.obj ++pdcclip.obj diff --git a/os2/wccos2.mak b/os2/wccos2.mak index 64b5cd53..4fe87498 100644 --- a/os2/wccos2.mak +++ b/os2/wccos2.mak @@ -1,381 +1,381 @@ -################################################################################ -# -# Watcom WMAKE Makefile for PDCurses library - OS/2 Watcom C/C++ 10.6 -# -# Usage: wmake -f [path\]wccos2.mak [DEBUG=Y] [target] -# -# where target can be any of: -# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] -# -################################################################################ -# -# Change these for your environment... -# -################################################################################ -PDCURSES_HOME =c:\curses -CCINCDIR =k:\h -################################################################################ -# Nothing below here should required changing. -################################################################################ -VER=24 -VERDOT=2.4 - -PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h -PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h -PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) -PANEL_HEADER =$(PDCURSES_HOME)\panel.h - - -srcdir = $(PDCURSES_HOME)\pdcurses -osdir = $(PDCURSES_HOME)\os2 -pandir = $(PDCURSES_HOME)\panel -demodir = $(PDCURSES_HOME)\demos - -CC = wcc386 -TARGET=os2v2 - -!ifeq DEBUG Y -CFLAGS = /d2 /DPDCDEBUG -LDFLAGS = DEBUG -!else -CFLAGS = /oneatx -LDFLAGS = -!endif - -CPPFLAGS = /i=$(PDCURSES_HOME) /i=$(CCINCDIR) - -CCFLAGS = /bt=$(TARGET) /zq /mf $(CFLAGS) $(CPPFLAGS) - -LINK = wlink - -LIBEXE = wlib /q /n - -LIBCURSES = pdcurses.lib -LIBPANEL = panel.lib - -PDCLIBS = $(LIBCURSES) $(LIBPANEL) -DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe - -################################################################################ -all: $(PDCLIBS) $(DEMOS) - -clean: - -del *.obj - -del curses.lib - -del panel.lib - -del *.exe - -demos: $(DEMOS) - -#------------------------------------------------------------------------ - -LIBOBJS = & -addch.obj & -addchstr.obj & -addstr.obj & -attr.obj & -beep.obj & -bkgd.obj & -border.obj & -clear.obj & -color.obj & -delch.obj & -deleteln.obj & -getch.obj & -getstr.obj & -getyx.obj & -inch.obj & -inchstr.obj & -initscr.obj & -inopts.obj & -insch.obj & -insstr.obj & -instr.obj & -kernel.obj & -mouse.obj & -move.obj & -outopts.obj & -overlay.obj & -pad.obj & -printw.obj & -refresh.obj & -scanw.obj & -scroll.obj & -slk.obj & -termattr.obj & -terminfo.obj & -touch.obj & -util.obj & -window.obj - -PDCOBJS = & -pdcclip.obj & -pdcdebug.obj & -pdcdisp.obj & -pdcgetsc.obj & -pdckbd.obj & -pdcprint.obj & -pdcscrn.obj & -pdcsetsc.obj & -pdcutil.obj & -pdcwin.obj - -PANOBJS = & -panel.obj - -pdcurses.lib : $(LIBOBJS) $(PDCOBJS) - $(LIBEXE) $@ @$(osdir)\wccos2.lrf - -panel.lib : $(PANOBJS) - echo +$(PANOBJS) > lib.rsp - $(LIBEXE) $@ @lib.rsp - del lib.rsp - -addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addch.c - -addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addchstr.c - -addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addstr.c - -attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\attr.c - -beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\beep.c - -bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\bkgd.c - -border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\border.c - -clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\clear.c - -color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\color.c - -delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\delch.c - -deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\deleteln.c - -getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getch.c - -getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getstr.c - -getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getyx.c - -inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inch.c - -inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inchstr.c - -initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\initscr.c - -inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inopts.c - -insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insch.c - -insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insstr.c - -instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\instr.c - -kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\kernel.c - -mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\mouse.c - -move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\move.c - -outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\outopts.c - -overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\overlay.c - -pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pad.c - -printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\printw.c - -refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\refresh.c - -scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scanw.c - -scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scroll.c - -slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\slk.c - -termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\termattr.c - -terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\terminfo.c - -touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\touch.c - -util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\util.c - -window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\window.c - - -pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcclip.c - -pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcdebug.c - -pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcdisp.c - -pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcgetsc.c - -pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdckbd.c - -pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcprint.c - -pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcscrn.c - -pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcsetsc.c - -pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcutil.c - -pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) - $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcwin.c - -#------------------------------------------------------------------------ - -panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) - $(CC) $(CCFLAGS) /fo=$@ $(pandir)\panel.c - -#------------------------------------------------------------------------ - -firework.exe: firework.obj $(LIBCURSES) - echo option quiet > demos.lnk - echo system $(TARGET) >> demos.lnk - echo name firework.exe >> demos.lnk - echo file firework.obj >> demos.lnk - echo library $(LIBCURSES) >> demos.lnk - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -newdemo.exe: newdemo.obj $(LIBCURSES) - echo option quiet > demos.lnk - echo system $(TARGET) >> demos.lnk - echo name newdemo.exe >> demos.lnk - echo file newdemo.obj >> demos.lnk - echo library $(LIBCURSES) >> demos.lnk - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) - echo option quiet > demos.lnk - echo system $(TARGET) >> demos.lnk - echo name ptest.exe >> demos.lnk - echo file ptest.obj >> demos.lnk - echo library $(LIBCURSES) >> demos.lnk - echo library $(LIBPANEL) >> demos.lnk - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -testcurs.exe: testcurs.obj $(LIBCURSES) - echo option quiet > demos.lnk - echo system $(TARGET) >> demos.lnk - echo name testcurs.exe >> demos.lnk - echo file testcurs.obj >> demos.lnk - echo library $(LIBCURSES) >> demos.lnk - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) - echo option quiet > demos.lnk - echo system $(TARGET) >> demos.lnk - echo name tuidemo.exe >> demos.lnk - echo file tuidemo.obj >> demos.lnk - echo file tui.obj >> demos.lnk - echo library $(LIBCURSES) >> demos.lnk - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - -xmas.exe: xmas.obj $(LIBCURSES) - echo option quiet > demos.lnk - echo system $(TARGET) >> demos.lnk - echo name xmas.exe >> demos.lnk - echo file xmas.obj >> demos.lnk - echo library $(LIBCURSES) >> demos.lnk - $(LINK) $(LDFLAGS) @demos.lnk - del demos.lnk - - -firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\firework.c - -newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\newdemo.c - -ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\ptest.c - -testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\testcurs.c - -tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tui.c - -tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tuidemo.c - -xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) /fo=$@ $(demodir)\xmas.c - -dist: pdcurses.lib panel.lib - -mkdir tmp - cd tmp - copy $(PDCURSES_HOME)\README README - copy $(PDCURSES_HOME)\readme.?? . - copy $(PDCURSES_HOME)\curses.h . - copy $(PDCURSES_HOME)\curspriv.h . - copy $(PDCURSES_HOME)\maintain.er . - copy ..\pdcurses.lib . - copy ..\panel.lib . - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz - echo PDCurses - Public Domain Curses >> file_id.diz - echo Version $(VERDOT) for Watcom C++ OS/2 PDC$(VER)_WCC_OS2.ZIP >> file_id.diz - echo ------------------------------------------ >> file_id.diz - echo Public Domain Curses library for >> file_id.diz - echo Watcom C/C++ 10.6 for OS/2. >> file_id.diz - echo Source available in PDCURS$(VER).ZIP >> file_id.diz - echo Public Domain. >> file_id.diz - echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz - zip pdc$(VER)_wcc_os2 *.* - cd .. +################################################################################ +# +# Watcom WMAKE Makefile for PDCurses library - OS/2 Watcom C/C++ 10.6 +# +# Usage: wmake -f [path\]wccos2.mak [DEBUG=Y] [target] +# +# where target can be any of: +# [all|demos|pdcurses.lib|panel.lib|testcurs.exe...] +# +################################################################################ +# +# Change these for your environment... +# +################################################################################ +PDCURSES_HOME =c:\curses +CCINCDIR =k:\h +################################################################################ +# Nothing below here should required changing. +################################################################################ +VER=24 +VERDOT=2.4 + +PDCURSES_CURSES_H =$(PDCURSES_HOME)\curses.h +PDCURSES_CURSPRIV_H =$(PDCURSES_HOME)\curspriv.h +PDCURSES_HEADERS =$(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) +PANEL_HEADER =$(PDCURSES_HOME)\panel.h + + +srcdir = $(PDCURSES_HOME)\pdcurses +osdir = $(PDCURSES_HOME)\os2 +pandir = $(PDCURSES_HOME)\panel +demodir = $(PDCURSES_HOME)\demos + +CC = wcc386 +TARGET=os2v2 + +!ifeq DEBUG Y +CFLAGS = /d2 /DPDCDEBUG +LDFLAGS = DEBUG +!else +CFLAGS = /oneatx +LDFLAGS = +!endif + +CPPFLAGS = /i=$(PDCURSES_HOME) /i=$(CCINCDIR) + +CCFLAGS = /bt=$(TARGET) /zq /mf $(CFLAGS) $(CPPFLAGS) + +LINK = wlink + +LIBEXE = wlib /q /n + +LIBCURSES = pdcurses.lib +LIBPANEL = panel.lib + +PDCLIBS = $(LIBCURSES) $(LIBPANEL) +DEMOS =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe + +################################################################################ +all: $(PDCLIBS) $(DEMOS) + +clean: + -del *.obj + -del curses.lib + -del panel.lib + -del *.exe + +demos: $(DEMOS) + +#------------------------------------------------------------------------ + +LIBOBJS = & +addch.obj & +addchstr.obj & +addstr.obj & +attr.obj & +beep.obj & +bkgd.obj & +border.obj & +clear.obj & +color.obj & +delch.obj & +deleteln.obj & +getch.obj & +getstr.obj & +getyx.obj & +inch.obj & +inchstr.obj & +initscr.obj & +inopts.obj & +insch.obj & +insstr.obj & +instr.obj & +kernel.obj & +mouse.obj & +move.obj & +outopts.obj & +overlay.obj & +pad.obj & +printw.obj & +refresh.obj & +scanw.obj & +scroll.obj & +slk.obj & +termattr.obj & +terminfo.obj & +touch.obj & +util.obj & +window.obj + +PDCOBJS = & +pdcclip.obj & +pdcdebug.obj & +pdcdisp.obj & +pdcgetsc.obj & +pdckbd.obj & +pdcprint.obj & +pdcscrn.obj & +pdcsetsc.obj & +pdcutil.obj & +pdcwin.obj + +PANOBJS = & +panel.obj + +pdcurses.lib : $(LIBOBJS) $(PDCOBJS) + $(LIBEXE) $@ @$(osdir)\wccos2.lrf + +panel.lib : $(PANOBJS) + echo +$(PANOBJS) > lib.rsp + $(LIBEXE) $@ @lib.rsp + del lib.rsp + +addch.obj: $(srcdir)\addch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addch.c + +addchstr.obj: $(srcdir)\addchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addchstr.c + +addstr.obj: $(srcdir)\addstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\addstr.c + +attr.obj: $(srcdir)\attr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\attr.c + +beep.obj: $(srcdir)\beep.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\beep.c + +bkgd.obj: $(srcdir)\bkgd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\bkgd.c + +border.obj: $(srcdir)\border.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\border.c + +clear.obj: $(srcdir)\clear.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\clear.c + +color.obj: $(srcdir)\color.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\color.c + +delch.obj: $(srcdir)\delch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\delch.c + +deleteln.obj: $(srcdir)\deleteln.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\deleteln.c + +getch.obj: $(srcdir)\getch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getch.c + +getstr.obj: $(srcdir)\getstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getstr.c + +getyx.obj: $(srcdir)\getyx.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\getyx.c + +inch.obj: $(srcdir)\inch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inch.c + +inchstr.obj: $(srcdir)\inchstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inchstr.c + +initscr.obj: $(srcdir)\initscr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\initscr.c + +inopts.obj: $(srcdir)\inopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\inopts.c + +insch.obj: $(srcdir)\insch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insch.c + +insstr.obj: $(srcdir)\insstr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\insstr.c + +instr.obj: $(srcdir)\instr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\instr.c + +kernel.obj: $(srcdir)\kernel.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\kernel.c + +mouse.obj: $(srcdir)\mouse.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\mouse.c + +move.obj: $(srcdir)\move.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\move.c + +outopts.obj: $(srcdir)\outopts.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\outopts.c + +overlay.obj: $(srcdir)\overlay.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\overlay.c + +pad.obj: $(srcdir)\pad.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pad.c + +printw.obj: $(srcdir)\printw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\printw.c + +refresh.obj: $(srcdir)\refresh.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\refresh.c + +scanw.obj: $(srcdir)\scanw.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scanw.c + +scroll.obj: $(srcdir)\scroll.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\scroll.c + +slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\slk.c + +termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\termattr.c + +terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\terminfo.c + +touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\touch.c + +util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\util.c + +window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\window.c + + +pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcclip.c + +pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcdebug.c + +pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcdisp.c + +pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcgetsc.c + +pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdckbd.c + +pdcprint.obj: $(osdir)\pdcprint.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcprint.c + +pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcscrn.c + +pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(osdir)\pdcsetsc.c + +pdcutil.obj: $(srcdir)\pdcutil.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcutil.c + +pdcwin.obj: $(srcdir)\pdcwin.c $(PDCURSES_HEADERS) + $(CC) $(CCFLAGS) /fo=$@ $(srcdir)\pdcwin.c + +#------------------------------------------------------------------------ + +panel.obj: $(pandir)\panel.c $(PDCURSES_HEADERS) $(PANEL_HEADER) + $(CC) $(CCFLAGS) /fo=$@ $(pandir)\panel.c + +#------------------------------------------------------------------------ + +firework.exe: firework.obj $(LIBCURSES) + echo option quiet > demos.lnk + echo system $(TARGET) >> demos.lnk + echo name firework.exe >> demos.lnk + echo file firework.obj >> demos.lnk + echo library $(LIBCURSES) >> demos.lnk + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +newdemo.exe: newdemo.obj $(LIBCURSES) + echo option quiet > demos.lnk + echo system $(TARGET) >> demos.lnk + echo name newdemo.exe >> demos.lnk + echo file newdemo.obj >> demos.lnk + echo library $(LIBCURSES) >> demos.lnk + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +ptest.exe: ptest.obj $(LIBCURSES) $(LIBPANEL) + echo option quiet > demos.lnk + echo system $(TARGET) >> demos.lnk + echo name ptest.exe >> demos.lnk + echo file ptest.obj >> demos.lnk + echo library $(LIBCURSES) >> demos.lnk + echo library $(LIBPANEL) >> demos.lnk + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +testcurs.exe: testcurs.obj $(LIBCURSES) + echo option quiet > demos.lnk + echo system $(TARGET) >> demos.lnk + echo name testcurs.exe >> demos.lnk + echo file testcurs.obj >> demos.lnk + echo library $(LIBCURSES) >> demos.lnk + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) + echo option quiet > demos.lnk + echo system $(TARGET) >> demos.lnk + echo name tuidemo.exe >> demos.lnk + echo file tuidemo.obj >> demos.lnk + echo file tui.obj >> demos.lnk + echo library $(LIBCURSES) >> demos.lnk + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + +xmas.exe: xmas.obj $(LIBCURSES) + echo option quiet > demos.lnk + echo system $(TARGET) >> demos.lnk + echo name xmas.exe >> demos.lnk + echo file xmas.obj >> demos.lnk + echo library $(LIBCURSES) >> demos.lnk + $(LINK) $(LDFLAGS) @demos.lnk + del demos.lnk + + +firework.obj: $(demodir)\firework.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\firework.c + +newdemo.obj: $(demodir)\newdemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\newdemo.c + +ptest.obj: $(demodir)\ptest.c $(PDCURSES_HOME)\panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\ptest.c + +testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\testcurs.c + +tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tui.c + +tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -I$(demodir) /fo=$@ $(demodir)\tuidemo.c + +xmas.obj: $(demodir)\xmas.c $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) /fo=$@ $(demodir)\xmas.c + +dist: pdcurses.lib panel.lib + -mkdir tmp + cd tmp + copy $(PDCURSES_HOME)\README README + copy $(PDCURSES_HOME)\readme.?? . + copy $(PDCURSES_HOME)\curses.h . + copy $(PDCURSES_HOME)\curspriv.h . + copy $(PDCURSES_HOME)\maintain.er . + copy ..\pdcurses.lib . + copy ..\panel.lib . + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ > file_id.diz + echo PDCurses - Public Domain Curses >> file_id.diz + echo Version $(VERDOT) for Watcom C++ OS/2 PDC$(VER)_WCC_OS2.ZIP >> file_id.diz + echo ------------------------------------------ >> file_id.diz + echo Public Domain Curses library for >> file_id.diz + echo Watcom C/C++ 10.6 for OS/2. >> file_id.diz + echo Source available in PDCURS$(VER).ZIP >> file_id.diz + echo Public Domain. >> file_id.diz + echo ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ >> file_id.diz + zip pdc$(VER)_wcc_os2 *.* + cd .. diff --git a/panel.h b/panel.h index 5a4c6eef..c4bf0733 100644 --- a/panel.h +++ b/panel.h @@ -1,82 +1,82 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -/* -$Id -*/ -/* -*---------------------------------------------------------------------- -* Panels for PDCurses -*---------------------------------------------------------------------- -*/ - -#include - -typedef struct panelobs -{ - struct panelobs *above; - struct panel *pan; -} PANELOBS; - -typedef struct panel -{ - WINDOW *win; - int wstarty; - int wendy; - int wstartx; - int wendx; - struct panel *below; - struct panel *above; - char *user; - struct panelobs *obscure; -} PANEL; - -#ifdef HAVE_PROTO -WINDOW *panel_window(PANEL *pan); -void update_panels(void ); -int hide_panel(PANEL *pan); -int show_panel(PANEL *pan); -int del_panel(PANEL *pan); -int top_panel(PANEL *pan); -int bottom_panel(PANEL *pan); -PANEL *new_panel(WINDOW *win); -PANEL *panel_above(PANEL *pan); -PANEL *panel_below(PANEL *pan); -int set_panel_userptr(PANEL *pan,char *uptr); -char *panel_userptr(PANEL *pan); -int move_panel(PANEL *pan,int starty,int startx); -int replace_panel(PANEL *pan,WINDOW *win); -#else -WINDOW *panel_window( /* PANEL *pan */ ); -void update_panels( /* void */ ); -int hide_panel( /* PANEL *pan */ ); -int show_panel( /* PANEL *pan */ ); -int del_panel( /* PANEL *pan */ ); -int top_panel( /* PANEL *pan */ ); -int bottom_panel( /* PANEL *pan */ ); -PANEL *new_panel( /* WINDOW *win */ ); -PANEL *panel_above( /* PANEL *pan */ ); -PANEL *panel_below( /* PANEL *pan */ ); -int set_panel_userptr( /* PANEL *pan,char *uptr */ ); -char *panel_userptr( /* PANEL *pan */ ); -int move_panel( /* PANEL *pan,int starty,int startx */ ); -int replace_panel( /* PANEL *pan,WINDOW *win */ ); -#endif - -/* end of panel.h */ +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +/* +$Id +*/ +/* +*---------------------------------------------------------------------- +* Panels for PDCurses +*---------------------------------------------------------------------- +*/ + +#include + +typedef struct panelobs +{ + struct panelobs *above; + struct panel *pan; +} PANELOBS; + +typedef struct panel +{ + WINDOW *win; + int wstarty; + int wendy; + int wstartx; + int wendx; + struct panel *below; + struct panel *above; + char *user; + struct panelobs *obscure; +} PANEL; + +#ifdef HAVE_PROTO +WINDOW *panel_window(PANEL *pan); +void update_panels(void ); +int hide_panel(PANEL *pan); +int show_panel(PANEL *pan); +int del_panel(PANEL *pan); +int top_panel(PANEL *pan); +int bottom_panel(PANEL *pan); +PANEL *new_panel(WINDOW *win); +PANEL *panel_above(PANEL *pan); +PANEL *panel_below(PANEL *pan); +int set_panel_userptr(PANEL *pan,char *uptr); +char *panel_userptr(PANEL *pan); +int move_panel(PANEL *pan,int starty,int startx); +int replace_panel(PANEL *pan,WINDOW *win); +#else +WINDOW *panel_window( /* PANEL *pan */ ); +void update_panels( /* void */ ); +int hide_panel( /* PANEL *pan */ ); +int show_panel( /* PANEL *pan */ ); +int del_panel( /* PANEL *pan */ ); +int top_panel( /* PANEL *pan */ ); +int bottom_panel( /* PANEL *pan */ ); +PANEL *new_panel( /* WINDOW *win */ ); +PANEL *panel_above( /* PANEL *pan */ ); +PANEL *panel_below( /* PANEL *pan */ ); +int set_panel_userptr( /* PANEL *pan,char *uptr */ ); +char *panel_userptr( /* PANEL *pan */ ); +int move_panel( /* PANEL *pan,int starty,int startx */ ); +int replace_panel( /* PANEL *pan,WINDOW *win */ ); +#endif + +/* end of panel.h */ diff --git a/panel/Makefile.in b/panel/Makefile.in index 0aa53cde..7660db9b 100644 --- a/panel/Makefile.in +++ b/panel/Makefile.in @@ -1,68 +1,68 @@ -# Makefile for XCurses library -# -# The variable 'srcdir' refers to the source-distribution, and can be set with -# the configure script by "--srcdir=DIR". -# - -SHELL = /bin/sh -THIS = Makefile - -@SET_MAKE@ - -srcdir = @srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -libdir = $(exec_prefix) -includedir = @includedir@ - -PDCURSES_HOME =$(srcdir)/.. -PDCURSES_CURSES_H =$(PDCURSES_HOME)/curses.h - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ - -LN_S = @LN_S@ - -CC = @CC@ -CFLAGS = @CFLAGS@ - -INCDIR = $(srcdir) -CPPFLAGS = -I$(INCDIR) -I$(srcdir)/.. -I.. @DEFS@ -DXCURSES @SYS_DEFS@ - -CCFLAGS = -c $(CFLAGS) $(CPPFLAGS) @MH_XINC_DIR@ - -LINK = $(CC) -LDFLAGS = @LDFLAGS@ @LIBS@ - -RANLIB = @RANLIB@ - -LIBRARIES = libpanel.a - -################################################################################ -all : $(LIBRARIES) - -install : - echo Does nothing at the moment - -clean : - -rm -rf *.o trace $(LIBRARIES) - -distclean: clean - -rm -f Makefile - -mostlyclean: clean - -realclean: distclean - -#------------------------------------------------------------------------ - -OBJS = \ -panel.o - -libpanel.a : $(OBJS) - ar rv $@ $? - $(RANLIB) $@ - -panel.o: $(srcdir)/panel.c $(PDCURSES_HOME)/panel.h $(PDCURSES_CURSES_H) - $(CC) $(CCFLAGS) -o $@ $(srcdir)/panel.c +# Makefile for XCurses library +# +# The variable 'srcdir' refers to the source-distribution, and can be set with +# the configure script by "--srcdir=DIR". +# + +SHELL = /bin/sh +THIS = Makefile + +@SET_MAKE@ + +srcdir = @srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = $(exec_prefix) +includedir = @includedir@ + +PDCURSES_HOME =$(srcdir)/.. +PDCURSES_CURSES_H =$(PDCURSES_HOME)/curses.h + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +LN_S = @LN_S@ + +CC = @CC@ +CFLAGS = @CFLAGS@ + +INCDIR = $(srcdir) +CPPFLAGS = -I$(INCDIR) -I$(srcdir)/.. -I.. @DEFS@ -DXCURSES @SYS_DEFS@ + +CCFLAGS = -c $(CFLAGS) $(CPPFLAGS) @MH_XINC_DIR@ + +LINK = $(CC) +LDFLAGS = @LDFLAGS@ @LIBS@ + +RANLIB = @RANLIB@ + +LIBRARIES = libpanel.a + +################################################################################ +all : $(LIBRARIES) + +install : + echo Does nothing at the moment + +clean : + -rm -rf *.o trace $(LIBRARIES) + +distclean: clean + -rm -f Makefile + +mostlyclean: clean + +realclean: distclean + +#------------------------------------------------------------------------ + +OBJS = \ +panel.o + +libpanel.a : $(OBJS) + ar rv $@ $? + $(RANLIB) $@ + +panel.o: $(srcdir)/panel.c $(PDCURSES_HOME)/panel.h $(PDCURSES_CURSES_H) + $(CC) $(CCFLAGS) -o $@ $(srcdir)/panel.c diff --git a/panel/README b/panel/README index fad374cc..ee8f94aa 100644 --- a/panel/README +++ b/panel/README @@ -1,19 +1,19 @@ - - Welcome to PDCurses - - Contents - -------- - This directory contains source code for a panels library. - - - Distribution Status - ------------------- - - The files in this directory are released to the Public Domain. - - - Acknowlegements - --------------- - - This panles library was provided by Warren Tucker N4HGF - {gatech,emory}!n4hgf!wht -or- wht@n4hgf.Mt-Park.GA.US + + Welcome to PDCurses + + Contents + -------- + This directory contains source code for a panels library. + + + Distribution Status + ------------------- + + The files in this directory are released to the Public Domain. + + + Acknowlegements + --------------- + + This panles library was provided by Warren Tucker N4HGF + {gatech,emory}!n4hgf!wht -or- wht@n4hgf.Mt-Park.GA.US diff --git a/panel/panel.c b/panel/panel.c index 409796a0..538cddfa 100644 --- a/panel/panel.c +++ b/panel/panel.c @@ -1,1003 +1,1003 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#ifdef UNIX -#include -#include -#endif - -#ifdef PDCDEBUG -char *rcsid_panel = "$Id: panel.c,v 1.1 2001/01/10 08:28:00 mark Exp $"; -#endif - - -/*man-start********************************************************************* - - panels - panel package for curses - - PDCurses Description: - The panel library is built using the curses library and any program - using panels routines must call one of the curses initialization - routines such as initscr(). A program using these routines must be - linked with the panels and curses libraries. - - The panels package gives the applications programmer a way to have - depth relationships between curses windows; a curses window is - associated with every panel. The panels routines allow curses windows - to overlap without making visible the overlapped portions of - underlying windows. The initial curses window, stdscr, lies beneath - all panels. The set of currently visible panels is the 'deck' of - panels. - - The panels package allows the applications programmer to create - panels, fetch and set their associated windows, shuffle panels in - the deck, and manipulate panels in other ways. - - PDCurses Return Value: - Each panels routine that returns a pointer to an object returns NULL - if an error occurs. Each panel routine that returns an integer, - returns OK if it executes successfully and ERR if it does not. - - Notes - The header includes the header . - - Credits - Original Author - Warren Tucker N4HGF - {gatech,emory}!n4hgf!wht -or- wht@n4hgf.Mt-Park.GA.US - -**man-end**********************************************************************/ - - -/* - Defined functions: - int bottom_panel(PANEL *pan); - int del_panel(PANEL *pan); - int hide_panel(PANEL *pan); - int move_panel(PANEL *pan,int starty,int startx); - PANEL *new_panel(WINDOW *win); - PANEL *panel_above(PANEL *pan); - PANEL *panel_below(PANEL *pan); - int panel_hidden(PANEL *pan); - char *panel_userptr(PANEL *pan); - WINDOW *panel_window(PANEL *pan); - int replace_panel(PANEL *pan,WINDOW *win); - int set_panel_userptr(PANEL *pan,char *uptr); - int show_panel(PANEL *pan); - int top_panel(PANEL *pan); - void update_panels(void); - - Touchline(pan,start,count) - Touchpan(pan) - Wnoutrefresh(pan) - __calculate_obscure() - __free_obscure(pan) - __override(pan,show) - __panel_is_linked(pan) - __panel_link_bottom(pan) - __panel_link_top(pan) - __panel_unlink(pan) - __panels_overlapped(pan1,pan2) - dPanel(text,pan) - dStack(fmt,num,pan) - open_dfp() - ---------------------------------------------------------------------------*/ -PANEL *__bottom_panel = (PANEL *)0; -PANEL *__top_panel = (PANEL *)0; -PANEL __stdscr_pseudo_panel = { (WINDOW *)0 }; - -#define STATIC static - -/*+------------------------------------------------------------------------- - dPanel(text,pan) ---------------------------------------------------------------------------*/ -#ifdef PANEL_DEBUG -dPanel(text,pan) -char *text; -PANEL *pan; -{ - _tracef("%s id=%s b=%s a=%s y=%d x=%d", - text,pan->user, - (pan->below) ? pan->below->user : "--", - (pan->above) ? pan->above->user : "--", - pan->wstarty, pan->wstartx); -} /* end of dPanel */ -#else -#define dPanel(text,pan) -#endif - -/*+------------------------------------------------------------------------- - dStack(fmt,num,pan) ---------------------------------------------------------------------------*/ -#ifdef PANEL_DEBUG -void -dStack(fmt,num,pan) -char *fmt; -int num; -PANEL *pan; -{ -char s80[80]; - - sprintf(s80,fmt,num,pan); - _tracef("%s b=%s t=%s",s80, - (__bottom_panel) ? __bottom_panel->user : "--", - (__top_panel) ? __top_panel->user : "--"); - if(pan) - _tracef("pan id=%s",pan->user); - pan = __bottom_panel; - while(pan) - { - dPanel("stk",pan); - pan = pan->above; - } -} /* end of dStack */ -#else -#define dStack(fmt,num,pan) -#endif - -/*+------------------------------------------------------------------------- - Wnoutrefresh(pan) - debugging hook for wnoutrefresh ---------------------------------------------------------------------------*/ -#ifdef PANEL_DEBUG -STATIC int -Wnoutrefresh(pan) -PANEL *pan; -{ - dPanel("wnoutrefresh",pan); - wnoutrefresh(pan->win); -} /* end of Wnoutrefresh */ -#else -#define Wnoutrefresh(pan) wnoutrefresh((pan)->win) -#endif - -/*+------------------------------------------------------------------------- - Touchpan(pan) ---------------------------------------------------------------------------*/ -#ifdef PANEL_DEBUG -STATIC int -Touchpan(pan) -PANEL *pan; -{ - dPanel("Touchpan",pan); - touchwin(pan->win); -} /* end of Touchpan */ -#else -#define Touchpan(pan) touchwin((pan)->win) -#endif - -/*+------------------------------------------------------------------------- - Touchline(pan,start,count) ---------------------------------------------------------------------------*/ -#ifdef PANEL_DEBUG -STATIC int -Touchline(pan,start,count) -PANEL *pan; -int start; -int count; -{ -char s80[80]; - sprintf(s80,"Touchline s=%d c=%d",start,count); - dPanel(s80,pan); - touchline(pan->win,start,count); -} /* end of Touchline */ -#else -#define Touchline(pan,start,count) touchline((pan)->win,start,count) -#endif - -/*+------------------------------------------------------------------------- - __panels_overlapped(pan1,pan2) - check panel overlapped ---------------------------------------------------------------------------*/ -STATIC int -__panels_overlapped(pan1,pan2) -register PANEL *pan1; -register PANEL *pan2; -{ - if(!pan1 || !pan2) - return(0); - return((pan1->wstarty >= pan2->wstarty && pan1->wstarty < pan2->wendy) || - (pan2->wstarty >= pan1->wstarty && pan2->wstarty < pan1->wendy)) - && ((pan1->wstartx >= pan2->wstartx && pan1->wstartx < pan2->wendx) || - (pan2->wstartx >= pan1->wstartx && pan2->wstartx < pan1->wendx)); -} /* end of __panels_overlapped */ - -/*+------------------------------------------------------------------------- - __free_obscure(pan) ---------------------------------------------------------------------------*/ -STATIC void -__free_obscure(pan) -PANEL *pan; -{ -PANELOBS *tobs = pan->obscure; /* "this" one */ -PANELOBS *nobs; /* "next" one */ - - while(tobs) - { - nobs = tobs->above; - free((char *)tobs); - tobs = nobs; - } - pan->obscure = (PANELOBS *)0; -} /* end of __free_obscure */ - -/*+------------------------------------------------------------------------- - __override(pan,show) ---------------------------------------------------------------------------*/ -STATIC void -__override(pan,show) -PANEL *pan; -int show; -{ -register int y; -register PANEL *pan2; -PANELOBS *tobs = pan->obscure; /* "this" one */ - - - if(show == 1) - Touchpan(pan); - else if(!show) - { - Touchpan(pan); -/* - Touchline(&__stdscr_pseudo_panel,pan->wendy,getmaxy(pan->win)); -*/ - Touchpan(&__stdscr_pseudo_panel); - } - else if(show == -1) - { - while(tobs && (tobs->pan != pan)) - tobs = tobs->above; - } - - while(tobs) - { - if((pan2 = tobs->pan) != pan) - { - for(y = pan->wstarty; y < pan->wendy; y++) - { - if( (y >= pan2->wstarty) && (y < pan2->wendy) && - ((is_linetouched(pan->win,y - pan->wstarty)) || - (is_linetouched(stdscr,y)))) - { - Touchline(pan2,y - pan2->wstarty,1); - } - } - } - tobs = tobs->above; - } -} /* end of __override */ - -/*+------------------------------------------------------------------------- - __calculate_obscure() ---------------------------------------------------------------------------*/ -STATIC void -__calculate_obscure() -{ -PANEL *pan; -register PANEL *pan2; -register PANELOBS *tobs; /* "this" one */ -PANELOBS *lobs = (PANELOBS *)0; /* last one */ - - pan = __bottom_panel; - while(pan) - { - if(pan->obscure) - __free_obscure(pan); - lobs = (PANELOBS *)0; /* last one */ - pan2 = __bottom_panel; - while(pan2) - { - if(__panels_overlapped(pan,pan2)) - { - if(!(tobs = (PANELOBS *)malloc(sizeof(PANELOBS)))) - return; - tobs->pan = pan2; - dPanel("obscured",pan2); - tobs->above = (PANELOBS *)0; - if(lobs) - lobs->above = tobs; - else - pan->obscure = tobs; - lobs = tobs; - } - pan2 = pan2->above; - } - __override(pan,1); - pan = pan->above; - } - -} /* end of __calculate_obscure */ - -/*+------------------------------------------------------------------------- - __panel_is_linked(pan) - check to see if panel is in the stack ---------------------------------------------------------------------------*/ -STATIC int -__panel_is_linked(pan) -PANEL *pan; -{ -register PANEL *pan2 = __bottom_panel; - - while(pan2) - { - if(pan2 == pan) - return(1); - pan2 = pan2->above; - } - return(OK); -} /* end of __panel_is_linked */ - -/*+------------------------------------------------------------------------- - __panel_link_top(pan) - link panel into stack at top ---------------------------------------------------------------------------*/ -STATIC void -__panel_link_top(pan) -PANEL *pan; -{ - -#ifdef PANEL_DEBUG - dStack("",1,pan); - if(__panel_is_linked(pan)) - return; -#endif - - pan->above = (PANEL *)0; - pan->below = (PANEL *)0; - if(__top_panel) - { - __top_panel->above = pan; - pan->below = __top_panel; - } - __top_panel = pan; - if(!__bottom_panel) - __bottom_panel = pan; - __calculate_obscure(); - dStack("",9,pan); - -} /* end of __panel_link_top */ - -/*+------------------------------------------------------------------------- - __panel_link_bottom(pan) - link panel into stack at bottom ---------------------------------------------------------------------------*/ -STATIC void -__panel_link_bottom(pan) -PANEL *pan; -{ - -#ifdef PANEL_DEBUG - dStack("",1,pan); - if(__panel_is_linked(pan)) - return; -#endif - - pan->above = (PANEL *)0; - pan->below = (PANEL *)0; - if(__bottom_panel) - { - __bottom_panel->below = pan; - pan->above = __bottom_panel; - } - __bottom_panel = pan; - if(!__top_panel) - __top_panel = pan; - __calculate_obscure(); - dStack("",9,pan); - -} /* end of __panel_link_bottom */ - -/*+------------------------------------------------------------------------- - __panel_unlink(pan) - unlink panel from stack ---------------------------------------------------------------------------*/ -STATIC void -__panel_unlink(pan) -PANEL *pan; -{ -register PANEL *prev; -register PANEL *next; - -#ifdef PANEL_DEBUG - dStack("",1,pan); - if(!__panel_is_linked(pan)) - return; -#endif - - __override(pan,0); - __free_obscure(pan); - - prev = pan->below; - next = pan->above; - - if(prev) /* if non-zero, we will not update the list head */ - { - prev->above = next; - if(next) - next->below = prev; - } - else if(next) - next->below = prev; - if(pan == __bottom_panel) - __bottom_panel = next; - if(pan == __top_panel) - __top_panel = prev; - - __calculate_obscure(); - - pan->above = (PANEL *)0; - pan->below = (PANEL *)0; - dStack("",9,pan); - -} /* end of __panel_unlink */ - -/**********************************************************************/ -/* The following are the public functions for the panels library. */ -/**********************************************************************/ - -/*man-start********************************************************************* - - bottom_panel - puts panel at bottom of deck - - PDCurses Description: - This function places pan at the bottom of the deck. The size, location - and contents of the panel are unchanged. - - PDCurses Return Value: - Returns OK or ERR. - - PDCurses Errors: - Returns ERR if pan is NULL. - - Portability: - PDCurses int bottom_panel( PANEL *pan ); - SYS V Curses int bottom_panel( PANEL *pan ); - -**man-end**********************************************************************/ - -int -bottom_panel(pan) -register PANEL *pan; -{ - if(!pan) - return(ERR); - if(pan == __bottom_panel) - return(OK); - if(__panel_is_linked(pan)) - (void)hide_panel(pan); - __panel_link_bottom(pan); - return(OK); -} /* end of bottom_panel */ - -/*man-start********************************************************************* - - del_panel - deletes a panel - - PDCurses Description: - This function deletes pan but not its associated winwow. - - PDCurses Return Value: - Returns OK or ERR. - - PDCurses Errors: - Returns ERR if pan is NULL. - - Portability: - PDCurses int del_panel( PANEL *pan ); - SYS V Curses int del_panel( PANEL *pan ); - -**man-end**********************************************************************/ - -int -del_panel(pan) -register PANEL *pan; -{ - if(pan) - { - if(__panel_is_linked(pan)) - (void)hide_panel(pan); - free((char *)pan); - return(OK); - } - return(ERR); -} /* end of del_panel */ - -/*man-start********************************************************************* - - hide_panel - removes a panel from the deck - - PDCurses Description: - This function removes a panel from the deck and thus hides it from - view. - - PDCurses Return Value: - Returns OK or ERR. - - PDCurses Errors: - Returns ERR if pan is NULL. - - Portability: - PDCurses int hide_panel( PANEL *pan ); - SYS V Curses int hide_panel( PANEL *pan ); - -**man-end**********************************************************************/ - -int -hide_panel(pan) -register PANEL *pan; -{ - - if(!pan) - return(ERR); - - if(!__panel_is_linked(pan)) - { - pan->above = (PANEL *)0; - pan->below = (PANEL *)0; - return(ERR); - } - - __panel_unlink(pan); - - return(OK); -} /* end of hide_panel */ - -/*man-start********************************************************************* - - move_panel - move a window on the virtual screen - - PDCurses Description: - This function move the curses window associated with pan so that - its upper lefthand corner is at the supplied coordinates. Do not - use mvwin() on the window. - - PDCurses Return Value: - Returns OK or ERR. - - PDCurses Errors: - Returns ERR if pan is NULL or an error occurs when - trying to move the curses window. - - Portability: - PDCurses int move_panel( PANEL *pan, int starty, int startx); - SYS V Curses int move_panel( PANEL *pan, int starty, int startx); - -**man-end**********************************************************************/ - -int -move_panel(pan,starty,startx) -PANEL *pan; -int starty; -int startx; -{ -WINDOW *win; - - if(!pan) - return(ERR); - if(__panel_is_linked(pan)) - __override(pan,0); - win = pan->win; - if(mvwin(win,starty,startx) == ERR) - return(ERR); - pan->wstarty = getbegy(win); - pan->wstartx = getbegx(win); - pan->wendy = pan->wstarty + getmaxy(win); - pan->wendx = pan->wstartx + getmaxx(win); - if(__panel_is_linked(pan)) - __calculate_obscure(); - return(OK); -} /* end of move_panel */ - -/*man-start********************************************************************* - - new_panel - create a new panel - - PDCurses Description: - This function creates a new panel associated with win and returns - the panel pointer. The new panel is placed at the top of the deck. - - PDCurses Return Value: - Returns pointer to new panel, or NULL if an error occurs. - - PDCurses Errors: - Returns NULL if an error occurs. - - Portability: - PDCurses PANEL *new_panel( WINDOW *win ); - SYS V Curses PANEL *new_panel( WINDOW *win ); - -**man-end**********************************************************************/ - -PANEL * -new_panel(win) -WINDOW *win; -{ -PANEL *pan = (PANEL *)malloc(sizeof(PANEL)); - - if(!__stdscr_pseudo_panel.win) - { - __stdscr_pseudo_panel.win = stdscr; - __stdscr_pseudo_panel.wstarty = 0; - __stdscr_pseudo_panel.wstartx = 0; - __stdscr_pseudo_panel.wendy = LINES; - __stdscr_pseudo_panel.wendx = COLS; - __stdscr_pseudo_panel.user = "stdscr"; - __stdscr_pseudo_panel.obscure = (PANELOBS *)0; - } - - if(pan) - { - pan->win = win; - pan->above = (PANEL *)0; - pan->below = (PANEL *)0; - pan->wstarty = getbegy(win); - pan->wstartx = getbegx(win); - pan->wendy = pan->wstarty + getmaxy(win); - pan->wendx = pan->wstartx + getmaxx(win); -#ifdef PANEL_DEBUG - pan->user = "new"; -#else - pan->user = (char *)0; -#endif - pan->obscure = (PANELOBS *)0; - (void)show_panel(pan); - } - - return(pan); -} /* end of new_panel */ - -/*man-start********************************************************************* - - panel_above - return pointer to panel above - - PDCurses Description: - This function returns a pointer to the panel in the deck above - pan. If the value of pan passed is NULL, this function returns - a pointer to the bottom panel in the deck. - - PDCurses Return Value: - Returns pointer to panel above pan, or NULL if pan is the top - panel. - - PDCurses Errors: - Returns NULL if an error occurs. - - Portability: - PDCurses PANEL *panel_above( PANEL *pan ); - SYS V Curses PANEL *panel_above( PANEL *pan ); - -**man-end**********************************************************************/ - -PANEL * -panel_above(pan) -PANEL *pan; -{ - if(!pan) - return(__bottom_panel); - else - return(pan->above); -} /* end of panel_above */ - -/*man-start********************************************************************* - - panel_below - return pointer to panel below - - PDCurses Description: - This function returns a pointer to the panel in the deck below - pan. If the value of pan passed is NULL, this function returns - a pointer to the top panel in the deck. - - PDCurses Return Value: - Returns pointer to panel below pan, or NULL if pan is the bottom - panel. - - PDCurses Errors: - Returns NULL if an error occurs. - - Portability: - PDCurses PANEL *panel_below( PANEL *pan ); - SYS V Curses PANEL *panel_below( PANEL *pan ); - -**man-end**********************************************************************/ - -PANEL * -panel_below(pan) -PANEL *pan; -{ - if(!pan) - return(__top_panel); - else - return(pan->below); -} /* end of panel_below */ - -/*man-start********************************************************************* - - panel_hidden - indicates if panel is hidden - - PDCurses Description: - This function returns TRUE if pan is hidden and FALSE if it is not. - - PDCurses Return Value: - TRUE or FALSE. - - PDCurses Errors: - Returns ERR if pan is NULL. - - Portability: - PDCurses int panel_hidden( PANEL *pan ); - SYS V Curses int panel_hidden( PANEL *pan ); - -**man-end**********************************************************************/ - -int -panel_hidden(pan) -PANEL *pan; -{ - if(!pan) - return(ERR); - return(__panel_is_linked(pan) ? ERR : OK); -} /* end of panel_hidden */ - -/*man-start********************************************************************* - - panel_userptr - return user information - - PDCurses Description: - Each panel has a user pointer available for maintaining relevant - information. This function returns a pointer to that information - previously set up by set_panel_userptr(). - - PDCurses Return Value: - Returns pointer to user information. - - PDCurses Errors: - Returns NULL if pan is NULL or no user information exists. - - Portability: - PDCurses char *panel_userptr( PANEL *pan ); - SYS V Curses char *panel_userptr( PANEL *pan ); - -**man-end**********************************************************************/ - -char * -panel_userptr(pan) -PANEL *pan; -{ - if(!pan) - return((char *)0); - return(pan->user); -} /* end of panel_userptr */ - -/*man-start********************************************************************* - - panel_window - returns pointer to curses window - - PDCurses Description: - This function returns a pointer to the curses window associated - with the panel. - - PDCurses Return Value: - Pointer to panel's window. - - PDCurses Errors: - Return NULL on error. - - Portability: - PDCurses WINDOW *panel_window(PANEL *); - SYS V Curses WINDOW *panel_window(PANEL *); - -**man-end**********************************************************************/ - -WINDOW * -panel_window(pan) -PANEL *pan; -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("panel_window() - called\n"); -#endif - return(pan->win); -} /* end of panel_window */ - -/*man-start********************************************************************* - - replace_panel - set curses window contents - - PDCurses Description: - This function replaces the current window of pan with win. - - PDCurses Return Value: - Returns OK or ERR. - - PDCurses Errors: - Returns ERR if pan is NULL. - - Portability: - PDCurses int replace_panel( PANEL *pan, WINDOW *win ); - SYS V Curses int replace_panel( PANEL *pan, WINDOW *win ); - -**man-end**********************************************************************/ - -int -replace_panel(pan,win) -PANEL *pan; -WINDOW *win; -{ - if(!pan) - return(ERR); - if(__panel_is_linked(pan)) - __override(pan,0); - pan->win = win; - pan->wstarty = getbegy(win); - pan->wstartx = getbegx(win); - pan->wendy = pan->wstarty + getmaxy(win); - pan->wendx = pan->wstartx + getmaxx(win); - if(__panel_is_linked(pan)) - __calculate_obscure(); - return(OK); -} /* end of replace_panel */ - -/*man-start********************************************************************* - - set_panel_userptr - sets user information for a panel - - PDCurses Description: - Each panel has a user pointer available for maintaining relevant - information. This function sets the value of that information. - - PDCurses Return Value: - Returns OK or ERR. - - PDCurses Errors: - Returns ERR if pan is NULL. - - Portability: - PDCurses int set_panel_userptr( PANEL *pan, char *uptr ); - SYS V Curses int set_panel_userptr( PANEL *pan, char *uptr ); - -**man-end**********************************************************************/ - -int -set_panel_userptr(pan,uptr) -PANEL *pan; -char *uptr; -{ - if(!pan) - return(ERR); - pan->user = uptr; - return(OK); -} /* end of set_panel_userptr */ - -/*man-start********************************************************************* - - show_panel - displays a panel - - PDCurses Description: - This function makes a previously hidden panel visible and places - it back in the deck on top. - - PDCurses Return Value: - Returns OK or ERR. - - PDCurses Errors: - Returns ERR if pan is NULL. - - Portability: - PDCurses int show_panel( PANEL *pan ); - SYS V Curses int show_panel( PANEL *pan ); - -**man-end**********************************************************************/ - -int -show_panel(pan) -register PANEL *pan; -{ - - if(!pan) - return(ERR); - if(pan == __top_panel) - return(OK); - if(__panel_is_linked(pan)) - (void)hide_panel(pan); - __panel_link_top(pan); - return(OK); -} /* end of show_panel */ - -/*man-start********************************************************************* - - top_panel - puts panel on top of deck - - PDCurses Description: - This function places pan on the top of the deck. The size, location - and contents of the panel are unchanged. - - PDCurses Return Value: - Returns OK or ERR. - - PDCurses Errors: - Returns ERR if pan is NULL. - - Portability: - PDCurses int top_panel( PANEL *pan ); - SYS V Curses int top_panel( PANEL *pan ); - -**man-end**********************************************************************/ - -int -top_panel(pan) -register PANEL *pan; -{ - return(show_panel(pan)); -} /* end of top_panel */ - -/*man-start********************************************************************* - - update_panels - panels virtual screen refresh routine - - PDCurses Description: - This function refreshes the virtual screen to reflect the depth - relationships between the panels in the deck. The user must use - doupdate() to refresh the physical screen. - - PDCurses Return Value: - None - - PDCurses Errors: - None - - Portability: - PDCurses void update_panels( void ) - SYS V Curses void update_panels( void ) - -**man-end**********************************************************************/ - -void -update_panels() -{ -PANEL *pan; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("update_panels() - called\n"); -#endif - - pan = __bottom_panel; - while(pan) - { - __override(pan,-1); - pan = pan->above; - } - - if(is_wintouched(stdscr)) - Wnoutrefresh(&__stdscr_pseudo_panel); - - pan = __bottom_panel; - if(pan) - { - while(pan) - { - if(is_wintouched(pan->win) || !pan->above) - Wnoutrefresh(pan); - pan = pan->above; - } - } -} /* end of update_panels */ - -/* end of panel.c */ +/* +*************************************************************************** +* This file comprises part of PDCurses. PDCurses is Public Domain software. +* You may use this code for whatever purposes you desire. This software +* is provided AS IS with NO WARRANTY whatsoever. +* Should this software be used in another application, an acknowledgement +* that PDCurses code is used would be appreciated, but is not mandatory. +* +* Any changes which you make to this software which may improve or enhance +* it, should be forwarded to the current maintainer for the benefit of +* other users. +* +* The only restriction placed on this code is that no distribution of +* modified PDCurses code be made under the PDCurses name, by anyone +* other than the current maintainer. +* +* See the file maintain.er for details of the current maintainer. +*************************************************************************** +*/ +#define CURSES_LIBRARY 1 + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#ifdef UNIX +#include +#include +#endif + +#ifdef PDCDEBUG +char *rcsid_panel = "$Id: panel.c,v 1.2 2001/01/10 08:28:01 mark Exp $"; +#endif + + +/*man-start********************************************************************* + + panels - panel package for curses + + PDCurses Description: + The panel library is built using the curses library and any program + using panels routines must call one of the curses initialization + routines such as initscr(). A program using these routines must be + linked with the panels and curses libraries. + + The panels package gives the applications programmer a way to have + depth relationships between curses windows; a curses window is + associated with every panel. The panels routines allow curses windows + to overlap without making visible the overlapped portions of + underlying windows. The initial curses window, stdscr, lies beneath + all panels. The set of currently visible panels is the 'deck' of + panels. + + The panels package allows the applications programmer to create + panels, fetch and set their associated windows, shuffle panels in + the deck, and manipulate panels in other ways. + + PDCurses Return Value: + Each panels routine that returns a pointer to an object returns NULL + if an error occurs. Each panel routine that returns an integer, + returns OK if it executes successfully and ERR if it does not. + + Notes + The header includes the header . + + Credits + Original Author - Warren Tucker N4HGF + {gatech,emory}!n4hgf!wht -or- wht@n4hgf.Mt-Park.GA.US + +**man-end**********************************************************************/ + + +/* + Defined functions: + int bottom_panel(PANEL *pan); + int del_panel(PANEL *pan); + int hide_panel(PANEL *pan); + int move_panel(PANEL *pan,int starty,int startx); + PANEL *new_panel(WINDOW *win); + PANEL *panel_above(PANEL *pan); + PANEL *panel_below(PANEL *pan); + int panel_hidden(PANEL *pan); + char *panel_userptr(PANEL *pan); + WINDOW *panel_window(PANEL *pan); + int replace_panel(PANEL *pan,WINDOW *win); + int set_panel_userptr(PANEL *pan,char *uptr); + int show_panel(PANEL *pan); + int top_panel(PANEL *pan); + void update_panels(void); + + Touchline(pan,start,count) + Touchpan(pan) + Wnoutrefresh(pan) + __calculate_obscure() + __free_obscure(pan) + __override(pan,show) + __panel_is_linked(pan) + __panel_link_bottom(pan) + __panel_link_top(pan) + __panel_unlink(pan) + __panels_overlapped(pan1,pan2) + dPanel(text,pan) + dStack(fmt,num,pan) + open_dfp() + +--------------------------------------------------------------------------*/ +PANEL *__bottom_panel = (PANEL *)0; +PANEL *__top_panel = (PANEL *)0; +PANEL __stdscr_pseudo_panel = { (WINDOW *)0 }; + +#define STATIC static + +/*+------------------------------------------------------------------------- + dPanel(text,pan) +--------------------------------------------------------------------------*/ +#ifdef PANEL_DEBUG +dPanel(text,pan) +char *text; +PANEL *pan; +{ + _tracef("%s id=%s b=%s a=%s y=%d x=%d", + text,pan->user, + (pan->below) ? pan->below->user : "--", + (pan->above) ? pan->above->user : "--", + pan->wstarty, pan->wstartx); +} /* end of dPanel */ +#else +#define dPanel(text,pan) +#endif + +/*+------------------------------------------------------------------------- + dStack(fmt,num,pan) +--------------------------------------------------------------------------*/ +#ifdef PANEL_DEBUG +void +dStack(fmt,num,pan) +char *fmt; +int num; +PANEL *pan; +{ +char s80[80]; + + sprintf(s80,fmt,num,pan); + _tracef("%s b=%s t=%s",s80, + (__bottom_panel) ? __bottom_panel->user : "--", + (__top_panel) ? __top_panel->user : "--"); + if(pan) + _tracef("pan id=%s",pan->user); + pan = __bottom_panel; + while(pan) + { + dPanel("stk",pan); + pan = pan->above; + } +} /* end of dStack */ +#else +#define dStack(fmt,num,pan) +#endif + +/*+------------------------------------------------------------------------- + Wnoutrefresh(pan) - debugging hook for wnoutrefresh +--------------------------------------------------------------------------*/ +#ifdef PANEL_DEBUG +STATIC int +Wnoutrefresh(pan) +PANEL *pan; +{ + dPanel("wnoutrefresh",pan); + wnoutrefresh(pan->win); +} /* end of Wnoutrefresh */ +#else +#define Wnoutrefresh(pan) wnoutrefresh((pan)->win) +#endif + +/*+------------------------------------------------------------------------- + Touchpan(pan) +--------------------------------------------------------------------------*/ +#ifdef PANEL_DEBUG +STATIC int +Touchpan(pan) +PANEL *pan; +{ + dPanel("Touchpan",pan); + touchwin(pan->win); +} /* end of Touchpan */ +#else +#define Touchpan(pan) touchwin((pan)->win) +#endif + +/*+------------------------------------------------------------------------- + Touchline(pan,start,count) +--------------------------------------------------------------------------*/ +#ifdef PANEL_DEBUG +STATIC int +Touchline(pan,start,count) +PANEL *pan; +int start; +int count; +{ +char s80[80]; + sprintf(s80,"Touchline s=%d c=%d",start,count); + dPanel(s80,pan); + touchline(pan->win,start,count); +} /* end of Touchline */ +#else +#define Touchline(pan,start,count) touchline((pan)->win,start,count) +#endif + +/*+------------------------------------------------------------------------- + __panels_overlapped(pan1,pan2) - check panel overlapped +--------------------------------------------------------------------------*/ +STATIC int +__panels_overlapped(pan1,pan2) +register PANEL *pan1; +register PANEL *pan2; +{ + if(!pan1 || !pan2) + return(0); + return((pan1->wstarty >= pan2->wstarty && pan1->wstarty < pan2->wendy) || + (pan2->wstarty >= pan1->wstarty && pan2->wstarty < pan1->wendy)) + && ((pan1->wstartx >= pan2->wstartx && pan1->wstartx < pan2->wendx) || + (pan2->wstartx >= pan1->wstartx && pan2->wstartx < pan1->wendx)); +} /* end of __panels_overlapped */ + +/*+------------------------------------------------------------------------- + __free_obscure(pan) +--------------------------------------------------------------------------*/ +STATIC void +__free_obscure(pan) +PANEL *pan; +{ +PANELOBS *tobs = pan->obscure; /* "this" one */ +PANELOBS *nobs; /* "next" one */ + + while(tobs) + { + nobs = tobs->above; + free((char *)tobs); + tobs = nobs; + } + pan->obscure = (PANELOBS *)0; +} /* end of __free_obscure */ + +/*+------------------------------------------------------------------------- + __override(pan,show) +--------------------------------------------------------------------------*/ +STATIC void +__override(pan,show) +PANEL *pan; +int show; +{ +register int y; +register PANEL *pan2; +PANELOBS *tobs = pan->obscure; /* "this" one */ + + + if(show == 1) + Touchpan(pan); + else if(!show) + { + Touchpan(pan); +/* + Touchline(&__stdscr_pseudo_panel,pan->wendy,getmaxy(pan->win)); +*/ + Touchpan(&__stdscr_pseudo_panel); + } + else if(show == -1) + { + while(tobs && (tobs->pan != pan)) + tobs = tobs->above; + } + + while(tobs) + { + if((pan2 = tobs->pan) != pan) + { + for(y = pan->wstarty; y < pan->wendy; y++) + { + if( (y >= pan2->wstarty) && (y < pan2->wendy) && + ((is_linetouched(pan->win,y - pan->wstarty)) || + (is_linetouched(stdscr,y)))) + { + Touchline(pan2,y - pan2->wstarty,1); + } + } + } + tobs = tobs->above; + } +} /* end of __override */ + +/*+------------------------------------------------------------------------- + __calculate_obscure() +--------------------------------------------------------------------------*/ +STATIC void +__calculate_obscure() +{ +PANEL *pan; +register PANEL *pan2; +register PANELOBS *tobs; /* "this" one */ +PANELOBS *lobs = (PANELOBS *)0; /* last one */ + + pan = __bottom_panel; + while(pan) + { + if(pan->obscure) + __free_obscure(pan); + lobs = (PANELOBS *)0; /* last one */ + pan2 = __bottom_panel; + while(pan2) + { + if(__panels_overlapped(pan,pan2)) + { + if(!(tobs = (PANELOBS *)malloc(sizeof(PANELOBS)))) + return; + tobs->pan = pan2; + dPanel("obscured",pan2); + tobs->above = (PANELOBS *)0; + if(lobs) + lobs->above = tobs; + else + pan->obscure = tobs; + lobs = tobs; + } + pan2 = pan2->above; + } + __override(pan,1); + pan = pan->above; + } + +} /* end of __calculate_obscure */ + +/*+------------------------------------------------------------------------- + __panel_is_linked(pan) - check to see if panel is in the stack +--------------------------------------------------------------------------*/ +STATIC int +__panel_is_linked(pan) +PANEL *pan; +{ +register PANEL *pan2 = __bottom_panel; + + while(pan2) + { + if(pan2 == pan) + return(1); + pan2 = pan2->above; + } + return(OK); +} /* end of __panel_is_linked */ + +/*+------------------------------------------------------------------------- + __panel_link_top(pan) - link panel into stack at top +--------------------------------------------------------------------------*/ +STATIC void +__panel_link_top(pan) +PANEL *pan; +{ + +#ifdef PANEL_DEBUG + dStack("",1,pan); + if(__panel_is_linked(pan)) + return; +#endif + + pan->above = (PANEL *)0; + pan->below = (PANEL *)0; + if(__top_panel) + { + __top_panel->above = pan; + pan->below = __top_panel; + } + __top_panel = pan; + if(!__bottom_panel) + __bottom_panel = pan; + __calculate_obscure(); + dStack("",9,pan); + +} /* end of __panel_link_top */ + +/*+------------------------------------------------------------------------- + __panel_link_bottom(pan) - link panel into stack at bottom +--------------------------------------------------------------------------*/ +STATIC void +__panel_link_bottom(pan) +PANEL *pan; +{ + +#ifdef PANEL_DEBUG + dStack("",1,pan); + if(__panel_is_linked(pan)) + return; +#endif + + pan->above = (PANEL *)0; + pan->below = (PANEL *)0; + if(__bottom_panel) + { + __bottom_panel->below = pan; + pan->above = __bottom_panel; + } + __bottom_panel = pan; + if(!__top_panel) + __top_panel = pan; + __calculate_obscure(); + dStack("",9,pan); + +} /* end of __panel_link_bottom */ + +/*+------------------------------------------------------------------------- + __panel_unlink(pan) - unlink panel from stack +--------------------------------------------------------------------------*/ +STATIC void +__panel_unlink(pan) +PANEL *pan; +{ +register PANEL *prev; +register PANEL *next; + +#ifdef PANEL_DEBUG + dStack("",1,pan); + if(!__panel_is_linked(pan)) + return; +#endif + + __override(pan,0); + __free_obscure(pan); + + prev = pan->below; + next = pan->above; + + if(prev) /* if non-zero, we will not update the list head */ + { + prev->above = next; + if(next) + next->below = prev; + } + else if(next) + next->below = prev; + if(pan == __bottom_panel) + __bottom_panel = next; + if(pan == __top_panel) + __top_panel = prev; + + __calculate_obscure(); + + pan->above = (PANEL *)0; + pan->below = (PANEL *)0; + dStack("",9,pan); + +} /* end of __panel_unlink */ + +/**********************************************************************/ +/* The following are the public functions for the panels library. */ +/**********************************************************************/ + +/*man-start********************************************************************* + + bottom_panel - puts panel at bottom of deck + + PDCurses Description: + This function places pan at the bottom of the deck. The size, location + and contents of the panel are unchanged. + + PDCurses Return Value: + Returns OK or ERR. + + PDCurses Errors: + Returns ERR if pan is NULL. + + Portability: + PDCurses int bottom_panel( PANEL *pan ); + SYS V Curses int bottom_panel( PANEL *pan ); + +**man-end**********************************************************************/ + +int +bottom_panel(pan) +register PANEL *pan; +{ + if(!pan) + return(ERR); + if(pan == __bottom_panel) + return(OK); + if(__panel_is_linked(pan)) + (void)hide_panel(pan); + __panel_link_bottom(pan); + return(OK); +} /* end of bottom_panel */ + +/*man-start********************************************************************* + + del_panel - deletes a panel + + PDCurses Description: + This function deletes pan but not its associated winwow. + + PDCurses Return Value: + Returns OK or ERR. + + PDCurses Errors: + Returns ERR if pan is NULL. + + Portability: + PDCurses int del_panel( PANEL *pan ); + SYS V Curses int del_panel( PANEL *pan ); + +**man-end**********************************************************************/ + +int +del_panel(pan) +register PANEL *pan; +{ + if(pan) + { + if(__panel_is_linked(pan)) + (void)hide_panel(pan); + free((char *)pan); + return(OK); + } + return(ERR); +} /* end of del_panel */ + +/*man-start********************************************************************* + + hide_panel - removes a panel from the deck + + PDCurses Description: + This function removes a panel from the deck and thus hides it from + view. + + PDCurses Return Value: + Returns OK or ERR. + + PDCurses Errors: + Returns ERR if pan is NULL. + + Portability: + PDCurses int hide_panel( PANEL *pan ); + SYS V Curses int hide_panel( PANEL *pan ); + +**man-end**********************************************************************/ + +int +hide_panel(pan) +register PANEL *pan; +{ + + if(!pan) + return(ERR); + + if(!__panel_is_linked(pan)) + { + pan->above = (PANEL *)0; + pan->below = (PANEL *)0; + return(ERR); + } + + __panel_unlink(pan); + + return(OK); +} /* end of hide_panel */ + +/*man-start********************************************************************* + + move_panel - move a window on the virtual screen + + PDCurses Description: + This function move the curses window associated with pan so that + its upper lefthand corner is at the supplied coordinates. Do not + use mvwin() on the window. + + PDCurses Return Value: + Returns OK or ERR. + + PDCurses Errors: + Returns ERR if pan is NULL or an error occurs when + trying to move the curses window. + + Portability: + PDCurses int move_panel( PANEL *pan, int starty, int startx); + SYS V Curses int move_panel( PANEL *pan, int starty, int startx); + +**man-end**********************************************************************/ + +int +move_panel(pan,starty,startx) +PANEL *pan; +int starty; +int startx; +{ +WINDOW *win; + + if(!pan) + return(ERR); + if(__panel_is_linked(pan)) + __override(pan,0); + win = pan->win; + if(mvwin(win,starty,startx) == ERR) + return(ERR); + pan->wstarty = getbegy(win); + pan->wstartx = getbegx(win); + pan->wendy = pan->wstarty + getmaxy(win); + pan->wendx = pan->wstartx + getmaxx(win); + if(__panel_is_linked(pan)) + __calculate_obscure(); + return(OK); +} /* end of move_panel */ + +/*man-start********************************************************************* + + new_panel - create a new panel + + PDCurses Description: + This function creates a new panel associated with win and returns + the panel pointer. The new panel is placed at the top of the deck. + + PDCurses Return Value: + Returns pointer to new panel, or NULL if an error occurs. + + PDCurses Errors: + Returns NULL if an error occurs. + + Portability: + PDCurses PANEL *new_panel( WINDOW *win ); + SYS V Curses PANEL *new_panel( WINDOW *win ); + +**man-end**********************************************************************/ + +PANEL * +new_panel(win) +WINDOW *win; +{ +PANEL *pan = (PANEL *)malloc(sizeof(PANEL)); + + if(!__stdscr_pseudo_panel.win) + { + __stdscr_pseudo_panel.win = stdscr; + __stdscr_pseudo_panel.wstarty = 0; + __stdscr_pseudo_panel.wstartx = 0; + __stdscr_pseudo_panel.wendy = LINES; + __stdscr_pseudo_panel.wendx = COLS; + __stdscr_pseudo_panel.user = "stdscr"; + __stdscr_pseudo_panel.obscure = (PANELOBS *)0; + } + + if(pan) + { + pan->win = win; + pan->above = (PANEL *)0; + pan->below = (PANEL *)0; + pan->wstarty = getbegy(win); + pan->wstartx = getbegx(win); + pan->wendy = pan->wstarty + getmaxy(win); + pan->wendx = pan->wstartx + getmaxx(win); +#ifdef PANEL_DEBUG + pan->user = "new"; +#else + pan->user = (char *)0; +#endif + pan->obscure = (PANELOBS *)0; + (void)show_panel(pan); + } + + return(pan); +} /* end of new_panel */ + +/*man-start********************************************************************* + + panel_above - return pointer to panel above + + PDCurses Description: + This function returns a pointer to the panel in the deck above + pan. If the value of pan passed is NULL, this function returns + a pointer to the bottom panel in the deck. + + PDCurses Return Value: + Returns pointer to panel above pan, or NULL if pan is the top + panel. + + PDCurses Errors: + Returns NULL if an error occurs. + + Portability: + PDCurses PANEL *panel_above( PANEL *pan ); + SYS V Curses PANEL *panel_above( PANEL *pan ); + +**man-end**********************************************************************/ + +PANEL * +panel_above(pan) +PANEL *pan; +{ + if(!pan) + return(__bottom_panel); + else + return(pan->above); +} /* end of panel_above */ + +/*man-start********************************************************************* + + panel_below - return pointer to panel below + + PDCurses Description: + This function returns a pointer to the panel in the deck below + pan. If the value of pan passed is NULL, this function returns + a pointer to the top panel in the deck. + + PDCurses Return Value: + Returns pointer to panel below pan, or NULL if pan is the bottom + panel. + + PDCurses Errors: + Returns NULL if an error occurs. + + Portability: + PDCurses PANEL *panel_below( PANEL *pan ); + SYS V Curses PANEL *panel_below( PANEL *pan ); + +**man-end**********************************************************************/ + +PANEL * +panel_below(pan) +PANEL *pan; +{ + if(!pan) + return(__top_panel); + else + return(pan->below); +} /* end of panel_below */ + +/*man-start********************************************************************* + + panel_hidden - indicates if panel is hidden + + PDCurses Description: + This function returns TRUE if pan is hidden and FALSE if it is not. + + PDCurses Return Value: + TRUE or FALSE. + + PDCurses Errors: + Returns ERR if pan is NULL. + + Portability: + PDCurses int panel_hidden( PANEL *pan ); + SYS V Curses int panel_hidden( PANEL *pan ); + +**man-end**********************************************************************/ + +int +panel_hidden(pan) +PANEL *pan; +{ + if(!pan) + return(ERR); + return(__panel_is_linked(pan) ? ERR : OK); +} /* end of panel_hidden */ + +/*man-start********************************************************************* + + panel_userptr - return user information + + PDCurses Description: + Each panel has a user pointer available for maintaining relevant + information. This function returns a pointer to that information + previously set up by set_panel_userptr(). + + PDCurses Return Value: + Returns pointer to user information. + + PDCurses Errors: + Returns NULL if pan is NULL or no user information exists. + + Portability: + PDCurses char *panel_userptr( PANEL *pan ); + SYS V Curses char *panel_userptr( PANEL *pan ); + +**man-end**********************************************************************/ + +char * +panel_userptr(pan) +PANEL *pan; +{ + if(!pan) + return((char *)0); + return(pan->user); +} /* end of panel_userptr */ + +/*man-start********************************************************************* + + panel_window - returns pointer to curses window + + PDCurses Description: + This function returns a pointer to the curses window associated + with the panel. + + PDCurses Return Value: + Pointer to panel's window. + + PDCurses Errors: + Return NULL on error. + + Portability: + PDCurses WINDOW *panel_window(PANEL *); + SYS V Curses WINDOW *panel_window(PANEL *); + +**man-end**********************************************************************/ + +WINDOW * +panel_window(pan) +PANEL *pan; +{ +#ifdef PDCDEBUG + if (trace_on) PDC_debug("panel_window() - called\n"); +#endif + return(pan->win); +} /* end of panel_window */ + +/*man-start********************************************************************* + + replace_panel - set curses window contents + + PDCurses Description: + This function replaces the current window of pan with win. + + PDCurses Return Value: + Returns OK or ERR. + + PDCurses Errors: + Returns ERR if pan is NULL. + + Portability: + PDCurses int replace_panel( PANEL *pan, WINDOW *win ); + SYS V Curses int replace_panel( PANEL *pan, WINDOW *win ); + +**man-end**********************************************************************/ + +int +replace_panel(pan,win) +PANEL *pan; +WINDOW *win; +{ + if(!pan) + return(ERR); + if(__panel_is_linked(pan)) + __override(pan,0); + pan->win = win; + pan->wstarty = getbegy(win); + pan->wstartx = getbegx(win); + pan->wendy = pan->wstarty + getmaxy(win); + pan->wendx = pan->wstartx + getmaxx(win); + if(__panel_is_linked(pan)) + __calculate_obscure(); + return(OK); +} /* end of replace_panel */ + +/*man-start********************************************************************* + + set_panel_userptr - sets user information for a panel + + PDCurses Description: + Each panel has a user pointer available for maintaining relevant + information. This function sets the value of that information. + + PDCurses Return Value: + Returns OK or ERR. + + PDCurses Errors: + Returns ERR if pan is NULL. + + Portability: + PDCurses int set_panel_userptr( PANEL *pan, char *uptr ); + SYS V Curses int set_panel_userptr( PANEL *pan, char *uptr ); + +**man-end**********************************************************************/ + +int +set_panel_userptr(pan,uptr) +PANEL *pan; +char *uptr; +{ + if(!pan) + return(ERR); + pan->user = uptr; + return(OK); +} /* end of set_panel_userptr */ + +/*man-start********************************************************************* + + show_panel - displays a panel + + PDCurses Description: + This function makes a previously hidden panel visible and places + it back in the deck on top. + + PDCurses Return Value: + Returns OK or ERR. + + PDCurses Errors: + Returns ERR if pan is NULL. + + Portability: + PDCurses int show_panel( PANEL *pan ); + SYS V Curses int show_panel( PANEL *pan ); + +**man-end**********************************************************************/ + +int +show_panel(pan) +register PANEL *pan; +{ + + if(!pan) + return(ERR); + if(pan == __top_panel) + return(OK); + if(__panel_is_linked(pan)) + (void)hide_panel(pan); + __panel_link_top(pan); + return(OK); +} /* end of show_panel */ + +/*man-start********************************************************************* + + top_panel - puts panel on top of deck + + PDCurses Description: + This function places pan on the top of the deck. The size, location + and contents of the panel are unchanged. + + PDCurses Return Value: + Returns OK or ERR. + + PDCurses Errors: + Returns ERR if pan is NULL. + + Portability: + PDCurses int top_panel( PANEL *pan ); + SYS V Curses int top_panel( PANEL *pan ); + +**man-end**********************************************************************/ + +int +top_panel(pan) +register PANEL *pan; +{ + return(show_panel(pan)); +} /* end of top_panel */ + +/*man-start********************************************************************* + + update_panels - panels virtual screen refresh routine + + PDCurses Description: + This function refreshes the virtual screen to reflect the depth + relationships between the panels in the deck. The user must use + doupdate() to refresh the physical screen. + + PDCurses Return Value: + None + + PDCurses Errors: + None + + Portability: + PDCurses void update_panels( void ) + SYS V Curses void update_panels( void ) + +**man-end**********************************************************************/ + +void +update_panels() +{ +PANEL *pan; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("update_panels() - called\n"); +#endif + + pan = __bottom_panel; + while(pan) + { + __override(pan,-1); + pan = pan->above; + } + + if(is_wintouched(stdscr)) + Wnoutrefresh(&__stdscr_pseudo_panel); + + pan = __bottom_panel; + if(pan) + { + while(pan) + { + if(is_wintouched(pan->win) || !pan->above) + Wnoutrefresh(pan); + pan = pan->above; + } + } +} /* end of update_panels */ + +/* end of panel.c */