Commit | Line | Data |
---|---|---|
1e64b3ba JH |
1 | /*- |
2 | * Copyright (c) 1993 | |
3 | * The Regents of the University of California. All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions | |
7 | * are met: | |
8 | * 1. Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * 2. Redistributions in binary form must reproduce the above copyright | |
11 | * notice, this list of conditions and the following disclaimer in the | |
12 | * documentation and/or other materials provided with the distribution. | |
13 | * 3. All advertising materials mentioning features or use of this software | |
14 | * must display the following acknowledgement: | |
15 | * This product includes software developed by the University of | |
16 | * California, Berkeley and its contributors. | |
17 | * 4. Neither the name of the University nor the names of its contributors | |
18 | * may be used to endorse or promote products derived from this software | |
19 | * without specific prior written permission. | |
20 | * | |
21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
31 | * SUCH DAMAGE. | |
32 | * | |
33 | * @(#)gs.h 8.26 (Berkeley) 1/9/94 | |
34 | */ | |
35 | ||
36 | struct _gs { | |
37 | CIRCLEQ_HEAD(_dqh, _scr) dq; /* Displayed screens. */ | |
38 | CIRCLEQ_HEAD(_hqh, _scr) hq; /* Hidden screens. */ | |
39 | ||
40 | mode_t origmode; /* Original terminal mode. */ | |
41 | struct termios | |
42 | original_termios; /* Original terminal values. */ | |
43 | struct termios | |
44 | s5_curses_botch; /* System V curses workaround. */ | |
45 | ||
46 | MSGH msgq; /* User message list. */ | |
47 | ||
48 | char *tmp_bp; /* Temporary buffer. */ | |
49 | size_t tmp_blen; /* Size of temporary buffer. */ | |
50 | ||
51 | #ifdef DEBUG | |
52 | FILE *tracefp; /* Trace file pointer. */ | |
53 | #endif | |
54 | ||
55 | /* INFORMATION SHARED BY ALL SCREENS. */ | |
56 | IBUF *tty; /* Key input buffer. */ | |
57 | ||
58 | CB *dcbp; /* Default cut buffer pointer. */ | |
59 | CB *dcb_store; /* Default cut buffer storage. */ | |
60 | LIST_HEAD(_cuth, _cb) cutq; /* Linked list of cut buffers. */ | |
61 | ||
62 | #define MAX_BIT_SEQ 128 /* Max + 1 fast check character. */ | |
63 | LIST_HEAD(_seqh, _seq) seqq; /* Linked list of maps, abbrevs. */ | |
64 | bitstr_t bit_decl(seqb, MAX_BIT_SEQ); | |
65 | ||
66 | #define term_key_val(sp, ch) \ | |
67 | ((ch) <= MAX_FAST_KEY ? sp->gp->special_key[ch] : \ | |
68 | (ch) > sp->gp->max_special ? 0 : __term_key_val(sp, ch)) | |
69 | #define MAX_FAST_KEY 255 /* Max + 1 fast check character.*/ | |
70 | CHAR_T max_special; /* Max special character. */ | |
71 | u_char *special_key; /* Fast lookup table. */ | |
72 | CHNAME const *cname; /* Display names of ASCII characters. */ | |
73 | ||
74 | #define G_ABBREV 0x00001 /* If have abbreviations. */ | |
75 | #define G_BELLSCHED 0x00002 /* Bell scheduled. */ | |
76 | #define G_CURSES_INIT 0x00004 /* Curses: initialized. */ | |
77 | #define G_CURSES_S5CB 0x00008 /* Curses: s5_curses_botch set. */ | |
78 | #define G_ISFROMTTY 0x00010 /* Reading from a tty. */ | |
79 | #define G_RECOVER_SET 0x00020 /* Recover system initialized. */ | |
80 | #define G_SETMODE 0x00040 /* Tty mode changed. */ | |
81 | #define G_SIGALRM 0x00080 /* SIGALRM arrived. */ | |
82 | #define G_SIGHUP 0x00100 /* SIGHUP arrived. */ | |
83 | #define G_SIGTERM 0x00200 /* SIGTERM arrived. */ | |
84 | #define G_SIGWINCH 0x00400 /* SIGWINCH arrived. */ | |
85 | #define G_SLEEPING 0x00800 /* Asleep (die on signal). */ | |
86 | #define G_SNAPSHOT 0x01000 /* Always snapshot files. */ | |
87 | #define G_TMP_INUSE 0x02000 /* Temporary buffer in use. */ | |
88 | u_int flags; | |
89 | }; | |
90 | ||
91 | extern GS *__global_list; /* List of screens. */ |