This is Tty.h in view mode; [Download] [Up]
#import <sgtty.h>
#define NOPARITY (0)
#define ILLEGAL_PARITY (99)
#import <objc/Object.h>
/* the class Tty is for handling devices that are driven
by the general terminal interface -- see tty(4) */
@interface Tty:Object
{
int fd; // file descriptor for reads and writes
int par; // parity (EVENP, ODDP, or NOPARITY)
struct sgttyb origState; // for the reset method
struct sgttyb currentState; // for calls to ioctl
}
+ newDevice:(char *)devname access:(int)flags;
+ newReadDevice:(char *)devname;
+ newWriteDevice:(char *)devname;
+ newReadWriteDevice:(char *)devname;
+ newExistingfd:(int)thisfd; // for already existing file descriptor (eg. 0=stdin 1=stdout 2=stderr)
- reset;
- setEcho;
- unSetEcho;
- setRaw;
- unSetRaw;
- setCbreak;
- unSetCbreak;
- setCrmod;
- unSetCrmod;
- activateState; // this is meant to be a private method
- setSpeed:(int)bps;
- setParity:(int)parity; //parity is either EVENP, ODDP, or NOPARITY
- (int) getSpeed;
- (int) getParity;
- (int) getfd;
- (int) queuedChars; //returns number of characters ready to be read
- (int) readInto:(char *)buf; //returns number of characters read into buf
- (int) writeOut:(char *)buf;
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.