|
|
1.1 ! root 1: /* ! 2: * @(#)tt.h 3.15 9/20/85 ! 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: char tt_strings[1024]; /* string buffer */ ! 68: char *tt_strp; /* pointer for it */ ! 69: ! 70: struct tt_str { ! 71: char *ts_str; ! 72: int ts_n; ! 73: }; ! 74: ! 75: struct tt_str *tttgetstr(); ! 76: struct tt_str *ttxgetstr(); /* tgetstr() and expand delays */ ! 77: ! 78: int tttputc(); ! 79: #define tttputs(s, n) tputs((s)->ts_str, (n), tttputc) ! 80: #define ttxputs(s) ttwrite((s)->ts_str, (s)->ts_n) ! 81: ! 82: /* ! 83: * Buffered output without stdio. ! 84: * These variables have different meanings from the ww_ob* variabels. ! 85: * But I'm too lazy to think up different names. ! 86: */ ! 87: char tt_ob[512]; ! 88: char *tt_obp; ! 89: char *tt_obe; ! 90: #define ttputc(c) (tt_obp < tt_obe ? (*tt_obp++ = (c)) \ ! 91: : (ttflush(), *tt_obp++ = (c)))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.