/* L C K T I O module */ C O N O C -- Output a character to the console terminal conoc(c) char c = character to print C O N X O -- Write x characters to the console terminal conxo(x,s) char *s = string to print int x = number of characters to print C O N O L -- Write a line to the console terminal conol(s) char *s line to print C O N O L A -- Write an array of lines to the console terminal conola(s) char *s[] = array to print C O N O L L -- Output a string followed by CRLF conoll(s) char *s = string to print C O N C H K -- Check to see if user did hit keyboard Return 1 if keyboard has been hit conchk() C O N I N C -- Get a character from the console, wait for timo seconds returns -1 if no keyboard input coninc(timo) int timo = timeout in seconds T T O P E N -- Open a Comport, returns 0 on success, -1 on failure. sets ttyfd to 0 if COM1 or to 1 if COM2 ttopen(ttname,lcl,modem) char *ttname = name of comport ("COM1" or "COM2") int lcl ( not used , set to zero ) int modem ( not used , dummy argument) T T C L O S -- Close the TTY , set ttyfd to 0 ttclos() T T O L -- Similar to "ttinl", but for writing. returns number of characters writen to Com port ttol(s,n) int n = number of characters to send char *s = string to send T T O C -- Output a character to the communication line Returns -1 if an error occured ttoc(c) char c = character to write T T I N C -- Read a character from the communication line return the character if possible otherwise -1 timout in timo seconds ttinc(timo) int timo = timout period T T I N L -- Read a record (up to break character) from comm line. If no break character encountered within "max", return "max" characters, with disposition of any remaining characters undefined. Otherwise, return the characters that were read, including the break character, in "dest" and the number of characters read as the value of function, or 0 upon end of file, or -1 if an error occurred. Times out & returns error if not completed within "timo" sconds. ttinl(dest,maxnum,timo,eol) int maxnum = maximum number of char to read int timo = timout period int eol = break character char *dest = destination string TTPKT -- Condition communication line for packect mode ttpkt (speed,flow) int speed = baud rate int flow = flow control used 0 = None, 1 = XON/XOFF TTVT -- Condition communication line for use as virtual terminal Returns -1 if Error */ ttvt (speed,flow) int speed = baud rate int flow = flow control used extern int parity = parity to be used (e, o, m, s, n) T T S S P D -- check for valid baud rates return the baud rate if valid otherwise -1 ttsspd(speed) int speed = baud rate TTFLUI -- Flush tty input buffer ttflui() TTFLUO -- Flush tty ouput buffer ttfluo() T T I N -- read one character for tty input buffer return the character if available otherwise -1 ttin() T T C H K -- check if character available in receive buffer */ ttchk() { T T S O M E -- Return TRUE if receive buffer has character in it. int ttsome() T T F L O W -- Checks for XOFF,if so waits for XON, timeout after 5 sec. ttflow() C A R R I E R -- Check for existance of modem carrier signal Returns: 1 if carrier present; else returns 0 int carrier() extern int cdetect = if set will return 1 S L E E P -- Wait for m seconds sleep(m) int m = number of seconds to sleep T I C K S -- Returns total number of clock ticks since midnight */ long int ticks() T O T S E C -- Returns time since midnight in seconds long int totsec() T O O L O N G -- Timeout for user input with tout in seconds */ toolong(tout) int tout = time out period extern long int strtim = starting time tor tout Z T I M E -- Return date/time string ztime(s) char **s = pointer to string containing date and time