mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-23 15:25:01 +00:00
Reintegrated the duplicative PDC_breakout()s, preparatory to fixing it.
To Do: Is this the best place for the reunified function?
This commit is contained in:
59
dos/pdckbd.c
59
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
|
||||
|
||||
@@ -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
|
||||
|
||||
53
os2/pdckbd.c
53
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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#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
|
||||
|
||||
54
x11/pdckbd.c
54
x11/pdckbd.c
@@ -25,61 +25,9 @@
|
||||
#include <curses.h>
|
||||
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user