diff --git a/curses.h b/curses.h index 19548822..42c57766 100644 --- a/curses.h +++ b/curses.h @@ -11,7 +11,7 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -/* $Id: curses.h,v 1.268 2007/01/03 14:12:50 wmcbrine Exp $ */ +/* $Id: curses.h,v 1.269 2007/01/05 12:01:22 wmcbrine Exp $ */ /*----------------------------------------------------------------------* * PDCurses * @@ -39,7 +39,7 @@ PDCurses portable platform definitions list: **man-end****************************************************************/ -#define PDC_BUILD 2826 +#define PDC_BUILD 2827 #define PDCURSES 1 /* PDCurses-only routines */ #define XOPEN 1 /* X/Open Curses routines */ #define SYSVcurses 1 /* System V Curses routines */ @@ -502,7 +502,6 @@ typedef struct 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 orgcbr; /* original MSDOS ^-BREAK setting */ bool audible; /* FALSE if the bell is visual */ bool mono; /* TRUE if current screen is mono */ bool resized; /* TRUE if TERM has been resized */ diff --git a/curspriv.h b/curspriv.h index cb3520a7..55af711e 100644 --- a/curspriv.h +++ b/curspriv.h @@ -11,7 +11,7 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -/* $Id: curspriv.h,v 1.146 2007/01/03 15:32:05 wmcbrine Exp $ */ +/* $Id: curspriv.h,v 1.147 2007/01/05 12:01:22 wmcbrine Exp $ */ /* CURSPRIV.H @@ -73,7 +73,6 @@ int PDC_curs_set(int); void PDC_flushinp(void); int PDC_get_bios_key(void); int PDC_get_columns(void); -bool PDC_get_ctrl_break(void); int PDC_get_cursor_mode(void); int PDC_get_rows(void); void PDC_gotoyx(int, int); @@ -89,7 +88,6 @@ void PDC_save_screen_mode(int); void PDC_scr_close(void); void PDC_scr_free(void); int PDC_scr_open(int, char **); -int PDC_set_ctrl_break(bool); void PDC_set_keyboard_binary(bool); void PDC_transform_line(int, int, int, const chtype *); const char *PDC_sysname(void); diff --git a/dos/pdckbd.c b/dos/pdckbd.c index 741d922a..894e849f 100644 --- a/dos/pdckbd.c +++ b/dos/pdckbd.c @@ -11,10 +11,6 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -#ifdef __DJGPP__ -# include -#endif - /* MS C doesn't return flags from int86() */ #ifdef MSC # define USE_KBHIT @@ -26,7 +22,12 @@ #include "pdcdos.h" -RCSID("$Id: pdckbd.c,v 1.76 2007/01/02 15:57:57 wmcbrine Exp $"); +#ifdef __DJGPP__ +# include +# include +#endif + +RCSID("$Id: pdckbd.c,v 1.77 2007/01/05 12:01:22 wmcbrine Exp $"); /*man-start************************************************************** @@ -120,6 +121,11 @@ unsigned long PDC_get_input_fd(void) void PDC_set_keyboard_binary(bool on) { PDC_LOG(("PDC_set_keyboard_binary() - called\n")); + +#ifdef __DJGPP__ + setmode(fileno(stdin), on ? O_BINARY : O_TEXT); + setcbrk(!on); +#endif } /* check if a key or mouse event is waiting */ @@ -462,43 +468,6 @@ int PDC_get_bios_key(void) return key; } -/* return OS control break state */ - -bool PDC_get_ctrl_break(void) -{ - PDCREGS regs; - - PDC_LOG(("PDC_get_ctrl_break() - called\n")); - - regs.h.ah = 0x33; - regs.h.al = 0x00; - PDCINT(0x21, regs); - - return (bool)regs.h.dl; -} - -/* enable/disable the host OS BREAK key check */ - -int PDC_set_ctrl_break(bool setting) -{ -#ifndef __DJGPP__ - PDCREGS regs; -#endif - PDC_LOG(("PDC_set_ctrl_break() - called\n")); - -#ifdef __DJGPP__ - signal(SIGINT, setting ? SIG_DFL : SIG_IGN); -/* __djgpp_set_ctrl_c(setting);*/ - setcbrk(setting); -#else - regs.h.ah = 0x33; - regs.h.al = 0x01; - regs.h.dl = setting; - PDCINT(0x21, regs); -#endif - return OK; -} - /* discard any pending keyboard or mouse input -- this is the core routine for flushinp() */ diff --git a/dos/pdcscrn.c b/dos/pdcscrn.c index 933a513d..cbea1f67 100644 --- a/dos/pdcscrn.c +++ b/dos/pdcscrn.c @@ -15,7 +15,7 @@ #include -RCSID("$Id: pdcscrn.c,v 1.80 2007/01/03 14:10:46 wmcbrine Exp $"); +RCSID("$Id: pdcscrn.c,v 1.81 2007/01/05 12:01:22 wmcbrine Exp $"); int pdc_adapter; /* screen type */ int pdc_scrnmode; /* default screen mode */ @@ -515,6 +515,10 @@ int PDC_scr_open(int argc, char **argv) SP->orig_attr = FALSE; + /* Now set the keyboard into binary mode */ + + PDC_set_keyboard_binary(TRUE); + pdc_direct_video = TRUE; /* Assume that we can */ pdc_video_seg = 0xb000; /* Base screen segment addr */ pdc_video_ofs = 0x0; /* Base screen segment ofs */ diff --git a/os2/pdckbd.c b/os2/pdckbd.c index 3f0bb519..97801cad 100644 --- a/os2/pdckbd.c +++ b/os2/pdckbd.c @@ -13,16 +13,6 @@ #include "pdcos2.h" -#if defined(__EMX__) || defined(__WATCOMC__) || defined(__IBMC__) || \ - defined(__TURBOC__) -# define HAVE_SIGNAL -# include -#else -# define INCL_DOSSIGNALS -# define INCL_NOCOMMON -# include -#endif - #ifdef EMXVIDEO # include static int tahead = -1; @@ -35,7 +25,7 @@ static bool key_pressed = FALSE; static int mouse_events = 0; #endif -RCSID("$Id: pdckbd.c,v 1.77 2007/01/02 15:57:57 wmcbrine Exp $"); +RCSID("$Id: pdckbd.c,v 1.78 2007/01/05 12:01:22 wmcbrine Exp $"); /*man-start************************************************************** @@ -491,75 +481,6 @@ int PDC_get_bios_key(void) return key; } -/* return OS control break state */ - -bool PDC_get_ctrl_break(void) -{ -#ifdef HAVE_SIGNAL -# ifdef __TURBOC__ - void __cdecl (*oldAction) (int); -# else - void (*oldAction) (int); -# endif -#endif - PDC_LOG(("PDC_get_ctrl_break() - called\n")); - -#ifdef HAVE_SIGNAL - - 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 -} - -/* enable/disable the host OS BREAK key check */ - -int PDC_set_ctrl_break(bool setting) -{ - PDC_LOG(("PDC_set_ctrl_break() - called. Setting: %d\n", setting)); - -#ifdef HAVE_SIGNAL - signal(SIGINT, setting ? SIG_DFL : SIG_IGN); - signal(SIGBREAK, setting ? SIG_DFL : SIG_IGN); -#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); -#endif - return OK; -} - /* discard any pending keyboard or mouse input -- this is the core routine for flushinp() */ diff --git a/pdcurses/initscr.c b/pdcurses/initscr.c index 6c425050..552e0c01 100644 --- a/pdcurses/initscr.c +++ b/pdcurses/initscr.c @@ -14,7 +14,7 @@ #include #include -RCSID("$Id: initscr.c,v 1.96 2007/01/03 14:11:32 wmcbrine Exp $"); +RCSID("$Id: initscr.c,v 1.97 2007/01/05 12:01:23 wmcbrine Exp $"); const char *_curses_notice = "PDCurses 3.0 - Public Domain 2007"; @@ -158,7 +158,6 @@ WINDOW *Xinitscr(int argc, char *argv[]) SP->delaytenths = 0; SP->line_color = -1; - SP->orgcbr = PDC_get_ctrl_break(); SP->orig_cursor = PDC_get_cursor_mode(); LINES = SP->lines; diff --git a/pdcurses/inopts.c b/pdcurses/inopts.c index 2b29f929..6d6cdd7f 100644 --- a/pdcurses/inopts.c +++ b/pdcurses/inopts.c @@ -13,7 +13,7 @@ #include -RCSID("$Id: inopts.c,v 1.35 2006/12/25 14:27:12 wmcbrine Exp $"); +RCSID("$Id: inopts.c,v 1.36 2007/01/05 12:01:23 wmcbrine Exp $"); /*man-start************************************************************** @@ -281,7 +281,6 @@ int raw(void) PDC_set_keyboard_binary(TRUE); SP->raw_inp = TRUE; - PDC_set_ctrl_break(FALSE); return OK; } @@ -292,7 +291,6 @@ int noraw(void) PDC_set_keyboard_binary(FALSE); SP->raw_inp = FALSE; - PDC_set_ctrl_break(TRUE); return OK; } diff --git a/pdcurses/kernel.c b/pdcurses/kernel.c index 39a47489..f451f11d 100644 --- a/pdcurses/kernel.c +++ b/pdcurses/kernel.c @@ -14,7 +14,7 @@ #include #include -RCSID("$Id: kernel.c,v 1.68 2006/12/25 14:27:12 wmcbrine Exp $"); +RCSID("$Id: kernel.c,v 1.69 2007/01/05 12:01:23 wmcbrine Exp $"); RIPPEDOFFLINE linesripped[5]; char linesrippedoff = 0; @@ -139,9 +139,6 @@ static int _restore_mode(int i) { memcpy(SP, &(ctty[i].saved), sizeof(SCREEN)); - if (PDC_get_ctrl_break() != ctty[i].saved.orgcbr) - PDC_set_ctrl_break(ctty[i].saved.orgcbr); - if (ctty[i].saved.raw_out) raw(); diff --git a/win32/pdckbd.c b/win32/pdckbd.c index 19291d7d..7f356816 100644 --- a/win32/pdckbd.c +++ b/win32/pdckbd.c @@ -13,7 +13,7 @@ #include "pdcwin.h" -RCSID("$Id: pdckbd.c,v 1.103 2007/01/02 15:57:57 wmcbrine Exp $"); +RCSID("$Id: pdckbd.c,v 1.104 2007/01/05 12:01:23 wmcbrine Exp $"); /*man-start************************************************************** @@ -645,24 +645,6 @@ int PDC_get_bios_key(void) return -1; } -/* return OS control break state */ - -bool PDC_get_ctrl_break(void) -{ - PDC_LOG(("PDC_get_ctrl_break() - called\n")); - - return FALSE; -} - -/* enable/disable the host OS BREAK key check */ - -int PDC_set_ctrl_break(bool setting) -{ - PDC_LOG(("PDC_set_ctrl_break() - called\n")); - - return OK; -} - /* discard any pending keyboard or mouse input -- this is the core routine for flushinp() */ diff --git a/x11/pdckbd.c b/x11/pdckbd.c index 9687c8c8..9c375258 100644 --- a/x11/pdckbd.c +++ b/x11/pdckbd.c @@ -13,7 +13,7 @@ #include "pdcx11.h" -RCSID("$Id: pdckbd.c,v 1.55 2007/01/02 15:57:57 wmcbrine Exp $"); +RCSID("$Id: pdckbd.c,v 1.56 2007/01/05 12:01:23 wmcbrine Exp $"); /*man-start************************************************************** @@ -96,24 +96,6 @@ void PDC_set_keyboard_binary(bool on) PDC_LOG(("PDC_set_keyboard_binary() - called\n")); } -/* return OS control break state */ - -bool PDC_get_ctrl_break(void) -{ - PDC_LOG(("PDC_get_ctrl_break() - called\n")); - - return FALSE; -} - -/* enable/disable the host OS BREAK key check */ - -int PDC_set_ctrl_break(bool setting) -{ - PDC_LOG(("PDC_set_ctrl_break() - called\n")); - - return OK; -} - /* discard any pending keyboard or mouse input -- this is the core routine for flushinp() */