Go to the documentation of this file. 1 #ifndef NVIM_SPELL_DEFS_H
2 #define NVIM_SPELL_DEFS_H
12 #define MAXWLEN 254 // Assume max. word len is this many bytes.
23 #define SPL_FNAME_TMPL "%s.%s.spl"
24 #define SPL_FNAME_ADD ".add."
25 #define SPL_FNAME_ASCII ".ascii."
29 #define WF_REGION 0x01 // region byte follows
30 #define WF_ONECAP 0x02 // word with one capital (or all capitals)
31 #define WF_ALLCAP 0x04 // word must be all capitals
32 #define WF_RARE 0x08 // rare word
33 #define WF_BANNED 0x10 // bad word
34 #define WF_AFX 0x20 // affix ID follows
35 #define WF_FIXCAP 0x40 // keep-case word, allcap not allowed
36 #define WF_KEEPCAP 0x80 // keep-case word
39 #define WF_HAS_AFF 0x0100 // word includes affix
40 #define WF_NEEDCOMP 0x0200 // word only valid in compound
41 #define WF_NOSUGGEST 0x0400 // word not to be suggested
42 #define WF_COMPROOT 0x0800 // already compounded word, COMPOUNDROOT
43 #define WF_NOCOMPBEF 0x1000 // no compounding before this word
44 #define WF_NOCOMPAFT 0x2000 // no compounding after this word
47 #define WFP_RARE 0x01 // rare prefix
48 #define WFP_NC 0x02 // prefix is not combining
49 #define WFP_UP 0x04 // to-upper prefix
50 #define WFP_COMPPERMIT 0x08 // prefix with COMPOUNDPERMITFLAG
51 #define WFP_COMPFORBID 0x10 // prefix with COMPOUNDFORBIDFLAG
55 #define WF_RAREPFX (WFP_RARE << 24) // rare postponed prefix
56 #define WF_PFX_NC (WFP_NC << 24) // non-combining postponed prefix
57 #define WF_PFX_UP (WFP_UP << 24) // to-upper postponed prefix
58 #define WF_PFX_COMPPERMIT (WFP_COMPPERMIT << 24) // postponed prefix with
60 #define WF_PFX_COMPFORBID (WFP_COMPFORBID << 24) // postponed prefix with
65 #define COMP_CHECKDUP 1 // CHECKCOMPOUNDDUP
66 #define COMP_CHECKREP 2 // CHECKCOMPOUNDREP
67 #define COMP_CHECKCASE 4 // CHECKCOMPOUNDCASE
68 #define COMP_CHECKTRIPLE 8 // CHECKCOMPOUNDTRIPLE
96 #define SP_TRUNCERROR (-1) // spell file truncated error
97 #define SP_FORMERROR (-2) // format error in spell file
98 #define SP_OTHERERROR (-3) // other error while reading spell file
195 #define LANGP_ENTRY(ga, i) (((langp_T *)(ga).ga_data) + (i))
197 #define VIMSUGMAGIC "VIMsug" // string at start of Vim .sug file
198 #define VIMSUGMAGICL 6
199 #define VIMSUGVERSION 1
201 #define REGION_ALL 0xff // word valid in all regions
268 #define SPELL_TOFOLD(c) ((c) >= 128 ? utf_fold(c) : (int)spelltab.st_fold[c])
270 #define SPELL_TOUPPER(c) ((c) >= 128 ? mb_toupper(c) \
271 : (int)spelltab.st_upper[c])
273 #define SPELL_ISUPPER(c) ((c) >= 128 ? mb_isupper(c) : spelltab.st_isu[c])
294 #endif // NVIM_SPELL_DEFS_H
char_u ts_fidx
Definition: spell_defs.h:242
int * sm_lead_w
Definition: spell_defs.h:87
char_u * sl_kbyts
Definition: spell_defs.h:124
idx_T * sl_sidxs
Definition: spell_defs.h:175
int * sm_oneof_w
Definition: spell_defs.h:88
idx_T * sl_pidxs
Definition: spell_defs.h:127
bool sl_nocompoundsugs
Definition: spell_defs.h:170
@ STATE_REP_UNDO
Definition: spell_defs.h:232
char_u ts_tcharlen
Definition: spell_defs.h:248
char_u ts_save_badflags
Definition: spell_defs.h:257
int sl_compmax
Definition: spell_defs.h:138
Definition: spell_defs.h:205
@ STATE_UNROT3L
Definition: spell_defs.h:228
@ STATE_INS_PREP
Definition: spell_defs.h:222
int * sm_to_w
Definition: spell_defs.h:89
char_u * sl_pbyts
Definition: spell_defs.h:126
int idx_T
Definition: spell_defs.h:21
char_u * sm_lead
Definition: spell_defs.h:82
@ STATE_SWAP3
Definition: spell_defs.h:226
@ STATE_INS
Definition: spell_defs.h:223
char_u * sm_to
Definition: spell_defs.h:86
garray_T sl_repsal
Definition: spell_defs.h:167
char_u ts_delidx
Definition: spell_defs.h:258
char_u * sl_sbyts
Definition: spell_defs.h:174
@ STATE_REP
Definition: spell_defs.h:231
state_T
Definition: spell_defs.h:213
int sm_leadlen
Definition: spell_defs.h:83
int did_set_spelltab
Definition: spell.c:289
char_u * sm_oneof
Definition: spell_defs.h:84
long sl_fbyts_len
Definition: spell_defs.h:122
slang_T * lp_replang
Definition: spell_defs.h:191
Definition: regexp_defs.h:70
idx_T ts_arridx
Definition: spell_defs.h:240
char_u * sl_fname
Definition: spell_defs.h:118
spelltab_T spelltab
Definition: spell.c:288
char_u * sl_midword
Definition: spell_defs.h:134
bool sl_nobreak
Definition: spell_defs.h:148
int ts_score
Definition: spell_defs.h:239
char_u ts_prewordlen
Definition: spell_defs.h:252
char_u * ft_to
Definition: spell_defs.h:75
char_u * sl_info
Definition: spell_defs.h:129
char_u ts_flags
Definition: spell_defs.h:247
garray_T sl_rep
Definition: spell_defs.h:155
Definition: spell_defs.h:115
hashtab_T sl_map_hash
Definition: spell_defs.h:181
char_u ts_complen
Definition: spell_defs.h:255
slang_T * lp_slang
Definition: spell_defs.h:189
int salfirst_T
Definition: spell_defs.h:92
char_u ts_splitoff
Definition: spell_defs.h:253
int16_t sl_repsal_first[256]
Definition: spell_defs.h:168
@ STATE_DEL
Definition: spell_defs.h:221
struct salitem_S salitem_T
@ STATE_UNROT3R
Definition: spell_defs.h:229
char_u ts_isdiff
Definition: spell_defs.h:250
bool sl_add
Definition: spell_defs.h:119
hashtab_T sl_wordcount
Definition: spell_defs.h:136
char_u ts_fcharstart
Definition: spell_defs.h:251
bool sl_rem_accents
Definition: spell_defs.h:163
@ SPELL_ADD_RARE
Definition: spell_defs.h:291
regprog_T ** sl_prefprog
Definition: spell_defs.h:153
time_t sl_sugtime
Definition: spell_defs.h:173
int16_t sl_rep_first[256]
Definition: spell_defs.h:156
int sl_map_array[256]
Definition: spell_defs.h:182
hashtab_T sl_sounddone
Definition: spell_defs.h:183
idx_T * sl_kidxs
Definition: spell_defs.h:125
SpellAddType
Definition: spell_defs.h:288
char_u * sl_syllable
Definition: spell_defs.h:149
char_u * sl_comprules
Definition: spell_defs.h:145
bool sl_collapse
Definition: spell_defs.h:162
bool sl_sofo
Definition: spell_defs.h:164
@ STATE_UNSWAP3
Definition: spell_defs.h:227
char_u * sm_rules
Definition: spell_defs.h:85
slang_T * lp_sallang
Definition: spell_defs.h:190
regprog_T * sl_compprog
Definition: spell_defs.h:143
garray_T sl_sal
Definition: spell_defs.h:158
int sl_compoptions
Definition: spell_defs.h:141
char_u * ft_from
Definition: spell_defs.h:74
int sl_prefixcnt
Definition: spell_defs.h:152
char_u * sl_compstartflags
Definition: spell_defs.h:146
idx_T * sl_fidxs
Definition: spell_defs.h:123
char_u ts_fidxtry
Definition: spell_defs.h:243
@ SPELL_ADD_BAD
Definition: spell_defs.h:290
salfirst_T sl_sal_first[256]
Definition: spell_defs.h:159
@ STATE_ENDNUL
Definition: spell_defs.h:219
@ STATE_SWAP
Definition: spell_defs.h:224
struct trystate_S trystate_T
@ STATE_NOPREFIX
Definition: spell_defs.h:217
char_u * sl_compallflags
Definition: spell_defs.h:147
char_u sl_regions[MAXREGIONS *2+1]
Definition: spell_defs.h:131
unsigned char char_u
Definition: types.h:12
char_u * int_wordlist
Definition: spell.c:136
int lp_region
Definition: spell_defs.h:192
char_u * sl_name
Definition: spell_defs.h:117
Definition: buffer_defs.h:521
@ STATE_REP_INI
Definition: spell_defs.h:230
@ STATE_FINAL
Definition: spell_defs.h:233
Definition: spell_defs.h:188
slang_T * sl_next
Definition: spell_defs.h:116
char_u * sl_fbyts
Definition: spell_defs.h:121
buf_T * sl_sugbuf
Definition: spell_defs.h:176
short ts_curi
Definition: spell_defs.h:241
char_u ts_compsplit
Definition: spell_defs.h:256
Definition: spell_defs.h:73
bool sl_has_map
Definition: spell_defs.h:180
char * e_format
Definition: spell.c:331
garray_T sl_comppat
Definition: spell_defs.h:142
char_u ts_twordlen
Definition: spell_defs.h:244
bool sl_nosplitsugs
Definition: spell_defs.h:169
@ STATE_PLAIN
Definition: spell_defs.h:220
char_u ts_prefixdepth
Definition: spell_defs.h:245
Definition: spell_defs.h:81
@ SPELL_ADD_GOOD
Definition: spell_defs.h:289
bool sl_sugloaded
Definition: spell_defs.h:177
Definition: spell_defs.h:237
int sl_compsylmax
Definition: spell_defs.h:140
char_u ts_splitfidx
Definition: spell_defs.h:254
@ STATE_START
Definition: spell_defs.h:214
int sl_compminlen
Definition: spell_defs.h:139
#define MAXREGIONS
Definition: spell_defs.h:17
char_u ts_tcharidx
Definition: spell_defs.h:249
bool sl_followup
Definition: spell_defs.h:161
slang_T * first_lang
Definition: spell.c:133
@ STATE_UNSWAP
Definition: spell_defs.h:225
state_T ts_state
Definition: spell_defs.h:238
@ STATE_SPLITUNDO
Definition: spell_defs.h:218
garray_T sl_syl_items
Definition: spell_defs.h:150