-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathabbrev.h
32 lines (26 loc) · 1.23 KB
/
abbrev.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Definitions for Unix Emacs Abbrev mode */
/* Copyright (c) 1981,1980 James Gosling */
/* An abbrev table contains an array of pointers to abbrev entries. When a
word is to be looked up in a abbrev table it is hashed to a long value and
that value is taken mod the array size to get the head of the appropriate
chain. The chain is scanned for an entry whose hash matches (comparing
hash values is faster than comparins strings) and whose string matches. */
#define AbbrevSize 87
struct AbbrevEnt { /* a phrase-abbreve pair in an abbrev table */
struct AbbrevEnt *a_next; /* the next pair in this chain */
char *a_abbrev; /* the abbreviation */
char *a_phrase; /* the expanded phrase */
long a_hash; /* a_abbrev hashed */
struct BoundName *a_ExpansionHook; /* the command that will be executed
when this abbrev is expanded */
};
struct AbbrevTable { /* a table of abbreviations and their
expansions */
char *a_name; /* the name of this abbrev table */
int a_NumberDefined; /* the number of abbrevs defined in this
abbrev table */
struct AbbrevEnt *a_table[AbbrevSize];
/* the array of pointers to chains of name
pairs */
};
struct AbbrevTable GlobalAbbrev;