From c0a01636cb6349dde3d2d7b83ce3c4daaf07fd91 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Mon, 9 Oct 2006 00:11:14 +0000 Subject: [PATCH] Added a common pdcos2.h for OS/2, like pdcwin.h for Win32. --- os2/gccos2.mak | 6 +++--- os2/iccos2.mak | 22 ++++++++++++---------- os2/pdcclip.c | 12 +++--------- os2/pdcdisp.c | 10 +++------- os2/pdcgetsc.c | 10 +++------- os2/pdckbd.c | 9 ++------- os2/pdcos2.h | 33 +++++++++++++++++++++++++++++++++ os2/pdcscrn.c | 11 +++-------- os2/pdcsetsc.c | 10 +++------- os2/pdcutil.c | 9 ++------- 10 files changed, 67 insertions(+), 65 deletions(-) create mode 100644 os2/pdcos2.h diff --git a/os2/gccos2.mak b/os2/gccos2.mak index e21ef221..7fbf2d66 100644 --- a/os2/gccos2.mak +++ b/os2/gccos2.mak @@ -28,6 +28,8 @@ include $(PDCURSES_HOME)/libobjs.mif osdir = $(PDCURSES_HOME)/os2 +PDCURSES_OS2_H = $(osdir)/pdcos2.h + CC = gcc ifeq ($(EMXVIDEO),Y) @@ -121,11 +123,9 @@ panel.lib: panel.a $(LIBOBJS) $(DLLOBJS) $(PDCOBJS) $(PDCDLOS) $(PANOBJS) $(DEMOOBJS) : \ $(PDCURSES_HEADERS) - +$(PDCOBJS) : $(PDCURSES_OS2_H) $(PANOBJS) ptest.o: $(PANEL_HEADER) - $(DEMOS) : $(LIBCURSES) - terminfo.o terminfo.dlo: $(TERM_HEADER) $(LIBOBJS) : %.o: $(srcdir)/%.c diff --git a/os2/iccos2.mak b/os2/iccos2.mak index fe323796..60477803 100644 --- a/os2/iccos2.mak +++ b/os2/iccos2.mak @@ -25,6 +25,8 @@ O = obj osdir = $(PDCURSES_HOME)\os2 +PDCURSES_OS2_H = $(osdir)\pdcos2.h + CC = icc !ifdef DEBUG @@ -180,29 +182,29 @@ util.obj: $(srcdir)\util.c $(PDCURSES_HEADERS) window.obj: $(srcdir)\window.c $(PDCURSES_HEADERS) $(BUILD) $(srcdir)\window.c - -pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) - $(BUILD) $(osdir)\pdcclip.c - pdcdebug.obj: $(srcdir)\pdcdebug.c $(PDCURSES_HEADERS) $(BUILD) $(srcdir)\pdcdebug.c -pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) + +pdcclip.obj: $(osdir)\pdcclip.c $(PDCURSES_HEADERS) $(PDCURSES_OS2_H) + $(BUILD) $(osdir)\pdcclip.c + +pdcdisp.obj: $(osdir)\pdcdisp.c $(PDCURSES_HEADERS) $(PDCURSES_OS2_H) $(BUILD) $(osdir)\pdcdisp.c -pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) +pdcgetsc.obj: $(osdir)\pdcgetsc.c $(PDCURSES_HEADERS) $(PDCURSES_OS2_H) $(BUILD) $(osdir)\pdcgetsc.c -pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) +pdckbd.obj: $(osdir)\pdckbd.c $(PDCURSES_HEADERS) $(PDCURSES_OS2_H) $(BUILD) $(osdir)\pdckbd.c -pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) +pdcscrn.obj: $(osdir)\pdcscrn.c $(PDCURSES_HEADERS) $(PDCURSES_OS2_H) $(BUILD) $(osdir)\pdcscrn.c -pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) +pdcsetsc.obj: $(osdir)\pdcsetsc.c $(PDCURSES_HEADERS) $(PDCURSES_OS2_H) $(BUILD) $(osdir)\pdcsetsc.c -pdcutil.obj: $(osdir)\pdcutil.c $(PDCURSES_HEADERS) +pdcutil.obj: $(osdir)\pdcutil.c $(PDCURSES_HEADERS) $(PDCURSES_OS2_H) $(BUILD) $(osdir)\pdcutil.c #------------------------------------------------------------------------ diff --git a/os2/pdcclip.c b/os2/pdcclip.c index f23c3c49..bff6c204 100644 --- a/os2/pdcclip.c +++ b/os2/pdcclip.c @@ -15,18 +15,12 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -#ifndef EMXVIDEO -# define INCL_DOS -# define INCL_WIN -# define INCL_VIO -# define INCL_KBD -# include -#endif -#include +#include "pdcos2.h" + #include #include -RCSID("$Id: pdcclip.c,v 1.23 2006/10/08 20:54:30 wmcbrine Exp $"); +RCSID("$Id: pdcclip.c,v 1.24 2006/10/09 00:11:14 wmcbrine Exp $"); /*man-start************************************************************** diff --git a/os2/pdcdisp.c b/os2/pdcdisp.c index 79cce322..d167791a 100644 --- a/os2/pdcdisp.c +++ b/os2/pdcdisp.c @@ -15,15 +15,11 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -#ifndef EMXVIDEO -# define INCL_VIO -# define INCL_KBD -# include -#endif -#include +#include "pdcos2.h" + #include -RCSID("$Id: pdcdisp.c,v 1.37 2006/10/08 20:54:30 wmcbrine Exp $"); +RCSID("$Id: pdcdisp.c,v 1.38 2006/10/09 00:11:14 wmcbrine Exp $"); /*man-start************************************************************** diff --git a/os2/pdcgetsc.c b/os2/pdcgetsc.c index dafe4a48..701068c4 100644 --- a/os2/pdcgetsc.c +++ b/os2/pdcgetsc.c @@ -15,15 +15,11 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -#ifndef EMXVIDEO -# define INCL_VIO -# define INCL_KBD -# include -#endif -#include +#include "pdcos2.h" + #include -RCSID("$Id: pdcgetsc.c,v 1.28 2006/10/08 20:54:30 wmcbrine Exp $"); +RCSID("$Id: pdcgetsc.c,v 1.29 2006/10/09 00:11:14 wmcbrine Exp $"); /*man-start************************************************************** diff --git a/os2/pdckbd.c b/os2/pdckbd.c index 6186da82..2be48e84 100644 --- a/os2/pdckbd.c +++ b/os2/pdckbd.c @@ -15,12 +15,7 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -#ifndef EMXVIDEO -# define INCL_VIO -# define INCL_KBD -# include -#endif -#include +#include "pdcos2.h" #if defined(CURSES__32BIT__) || defined(__IBMC__) || defined(__TURBOC__) # include @@ -37,7 +32,7 @@ static int tahead = -1; static KBDINFO kbdinfo; /* default keyboard mode */ #endif -RCSID("$Id: pdckbd.c,v 1.39 2006/10/08 20:54:30 wmcbrine Exp $"); +RCSID("$Id: pdckbd.c,v 1.40 2006/10/09 00:11:14 wmcbrine Exp $"); /************************************************************************ * Table for key code translation of function keys in keypad mode * diff --git a/os2/pdcos2.h b/os2/pdcos2.h new file mode 100644 index 00000000..c228ad84 --- /dev/null +++ b/os2/pdcos2.h @@ -0,0 +1,33 @@ +/************************************************************************ + * This file is part of PDCurses. PDCurses is public domain software; * + * you may use it for any purpose. This software is provided AS IS with * + * NO WARRANTY whatsoever. * + * * + * If you use PDCurses in an application, an acknowledgement would be * + * appreciated, but is not mandatory. If you make corrections or * + * enhancements to PDCurses, please forward them to the current * + * maintainer for the benefit of other users. * + * * + * No distribution of modified PDCurses code may be made under the name * + * "PDCurses", except by the current maintainer. (Although PDCurses is * + * public domain, the name is a trademark.) * + * * + * See the file maintain.er for details of the current maintainer. * + ************************************************************************/ + +/* $Id: pdcos2.h,v 1.1 2006/10/09 00:11:14 wmcbrine Exp $ */ + +#ifndef EMXVIDEO +# define INCL_DOS +# define INCL_DOSMISC +# define INCL_WIN +# define INCL_VIO +# define INCL_KBD +# include +#endif +#include + +extern int pdc_font; + +extern void PDC_get_keyboard_info(void); +extern void PDC_set_keyboard_default(void); diff --git a/os2/pdcscrn.c b/os2/pdcscrn.c index 269ba0a1..6b5d5693 100644 --- a/os2/pdcscrn.c +++ b/os2/pdcscrn.c @@ -15,16 +15,11 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -#ifndef EMXVIDEO -# define INCL_DOSMISC -# define INCL_VIO -# define INCL_KBD -# include -#endif -#include +#include "pdcos2.h" + #include -RCSID("$Id: pdcscrn.c,v 1.51 2006/10/08 20:54:30 wmcbrine Exp $"); +RCSID("$Id: pdcscrn.c,v 1.52 2006/10/09 00:11:14 wmcbrine Exp $"); int pdc_font; /* default font size */ diff --git a/os2/pdcsetsc.c b/os2/pdcsetsc.c index 7c56196f..4f1f8b13 100644 --- a/os2/pdcsetsc.c +++ b/os2/pdcsetsc.c @@ -15,15 +15,11 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -#ifndef EMXVIDEO -# define INCL_VIO -# define INCL_KBD -# include -#endif -#include +#include "pdcos2.h" + #include -RCSID("$Id: pdcsetsc.c,v 1.32 2006/10/08 20:54:30 wmcbrine Exp $"); +RCSID("$Id: pdcsetsc.c,v 1.33 2006/10/09 00:11:14 wmcbrine Exp $"); extern int pdc_font; diff --git a/os2/pdcutil.c b/os2/pdcutil.c index 73e41855..939cc0ba 100644 --- a/os2/pdcutil.c +++ b/os2/pdcutil.c @@ -15,12 +15,7 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -#ifndef EMXVIDEO -# define INCL_VIO -# define INCL_KBD -# include -#endif -#include +#include "pdcos2.h" #ifdef __EMX__ # include @@ -30,7 +25,7 @@ APIRET APIENTRY DosSleep(ULONG ulTime); #endif -RCSID("$Id: pdcutil.c,v 1.7 2006/10/08 20:54:30 wmcbrine Exp $"); +RCSID("$Id: pdcutil.c,v 1.8 2006/10/09 00:11:14 wmcbrine Exp $"); void PDC_beep(void) {