home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / sun / volume1 / tooltool2.1c / part01 / samples / vt100 / vtem.h < prev   
Encoding:
C/C++ Source or Header  |  1989-06-06  |  1.5 KB  |  58 lines

  1. /*
  2.  * vtem - A termcap driven VT100 emulator for BSD Unix
  3.  *
  4.  * $Header: /home/src/local/vttool/RCS/vtem.h,v 1.2 89/02/08 16:05:27 jqj Exp $
  5.  *
  6.  * Public domain software.
  7.  * Written by Leif Samuelsson (lsamuelsson@erisun) in December, 1985
  8.  * 
  9.  * $Log:    vtem.h,v $
  10.  * Revision 1.2  89/02/08  16:05:27  jqj
  11.  * 1/ added enumerated type and terminal capabilities for VT102 support
  12.  * 2/ redefined set_cursor to handle c values greater than CO [N.B. c is 
  13.  *    now evaluated twice so don't do ``set_cursor(col++,row)'']
  14.  * 
  15.  */
  16.  
  17. #include <stdio.h>
  18. #include <signal.h>
  19. #include <sys/types.h>
  20. #include <sys/time.h>
  21. #include <sys/stat.h>
  22. #include <sys/ioctl.h>
  23.  
  24. #define FALSE 0
  25. #define TRUE 1
  26.  
  27. typedef short Bool;
  28.  
  29. extern char *getenv();
  30. extern putchar_x();
  31.  
  32. extern struct sgttyb oldb, newb;
  33. extern struct tchars oldtchars, newtchars;
  34. extern struct ltchars oldltchars, newltchars;
  35. extern int oldlb, newlb, oldl, newl;
  36.  
  37. extern int master;
  38.  
  39. enum vt_terminal {VT52, VT100, VT102};
  40. extern enum vt_terminal vttype;
  41.  
  42. extern Bool BS;
  43. extern int CO, LI;
  44. extern char  *AL, *BC, *BL, *CB, *CD, *CL, *CE, *CM, *CR, *CS, *DC,
  45.     *DL, *DO, *EI, *IC, *IM,
  46.     *KE, *KS, *MB, *MD, *ME, *MR, *ND, *NL, *SE, *SO, *SR, 
  47.     *TI, *TE, *UE, *UP, *US, *MAL, *MDL;
  48.  
  49. #define tputs_x(s)        (tputs(s, 1, putchar_x))
  50. #define tputs_pad(s,pad)    (tputs(s, (pad), putchar_x))
  51.  
  52.  
  53. #define backspace()        (tputs_x(BC))
  54. #define clear_screen()        (tputs_pad(CL,LI))
  55. #define set_cursor(c, r)    (tputs_x(tgoto(CM, ((c)>=CO?CO-1:(c)), (r))))
  56. #define linefeed()        (tputs_x(NL))
  57. #define cr()            (tputs_x(CR))
  58.