rework ARGS structures as part of ex parser rework
[nvi.git] / common / seq.h
blob93651aa972e28001c316f11ad5a6904a0654394e
1 /*-
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.7 1993/12/02 10:30:24 bostic Exp $ (Berkeley) $Date: 1993/12/02 10:30:24 $
8 */
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.
20 * XXX
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.
24 /* Sequence type. */
25 enum seqtype { SEQ_ABBREV, SEQ_COMMAND, SEQ_INPUT };
27 struct _seq {
28 LIST_ENTRY(_seq) q; /* Linked list of all sequences. */
29 enum seqtype stype; /* Sequence type. */
30 char *name; /* Sequence name (if any). */
31 size_t nlen; /* Name length. */
32 char *input; /* Sequence input keys. */
33 size_t ilen; /* Input keys length. */
34 char *output; /* Sequence output keys. */
35 size_t olen; /* Output keys length. */
37 #define S_USERDEF 0x01 /* If sequence user defined. */
38 u_char flags;
41 int abbr_save __P((SCR *, FILE *));
42 int map_save __P((SCR *, FILE *));
43 int seq_delete __P((SCR *, char *, size_t, enum seqtype));
44 int seq_dump __P((SCR *, enum seqtype, int));
45 SEQ *seq_find __P((SCR *, SEQ **, char *, size_t, enum seqtype, int *));
46 void seq_init __P((SCR *));
47 int seq_save __P((SCR *, FILE *, char *, enum seqtype));
48 int seq_set __P((SCR *, char *, size_t,
49 char *, size_t, char *, size_t, enum seqtype, int));