home *** CD-ROM | disk | FTP | other *** search
- /*
- * vtem - A termcap driven VT100 emulator for BSD Unix
- *
- * $Header: /home/src/local/vttool/RCS/vtem.h,v 1.2 89/02/08 16:05:27 jqj Exp $
- *
- * Public domain software.
- * Written by Leif Samuelsson (lsamuelsson@erisun) in December, 1985
- *
- * $Log: vtem.h,v $
- * Revision 1.2 89/02/08 16:05:27 jqj
- * 1/ added enumerated type and terminal capabilities for VT102 support
- * 2/ redefined set_cursor to handle c values greater than CO [N.B. c is
- * now evaluated twice so don't do ``set_cursor(col++,row)'']
- *
- */
-
- #include <stdio.h>
- #include <signal.h>
- #include <sys/types.h>
- #include <sys/time.h>
- #include <sys/stat.h>
- #include <sys/ioctl.h>
-
- #define FALSE 0
- #define TRUE 1
-
- typedef short Bool;
-
- extern char *getenv();
- extern putchar_x();
-
- extern struct sgttyb oldb, newb;
- extern struct tchars oldtchars, newtchars;
- extern struct ltchars oldltchars, newltchars;
- extern int oldlb, newlb, oldl, newl;
-
- extern int master;
-
- enum vt_terminal {VT52, VT100, VT102};
- extern enum vt_terminal vttype;
-
- extern Bool BS;
- extern int CO, LI;
- extern char *AL, *BC, *BL, *CB, *CD, *CL, *CE, *CM, *CR, *CS, *DC,
- *DL, *DO, *EI, *IC, *IM,
- *KE, *KS, *MB, *MD, *ME, *MR, *ND, *NL, *SE, *SO, *SR,
- *TI, *TE, *UE, *UP, *US, *MAL, *MDL;
-
- #define tputs_x(s) (tputs(s, 1, putchar_x))
- #define tputs_pad(s,pad) (tputs(s, (pad), putchar_x))
-
-
- #define backspace() (tputs_x(BC))
- #define clear_screen() (tputs_pad(CL,LI))
- #define set_cursor(c, r) (tputs_x(tgoto(CM, ((c)>=CO?CO-1:(c)), (r))))
- #define linefeed() (tputs_x(NL))
- #define cr() (tputs_x(CR))
-