More ifdef cleanup -- DOS and OS/2 prototypes moved out of curspriv.h,

etc.
This commit is contained in:
William McBrine
2006-08-11 07:04:31 +00:00
parent 9741a9bbb9
commit d07701650c
9 changed files with 41 additions and 96 deletions

View File

@@ -15,7 +15,7 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
/* $Id: curses.h,v 1.208 2006/08/10 08:43:36 wmcbrine Exp $ */
/* $Id: curses.h,v 1.209 2006/08/11 07:04:31 wmcbrine Exp $ */
/*----------------------------------------------------------------------*
* PDCurses *
@@ -608,7 +608,6 @@ typedef struct
# else
VIOMODEINFO scrnmode; /* default screen mode */
VIOCONFIGINFO adapter; /* Screen type */
KBDINFO kbdinfo; /* keyboard info */
# endif
#else
int adapter; /* Screen type */

View File

@@ -15,7 +15,7 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
/* $Id: curspriv.h,v 1.110 2006/08/11 06:17:48 wmcbrine Exp $ */
/* $Id: curspriv.h,v 1.111 2006/08/11 07:04:31 wmcbrine Exp $ */
/* CURSPRIV.H
@@ -54,8 +54,6 @@ struct cttyset
extern struct cttyset ctty[3];
enum { PDC_SH_TTY, PDC_PR_TTY, PDC_SAVE_TTY };
/* tracing flag */
extern bool trace_on;
@@ -114,19 +112,6 @@ void PDC_sync(WINDOW *);
void PDC_transform_line(int, int, int, const chtype *);
int PDC_validchar(int);
#if defined(OS2) && !defined(EMXVIDEO)
int PDC_set_scrn_mode(VIOMODEINFO);
bool PDC_scrn_modes_equal(VIOMODEINFO, VIOMODEINFO);
int PDC_get_scrn_mode(VIOMODEINFO *);
int PDC_query_adapter_type(VIOCONFIGINFO *);
void PDC_get_keyboard_info(void);
void PDC_set_keyboard_default(void);
#else
int PDC_set_scrn_mode(int);
int PDC_get_scrn_mode(void);
int PDC_query_adapter_type(void);
#endif
#ifdef XCURSES
# define PDC_scr_exit() XCursesExit()
#else

View File

@@ -15,7 +15,7 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
/* $Id: pdcdos.h,v 1.5 2006/07/29 06:00:54 wmcbrine Exp $ */
/* $Id: pdcdos.h,v 1.6 2006/08/11 07:04:31 wmcbrine Exp $ */
#define CURSES_LIBRARY 1
#include <curses.h>
@@ -116,5 +116,8 @@ enum
void movedata(unsigned, unsigned, unsigned, unsigned, unsigned);
#endif
int PDC_set_80x25(void);
int PDC_get_scrn_mode(void);
void PDC_putctty(chtype);
int PDC_query_adapter_type(void);
int PDC_set_80x25(void);
int PDC_set_scrn_mode(int);

View File

