home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
pcmag
/
vol7n21.arc
/
WS4XLATE.C
< prev
Wrap
Text File
|
1988-11-03
|
741b
|
27 lines
/* WS4XLATE.C
To compile: cl ws4xlate.c
or tcc ws4xlate
*/
#include<stdio.h>
#define LEADIN 0x1b /* Esc lead in */
#define LEADOUT 0x1c /* Esc lead out */
#define EXTENDED 0x80 /* extended char mask: 10000000 */
void main ()
{
int c;
while( (c = getchar()) != EOF) /* get characters from input */
{
if(c & EXTENDED) /* if high bit is set */
{ /* embed it in escape chars */
putchar(LEADIN);
putchar(c);
putchar(LEADOUT);
}
else
putchar(c); /* put to output */
}
}