home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource3
/
187_01
/
kbecho.c
< prev
next >
Wrap
Text File
|
1985-12-30
|
1KB
|
42 lines
/*@*****************************************************/
/*@ */
/*@ kbecho - collects characters from a keyboard input */
/*@ routine, expands control chars to reverse */
/*@ video names, and writes them when a line */
/*@ is full. */
/*@ */
/*@ Usage: kbecho(char); */
/*@ where char is the char to be echoed. */
/*@ */
/*@*****************************************************/
/***********************************************************************/
/* */
/* The following are specific for the IBM PC. */
/* */
/***********************************************************************/
#define NORM 0x07 /* normal video attribute */
/***********************************************************************/
#define EOS 0x00 /* end of string */
char strbuf[20];
int charcnt = 0;
kbecho(KbChar)
char KbChar;
{
int showch();
charcnt += showch(KbChar);
if (charcnt >= 75) {
charcnt = 0;
strbuf[0] = '\n';
strbuf[1] = EOS;
conout(strbuf,NORM);
}
}