home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume17 / screen2 / part01 / screen.h < prev   
Encoding:
C/C++ Source or Header  |  1989-02-06  |  2.2 KB  |  99 lines

  1. /* Copyright (c) 1987,1988 Oliver Laumann, Technical University of Berlin.
  2.  * Not derived from licensed software.
  3.  *
  4.  * Permission is granted to freely use, copy, modify, and redistribute
  5.  * this software, provided that no attempt is made to gain profit from it,
  6.  * the author is not construed to be liable for any results of using the
  7.  * software, alterations are clearly marked as such, and this notice is
  8.  * not modified.
  9.  */
  10.  
  11. enum state_t {
  12.     LIT,         /* Literal input */
  13.     ESC,         /* Start of escape sequence */
  14.     STR,         /* Start of control string */
  15.     TERM,        /* ESC seen in control string */
  16.     CSI,         /* Reading arguments in "CSI Pn ; Pn ; ... ; XXX" */
  17.     PRIN,        /* Printer mode */
  18.     PRINESC,     /* ESC seen in printer mode */
  19.     PRINCSI,     /* CSI seen in printer mode */
  20.     PRIN4        /* CSI 4 seen in printer mode */
  21. };
  22.  
  23. enum string_t {
  24.     NONE,
  25.     DCS,         /* Device control string */
  26.     OSC,         /* Operating system command */
  27.     APC,         /* Application program command */
  28.     PM,          /* Privacy message */
  29. };
  30.  
  31. #define MAXSTR       128
  32. #define    MAXARGS      64
  33.  
  34. #define IOSIZE       80
  35.  
  36. struct win {
  37.     int wpid;
  38.     int ptyfd;
  39.     int aflag;
  40.     char outbuf[IOSIZE];
  41.     int outlen;
  42.     char cmd[MAXSTR];
  43.     char tty[MAXSTR];
  44.     int args[MAXARGS];
  45.     char GotArg[MAXARGS];
  46.     int NumArgs;
  47.     int slot;
  48.     char **image;
  49.     char **attr;
  50.     char **font;
  51.     int LocalCharset;
  52.     int charsets[4];
  53.     int ss;
  54.     int active;
  55.     int x, y;
  56.     char LocalAttr;
  57.     int saved;
  58.     int Saved_x, Saved_y;
  59.     char SavedLocalAttr;
  60.     int SavedLocalCharset;
  61.     int SavedCharsets[4];
  62.     int top, bot;
  63.     int wrap;
  64.     int origin;
  65.     int insert;
  66.     int keypad;
  67.     enum state_t state;
  68.     enum string_t StringType;
  69.     char string[MAXSTR];
  70.     char *stringp;
  71.     char *tabs;
  72.     int vbwait;
  73.     int bell;
  74. };
  75.  
  76. #define MAXLINE 1024
  77.  
  78. #define MSG_CREATE    0
  79. #define MSG_ERROR     1
  80. #define MSG_ATTACH    2
  81. #define MSG_CONT      3
  82.  
  83. struct msg {
  84.     int type;
  85.     union {
  86.     struct {
  87.         int aflag;
  88.         int nargs;
  89.         char line[MAXLINE];
  90.         char dir[1024];
  91.     } create;
  92.     struct {
  93.         int apid;
  94.         char tty[1024];
  95.     } attach;
  96.     char message[MAXLINE];
  97.     } m;
  98. };
  99.