Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 56 lines (48 sloc) 2.078 kb
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
1 /* spell.h */
2
3 typedef struct spells
4 {
5 long flags; /* bitmap of flags for this word */
6 unsigned short min, max; /* range of legal indicies into link[]*/
7 struct spells *link[1]; /* array of ptrs to succeeding nodes */
8 } spell_t;
9
10 typedef enum
11 {
12 SPELL_GOOD, SPELL_BAD, SPELL_UNKNOWN, SPELL_INCOMPLETE
13 } spellresult_t;
14
15 /* These are the possible restrictions on spellchecking. Note that the
16 * least restrictive comes first, and the most restrictive comes last.
17 */
18 typedef enum
19 {
20 SPELL_CHECK_ALL, SPELL_CHECK_TAGONLY, SPELL_CHECK_NONE
21 } spellcheck_t;
22
23 /* some standard flags */
24 #define SPELL_FLAG_COMPLETE 0x40000000 /* whole word */
25 #define SPELL_FLAG_BAD 0x20000000 /* bad word */
26 #define SPELL_FLAG_PERSONAL 0x10000000 /* added via :spell */
27
28 /* a macro for determining whether a given node represents a valid word */
29 #define SPELL_IS_GOOD(node) ((node) && ((node)->flags & (SPELL_FLAG_COMPLETE|SPELL_FLAG_BAD)) == SPELL_FLAG_COMPLETE)
30
31 /* Functions for managing dictionaries. These are used by descr.c as well as
32 * the spell-checking feature.
33 */
34 spell_t *spellletter P_((spell_t *node, _CHAR_ letter));
35 spell_t *spellfindword P_((spell_t *node, CHAR *word, int len));
36 spell_t *spelladdword P_((spell_t *node, CHAR *word, long flags));
37 void spellfree P_((spell_t *node));
38
39 /* These functions are used only by the spell-checker */
40 spellresult_t spellcheck P_((MARK mark, ELVBOOL tagonly, long cursoff));
41 void spellbegin P_((void));
42 ELVBOOL spellsearch P_((CHAR *word));
43 void spellend P_((void));
44 void spellhighlight P_((WINDOW win));
45 void spellsave P_((BUFFER custom));
46 void spellfix P_((CHAR *word, CHAR *result, int resultlen, ELVBOOL tagonly));
47 CHAR *spellshow P_((MARK cursor, _char_ font));
48 ELVBOOL spellcount P_((MARK cursor, long count));
49 void spellcheckfont P_((CHAR *fontname, spellcheck_t check, ELVBOOL bang));
50 void spelltmp P_((int oldfont, int newfont, int combofont));
51 void spellload P_((char *filename, ELVBOOL personal));
52 MARK spellnext P_((WINDOW win, MARK curs));
53
54 /* some global variables */
55 extern spell_t *spelltags;
56 extern spell_t *spellwords;
Something went wrong with that request. Please try again.