diff --git a/dos/pdckbd.c b/dos/pdckbd.c index 2b96a45e..98ac4c3d 100644 --- a/dos/pdckbd.c +++ b/dos/pdckbd.c @@ -32,7 +32,7 @@ #ifdef PDCDEBUG -char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.7 2004/01/01 07:47:09 mark Exp $"; +char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.8 2005/12/11 01:07:18 wmcbrine Exp $"; #endif /******************************************************************************* @@ -130,63 +130,6 @@ static int 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 diff --git a/flexos/pdckbd.c b/flexos/pdckbd.c index 24385828..1910a848 100644 --- a/flexos/pdckbd.c +++ b/flexos/pdckbd.c @@ -44,7 +44,7 @@ #endif #ifdef PDCDEBUG -char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.1 2001/01/10 08:31:09 mark Exp $"; +char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.2 2005/12/11 01:07:19 wmcbrine Exp $"; #endif static unsigned long pdc_key_modifiers=0L; @@ -212,63 +212,6 @@ int kptab[] = }; #endif -/*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 diff --git a/os2/pdckbd.c b/os2/pdckbd.c index 6e1be066..bbfb9c9f 100644 --- a/os2/pdckbd.c +++ b/os2/pdckbd.c @@ -33,7 +33,7 @@ #endif #ifdef PDCDEBUG -char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.6 2004/01/01 07:47:09 mark Exp $"; +char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.7 2005/12/11 01:07:19 wmcbrine Exp $"; #endif /******************************************************************************* @@ -130,57 +130,6 @@ static int 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**********************************************************************/ - -/***********************************************************************/ -bool PDC_breakout( void ) -/***********************************************************************/ -{ -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 diff --git a/pdcurses/getch.c b/pdcurses/getch.c index 7132448a..3528cd53 100644 --- a/pdcurses/getch.c +++ b/pdcurses/getch.c @@ -39,7 +39,7 @@ #endif #ifdef PDCDEBUG -char *rcsid_getch = "$Id: getch.c,v 1.6 2004/01/01 03:17:49 mark Exp $"; +char *rcsid_getch = "$Id: getch.c,v 1.7 2005/12/11 01:07:19 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -418,3 +418,59 @@ extern int c_ungch[NUNGETCH]; /* array of ungotten chars */ c_ungch[c_ungind++] = ch; return( OK ); } +/*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 PDC_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 */ + bool rc; + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_breakout() - called\n"); +#endif + + /* ungotten or buffered char */ + rc = (c_ungind) || (c_pindex > c_gindex); + + if (!rc) + rc = PDC_check_bios_key(); + +#ifdef PDCDEBUG + if (trace_on) PDC_debug("PDC_breakout() - returned: %d c_ungind: %d c_pindex: %d c_gindex: %d\n",rc,c_ungind,c_pindex,c_gindex); +#endif + return rc; +} diff --git a/win32/pdckbd.c b/win32/pdckbd.c index ae1efe8e..26fb7c06 100644 --- a/win32/pdckbd.c +++ b/win32/pdckbd.c @@ -25,7 +25,7 @@ #include #ifdef PDCDEBUG -char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.18 2005/11/20 04:01:01 wmcbrine Exp $"; +char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.19 2005/12/11 01:07:19 wmcbrine Exp $"; #endif #define KEY_STATE TRUE @@ -338,59 +338,6 @@ static KPTAB ext_kptab[] = 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**********************************************************************/ - -bool PDC_breakout( void ) -{ - extern int c_pindex; /* putter index */ - extern int c_gindex; /* getter index */ - extern int c_ungind; /* wungetch() push index */ - bool rc; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_breakout() - called\n"); -#endif - - if (c_ungind) - rc = TRUE; /* ungotten char */ - else if (c_pindex > c_gindex) - rc = TRUE; /* buffered char */ - else if (SP->raw_inp) - rc= (bool)PDC_check_bios_key(); /* raw mode test */ - else - rc = (bool)PDC_check_bios_key(); /* normal mode test */ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_breakout() - returned: %d c_ungind %d c_pindex %d c_gindex %d\n",rc,c_ungind,c_pindex,c_gindex); -#endif - return(rc); -} - /*man-start********************************************************************* PDC_get_input_fd() - Get file descriptor used for PDCurses input diff --git a/x11/pdckbd.c b/x11/pdckbd.c index ec1d970f..7ba318f1 100644 --- a/x11/pdckbd.c +++ b/x11/pdckbd.c @@ -25,61 +25,9 @@ #include #ifdef PDCDEBUG -char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.6 2005/11/13 14:54:50 wmcbrine Exp $"; +char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.7 2005/12/11 01:07:19 wmcbrine Exp $"; #endif -/*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 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 */ - - return((bool)PDC_check_bios_key()); -} - /*man-start********************************************************************* PDC_get_input_fd() - Get file descriptor used for PDCurses input