2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
7 * $Id: seq.h,v 8.5 1993/11/18 08:17:21 bostic Exp $ (Berkeley) $Date: 1993/11/18 08:17:21 $
11 * Map and abbreviation structures.
13 * The map structure is doubly linked list, sorted by input string and by
14 * input length within the string. (The latter is necessary so that short
15 * matches will happen before long matches when the list is searched.)
16 * Additionally, there is a bitmap which has bits set if there are entries
17 * starting with the corresponding character. This keeps us from walking
18 * the list unless it's necessary.
21 * The fast-lookup bits are never turned off -- users don't usually unmap
22 * things, though, so it's probably not a big deal.
25 enum seqtype
{ SEQ_ABBREV
, SEQ_COMMAND
, SEQ_INPUT
};
28 LIST_ENTRY(_seq
) q
; /* Linked list of all sequences. */
29 enum seqtype stype
; /* Sequence type. */
30 char *name
; /* Name of the sequence, if any. */
31 char *input
; /* Input key sequence. */
32 size_t ilen
; /* Input key sequence length. */
33 char *output
; /* Output key sequence. */
34 size_t olen
; /* Output key sequence length. */
36 #define S_USERDEF 0x01 /* If sequence user defined. */
40 int abbr_save
__P((SCR
*, FILE *));
41 int map_save
__P((SCR
*, FILE *));
42 int seq_delete
__P((SCR
*, char *, enum seqtype
));
43 int seq_dump
__P((SCR
*, enum seqtype
, int));
44 SEQ
*seq_find
__P((SCR
*, char *, size_t, enum seqtype
, int *));
45 void seq_init
__P((SCR
*));
46 int seq_save
__P((SCR
*, FILE *, char *, enum seqtype
));
47 int seq_set
__P((SCR
*, char *, char *, char *, enum seqtype
, int));