1: /*
   2:  * @(#)tt.h	3.16 1/1/94
   3:  */
   4: 
   5: /*
   6:  * Copyright (c) 1983 Regents of the University of California,
   7:  * All rights reserved.  Redistribution permitted subject to
   8:  * the terms of the Berkeley Software License Agreement.
   9:  */
  10: 
  11: /*
  12:  * Interface structure for the terminal drivers.
  13:  */
  14: struct tt {
  15:         /* startup and cleanup */
  16:     int (*tt_init)();
  17:     int (*tt_end)();
  18: 
  19:         /* terminal functions */
  20:     int (*tt_move)();
  21:     int (*tt_insline)();
  22:     int (*tt_delline)();
  23:     int (*tt_delchar)();
  24:     int (*tt_write)();      /* write a whole block */
  25:     int (*tt_putc)();       /* write one character */
  26:     int (*tt_clreol)();
  27:     int (*tt_clreos)();
  28:     int (*tt_clear)();
  29:     int (*tt_setinsert)();      /* set insert mode */
  30:     int (*tt_setmodes)();       /* set display modes */
  31: 
  32:         /* internal variables */
  33:     char tt_modes;          /* the current display modes */
  34:     char tt_nmodes;         /* the new modes for next write */
  35:     char tt_insert;         /* currently in insert mode */
  36:     char tt_ninsert;        /* insert mode on next write */
  37:     int tt_row;         /* cursor row */
  38:     int tt_col;         /* cursor column */
  39: 
  40:         /* terminal info */
  41:     int tt_nrow;            /* number of display rows */
  42:     int tt_ncol;            /* number of display columns */
  43:     char tt_hasinsert;      /* has insert character */
  44:     char tt_availmodes;     /* the display modes supported */
  45:     char tt_wrap;           /* has auto wrap around */
  46:     char tt_retain;         /* can retain below (db flag) */
  47: 
  48:         /* the frame characters */
  49:     short *tt_frame;
  50: };
  51: struct tt tt;
  52: 
  53: /*
  54:  * List of terminal drivers.
  55:  */
  56: struct tt_tab {
  57:     char *tt_name;
  58:     int tt_len;
  59:     int (*tt_func)();
  60: };
  61: struct tt_tab tt_tab[];
  62: 
  63: /*
  64:  * Clean interface to termcap routines.
  65:  * Too may t's.
  66:  */
  67: #ifdef pdp11
  68: char *tt_strings;       /* string buffer on stack (see main.c) */
  69: #else
  70: char tt_strings[1024];      /* string buffer */
  71: #endif
  72: char *tt_strp;          /* pointer for it */
  73: 
  74: struct tt_str {
  75:     char *ts_str;
  76:     int ts_n;
  77: };
  78: 
  79: struct tt_str *tttgetstr();
  80: struct tt_str *ttxgetstr(); /* tgetstr() and expand delays */
  81: 
  82: int tttputc();
  83: #define tttputs(s, n)   tputs((s)->ts_str, (n), tttputc)
  84: #define ttxputs(s)  ttwrite((s)->ts_str, (s)->ts_n)
  85: 
  86: /*
  87:  * Buffered output without stdio.
  88:  * These variables have different meanings from the ww_ob* variabels.
  89:  * But I'm too lazy to think up different names.
  90:  */
  91: #define TTOBSIZ 512
  92: #ifdef pdp11
  93: char *tt_ob;
  94: #else
  95: char tt_ob[TTOBSIZ];
  96: #endif
  97: char *tt_obp;
  98: char *tt_obe;
  99: #define ttputc(c)   (tt_obp < tt_obe ? (*tt_obp++ = (c)) \
 100:                 : (ttflush(), *tt_obp++ = (c)))

Defined variables

tt_ob defined in line 95; used 5 times
tt_obe defined in line 98; used 8 times
tt_obp defined in line 97; used 30 times
tt_strings defined in line 70; used 2 times
tt_strp defined in line 72; used 7 times
tt_tab defined in line 61; used 1 times

Defined struct's

tt defined in line 14; used 2 times
  • in line 51(2)
tt_str defined in line 74; used 98 times
tt_tab defined in line 56; used 6 times

Defined macros

TTOBSIZ defined in line 91; used 3 times
tttputs defined in line 83; used 9 times
ttxputs defined in line 84; used 27 times

Usage of this include

Last modified: 1994-01-01
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 691
Valid CSS Valid XHTML 1.0 Strict