home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / hamradio / s920603.zip / DISPLAY.H < prev    next >
C/C++ Source or Header  |  1992-05-10  |  1KB  |  43 lines

  1. #define    MAXARGS    5
  2.  
  3. #define    NROWS    25
  4. #define    NCOLS    80
  5.  
  6. struct display {
  7.     unsigned cookie;    /* Magic cookie to detect bogus pointers */
  8. #define    D_COOKIE    0xbeef
  9.     int cols;    /* Screen width */
  10.     int col;    /* cursor column, 0 to cols-1 */
  11.     int savcol;    /* Saved cursor column */
  12.  
  13.     int rows;    /* Screen height */
  14.     int row;    /* cursor row, 0 to rows-1 */
  15.     int savrow;    /* Saved cursor row */
  16.     int firstrow;    /* First row to be displayed when scrolled */
  17.  
  18.     int argi;    /* index to current entry in arg[] */
  19.     int arg[MAXARGS];    /* numerical args to ANSI sequence */
  20.  
  21.     char attrib;    /* Current screen attribute */
  22.     char state;    /* State of ANSI escape sequence FSM */
  23. #define    NORMAL    0    /* No ANSI sequence in progress */
  24. #define    ESCAPE    1    /* ESC char seen */
  25. #define    ARG    2    /* ESC[ seen */
  26.  
  27.     int flags;    /* Status flags */
  28. #define    DIRTY_SCREEN    1    /* Rewrite whole screen on next dupdate() */
  29. #define    DIRTY_ROW    2    /* Rewrite current row */
  30. #define    DIRTY_CURSOR    4    /* Cursor has moved */
  31. #define    NOWRAP        8    /* Set if end-of-line wrapping is disabled */
  32. #define    NOSCROL        16    /* Set if wrap-around scrolling is in use */
  33. #define    INSERT        32    /* Insert mode active */
  34.  
  35.     char *buf;    /* Internal screen image */
  36. };
  37.  
  38. #define    NULLDISP    (struct display *)0
  39. struct display *newdisplay __ARGS((int rows,int cols,int noscrol));
  40. void displaywrite __ARGS((struct display *dp,char *buf,int cnt));
  41. void dupdate __ARGS((struct display *dp,int force));
  42. void closedisplay __ARGS((struct display *dp));
  43.