@@ -28,9 +28,11 @@
#ifdef EMXVIDEO
# include <termios.h>
#else
static KBDINFO kbdinfo; /* default keyboard mode */
#endif
RCSID("$Id: pdckbd.c,v 1.31 2006/08/11 05:43:37 wmcbrine Exp $");
RCSID("$Id: pdckbd.c,v 1.32 2006/08/11 07:04:31 wmcbrine Exp $");
/************************************************************************
* Table for key code translation of function keys in keypad mode *
@@ -149,50 +151,36 @@ unsigned long PDC_get_input_fd(void)
#ifndef EMXVIDEO
int PDC_get_keyboard_info(KBDINFO *kbdinfo)
void PDC_get_keyboard_info(void)
{
KBDINFO akbdinfo;
PDC_LOG(("PDC_get_keyboard_info() - called\n"));
akbdinfo.cb = sizeof(akbdinfo);
KbdGetStatus(&akbdinfo, 0);
*kbdinfo = akbdinfo;
kbdinfo.cb = sizeof(kbdinfo);
KbdGetStatus(&kbdinfo, 0);
PDC_LOG(("PDC_get_keyboard_info(). cb: %x, fsMask: %x, "
"chTurnAround: %x, fsInterim: %x, fsState: %x\n",
kbdinfo->cb, kbdinfo->fsMask, kbdinfo->chTurnAround,
kbdinfo->fsInterim, kbdinfo->fsState));
return OK;
kbdinfo.cb, kbdinfo.fsMask, kbdinfo.chTurnAround,
kbdinfo.fsInterim, kbdinfo.fsState));
}
int PDC_set_keyboard_default(void)
void PDC_set_keyboard_default(void)
{
PDC_LOG(("PDC_set_keyboard_default(). cb: %x, fsMask: %x, "
"chTurnAround: %x, fsInterim: %x, fsState: %x\n",
SP->kbdinfo.cb, SP->kbdinfo.fsMask,
SP->kbdinfo.chTurnAround, SP->kbdinfo.fsInterim,
SP->kbdinfo.fsState));
kbdinfo.cb, kbdinfo.fsMask, kbdinfo.chTurnAround,
kbdinfo.fsInterim, kbdinfo.fsState));
KbdSetStatus(&SP->kbdinfo, 0);
return OK;
KbdSetStatus(&kbdinfo, 0);
}
#endif /* ifndef EMXVIDEO */
void PDC_set_keyboard_binary(bool on)
{
#ifndef EMXVIDEO
KBDINFO kbdinfo;
#endif
PDC_LOG(("PDC_set_keyboard_binary() - called\n"));
#ifndef EMXVIDEO
kbdinfo.cb = sizeof(kbdinfo);
KbdGetStatus(&kbdinfo, 0);
PDC_LOG(("PDC_set_keyboard_binary() - before. cb: %x, fsMask: %x, "
"chTurnAround: %x, fsInterim: %x, fsState: %x\n",
kbdinfo.cb, kbdinfo.fsMask, kbdinfo.chTurnAround,

View File

@@ -20,16 +20,24 @@
#include <curses.h>
#include <stdlib.h>
RCSID("$Id: pdcscrn.c,v 1.35 2006/08/11 06:17:48 wmcbrine Exp $");
RCSID("$Id: pdcscrn.c,v 1.36 2006/08/11 07:04:31 wmcbrine Exp $");
#ifdef EMXVIDEO
static unsigned char *saved_screen = NULL;
static int saved_lines = 0;
static int saved_cols = 0;
extern int PDC_query_adapter_type(void);
#else
static PCH saved_screen = NULL;
static USHORT saved_lines = 0;
static USHORT saved_cols = 0;
extern void PDC_get_keyboard_info(void);
extern int PDC_get_scrn_mode(VIOMODEINFO *);
extern int PDC_query_adapter_type(VIOCONFIGINFO *);
extern void PDC_set_keyboard_default(void);
extern int PDC_set_scrn_mode(VIOMODEINFO);
#endif
/*man-start**************************************************************
@@ -90,30 +98,26 @@ int PDC_scr_close(void)
This function returns TRUE if equal else FALSE.
Portability:
PDCurses int PDC_scrn_modes_equal(int mode1, int mode2);
OS2 PDCurses int PDC_scrn_modes_equal(VIOMODEINFO mode1,
VIOMODEINFO mode2);
**man-end****************************************************************/
#ifndef EMXVIDEO
bool PDC_scrn_modes_equal(VIOMODEINFO mode1, VIOMODEINFO mode2)
#else
bool PDC_scrn_modes_equal(int mode1, int mode2)
#endif
static bool PDC_scrn_modes_equal(VIOMODEINFO mode1, VIOMODEINFO mode2)
{
PDC_LOG(("PDC_scrn_modes_equal() - called\n"));
#ifndef 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
}
#endif
/*man-start**************************************************************
PDC_scr_open() - Internal low-level binding to open the physical screen

View File

@@ -19,7 +19,7 @@
#include <curses.h>
#include <string.h>
RCSID("$Id: pdcsetsc.c,v 1.24 2006/07/23 23:42:23 wmcbrine Exp $");
RCSID("$Id: pdcsetsc.c,v 1.25 2006/08/11 07:04:31 wmcbrine Exp $");
/*man-start**************************************************************
@@ -89,16 +89,11 @@ int PDC_set_font(int size)
**man-end****************************************************************/
#ifndef EMXVIDEO
int PDC_set_scrn_mode(VIOMODEINFO new_mode)
#else
int PDC_set_scrn_mode(int new_mode)
#endif
{
PDC_LOG(("PDC_set_scrn_mode() - called\n"));
#ifdef EMXVIDEO
return OK;
#else
if (VioSetMode(&new_mode, 0) != 0)
{
SP->font = PDC_get_font();
@@ -111,9 +106,10 @@ int PDC_set_scrn_mode(int new_mode)
}
else
return ERR;
#endif
}
#endif
int PDC_curs_set(int visibility)
{
#ifndef EMXVIDEO

View File

@@ -24,7 +24,7 @@
#define CURSES_LIBRARY 1
#include <curses.h>
RCSID("$Id: pdcgetsc.c,v 1.24 2006/08/10 08:43:36 wmcbrine Exp $");
RCSID("$Id: pdcgetsc.c,v 1.25 2006/08/11 07:04:31 wmcbrine Exp $");
extern HANDLE hConOut, hConIn;
@@ -195,32 +195,3 @@ int PDC_get_columns(void)
return scr.srWindow.Right - scr.srWindow.Left + 1;
}
/*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.
Portability:
PDCurses int PDC_query_adapter_type(void);
**man-end****************************************************************/
int PDC_query_adapter_type(void)
{
PDC_LOG(("PDC_query_adapter_type() - called\n"));
SP->mono = FALSE;
return _VGACOLOR;
}

View File

@@ -24,7 +24,7 @@
#define CURSES_LIBRARY 1
#include <curses.h>
RCSID("$Id: pdcscrn.c,v 1.49 2006/08/11 06:17:48 wmcbrine Exp $");
RCSID("$Id: pdcscrn.c,v 1.50 2006/08/11 07:04:31 wmcbrine Exp $");
#define PDC_RESTORE_NONE 0
#define PDC_RESTORE_BUFFER 1
@@ -255,7 +255,7 @@ int PDC_scr_open(int argc, char **argv)
PDC_get_cursor_pos(&SP->cursrow, &SP->curscol);
SP->adapter = PDC_query_adapter_type();
SP->mono = FALSE;
SP->orig_cursor = PDC_get_cursor_mode();

View File

@@ -17,7 +17,7 @@
#include "pdcx11.h"
RCSID("$Id: pdcscrn.c,v 1.33 2006/08/11 06:17:48 wmcbrine Exp $");
RCSID("$Id: pdcscrn.c,v 1.34 2006/08/11 07:04:31 wmcbrine Exp $");
/*man-start**************************************************************
@@ -71,7 +71,6 @@ int PDC_scr_open(int argc, char **argv)
return ERR;
SP->cursrow = SP->curscol = 0;
SP->adapter = 0;
SP->orig_cursor = 0;
SP->orig_attr = FALSE;
SP->orgcbr = 0;