home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
p
/
ptv3n5.zip
/
MAKERAW.C
< prev
next >
Wrap
Text File
|
1992-08-18
|
677b
|
22 lines
#include <stdio.h>
#include <io.h>
void main (void) {
unsigned DevAttr;
if (isatty (fileno (stdprn))) { // do this on character
// devices only
// Get current device attribute word
DevAttr = ioctl (fileno (stdprn), 0);
// Now set bit 5 (raw mode) in device attribute word
// High byte of attribute word sent must be 0.
ioctl (fileno (stdprn), 1, (DevAttr | 0x20) & 0xff);
// The device accessed by stdprn is now in "raw" mode.
}
// Before closing stdprn or before exiting the program,
// be sure to change it back to "cooked" mode.
if (isatty (fileno (stdprn)))
ioctl (fileno (stdprn), 1, DevAttr & 0xff);
}