1 /*        $NetBSD: seq.h,v 1.2 2013/11/22 15:52:05 christos Exp $     */
2 /*-
3  * Copyright (c) 1992, 1993, 1994
4  *        The Regents of the University of California.  All rights reserved.
5  * Copyright (c) 1992, 1993, 1994, 1995, 1996
6  *        Keith Bostic.  All rights reserved.
7  *
8  * See the LICENSE file for redistribution information.
9  *
10  *        Id: seq.h,v 10.3 1996/03/06 19:51:03 bostic Exp  (Berkeley) Date: 1996/03/06 19:51:03
11  */
12 
13 /*
14  * Map and abbreviation structures.
15  *
16  * The map structure is doubly linked list, sorted by input string and by
17  * input length within the string.  (The latter is necessary so that short
18  * matches will happen before long matches when the list is searched.)
19  * Additionally, there is a bitmap which has bits set if there are entries
20  * starting with the corresponding character.  This keeps us from walking
21  * the list unless it's necessary.
22  *
23  * The name and the output fields of a SEQ can be empty, i.e. NULL.
24  * Only the input field is required.
25  *
26  * XXX
27  * The fast-lookup bits are never turned off -- users don't usually unmap
28  * things, though, so it's probably not a big deal.
29  */
30 struct _seq {
31           LIST_ENTRY(_seq) q;           /* Linked list of all sequences. */
32           seq_t      stype;                       /* Sequence type. */
33           CHAR_T    *name;                        /* Sequence name (if any). */
34           size_t     nlen;                        /* Name length. */
35           CHAR_T    *input;                       /* Sequence input keys. */
36           size_t     ilen;                        /* Input keys length. */
37           CHAR_T    *output;            /* Sequence output keys. */
38           size_t     olen;                        /* Output keys length. */
39 
40 #define   SEQ_FUNCMAP         0x01                /* If unresolved function key.*/
41 #define   SEQ_NOOVERWRITE     0x02                /* Don't replace existing entry. */
42 #define   SEQ_SCREEN          0x04                /* If screen specific. */
43 #define   SEQ_USERDEF         0x08                /* If user defined. */
44           u_int8_t flags;
45 };
46