1#ifndef DEFINE_FUNC_ATTRIBUTES
2# define DEFINE_FUNC_ATTRIBUTES
3#endif
4#include "nvim/func_attr.h"
5#undef DEFINE_FUNC_ATTRIBUTES
6static void find_word(matchinf_T *mip, int mode);
7static _Bool match_checkcompoundpattern(char_u *ptr, int wlen, garray_T *gap );
8static _Bool can_compound(slang_T *slang, char_u *word, char_u *flags);
9static _Bool can_be_compound(trystate_T *sp, slang_T *slang, char_u *compflags, int flag);
10static _Bool match_compoundrule(slang_T *slang, char_u *compflags);
11static int valid_word_prefix(int totprefcnt, int arridx, int flags, char_u *word, slang_T *slang, _Bool cond_req );
12static void find_prefix(matchinf_T *mip, int mode);
13static int fold_more(matchinf_T *mip);
14static _Bool spell_valid_case(int wordflags, int treeflags);
15static _Bool no_spell_checking(win_T *wp);
16static void spell_load_lang(char_u *lang);
17static void int_wordlist_spl(char_u *fname);
18static void free_salitem(salitem_T *smp);
19static void free_fromto(fromto_T *ftp);
20static void spell_load_cb(char_u *fname, void *cookie);
21static int score_wordcount_adj(slang_T *slang, int score, char_u *word, _Bool split );
22static int count_syllables(slang_T *slang, char_u *word);
23static void clear_midword(win_T *wp);
24static void use_midword(slang_T *lp, win_T *wp);
25static int find_region(char_u *rp, char_u *region);
26static int badword_captype(char_u *word, char_u *end) FUNC_ATTR_NONNULL_ALL;
27static int bytes2offset(char_u **pp);
28static _Bool spell_iswordp(char_u *p, win_T *wp);
29static _Bool spell_mb_isword_class(int cl, win_T *wp);
30static _Bool spell_iswordp_w(int *p, win_T *wp);
31static _Bool check_need_cap(linenr_T lnum, colnr_T col);
32static void spell_find_suggest(char_u *badptr, int badlen, suginfo_T *su, int maxcount, _Bool banbadword, _Bool need_cap, _Bool interactive );
33static void spell_suggest_expr(suginfo_T *su, char_u *expr);
34static void spell_suggest_file(suginfo_T *su, char_u *fname);
35static void spell_suggest_intern(suginfo_T *su, _Bool interactive);
36static void spell_find_cleanup(suginfo_T *su);
37static void allcap_copy(char_u *word, char_u *wcopy);
38static void suggest_try_special(suginfo_T *su);
39static void suggest_try_change(suginfo_T *su);
40static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, _Bool soundfold);
41static void go_deeper(trystate_T *stack, int depth, int score_add);
42static int nofold_len(char_u *fword, int flen, char_u *word);
43static void find_keepcap_word(slang_T *slang, char_u *fword, char_u *kword);
44static void score_comp_sal(suginfo_T *su);
45static void score_combine(suginfo_T *su);
46static int stp_sal_score(suggest_T *stp, suginfo_T *su, slang_T *slang, char_u *badsound );
47static void suggest_try_soundalike_prep(void);
48static void suggest_try_soundalike(suginfo_T *su);
49static void suggest_try_soundalike_finish(void);
50static void add_sound_suggest(suginfo_T *su, char_u *goodword, int score, langp_T *lp );
51static int soundfold_find(slang_T *slang, char_u *word);
52static void make_case_word(char_u *fword, char_u *cword, int flags);
53static _Bool similar_chars(slang_T *slang, int c1, int c2);
54static void add_suggestion(suginfo_T *su, garray_T *gap, const char_u *goodword, int badlenarg, int score, int altscore, _Bool had_bonus, slang_T *slang, _Bool maxsf );
55static void check_suggestions(suginfo_T *su, garray_T *gap );
56static void add_banned(suginfo_T *su, char_u *word);
57static void rescore_suggestions(suginfo_T *su);
58static void rescore_one(suginfo_T *su, suggest_T *stp);
59static int sug_compare(const void *s1, const void *s2);
60static int cleanup_suggestions(garray_T *gap, int maxscore, int keep );
61static void spell_soundfold_sofo(slang_T *slang, char_u *inword, char_u *res);
62static void spell_soundfold_sal(slang_T *slang, char_u *inword, char_u *res);
63static void spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res);
64static int soundalike_score(char_u *goodstart, char_u *badstart );
65static int spell_edit_score(slang_T *slang, char_u *badword, char_u *goodword);
66static int spell_edit_score_limit(slang_T *slang, char_u *badword, char_u *goodword, int limit);
67static int spell_edit_score_limit_w(slang_T *slang, char_u *badword, char_u *goodword, int limit);
68static void dump_word(slang_T *slang, char_u *word, char_u *pat, int *dir, int dumpflags, int wordflags, linenr_T lnum);
69static linenr_T dump_prefixes(slang_T *slang, char_u *word, char_u *pat, int *dir, int dumpflags, int flags, linenr_T startlnum );
70#include "nvim/func_attr.h"
71