Lines Matching refs:spin

1991 static void process_compflags(spellinfo_T *spin, afffile_T *aff, char_u *compflags);
1992 static void check_renumber(spellinfo_T *spin);
1996 static void add_fromto(spellinfo_T *spin, garray_T *gap, char_u *from, char_u *to);
2001 static int store_aff_word(spellinfo_T *spin, char_u *word, char_u *afflist, afffile_T *affile, hash…
2002 static void *getroom(spellinfo_T *spin, size_t len, int align);
2003 static char_u *getroom_save(spellinfo_T *spin, char_u *s);
2004 static int store_word(spellinfo_T *spin, char_u *word, int flags, int region, char_u *pfxlist, int …
2005 static int tree_add_word(spellinfo_T *spin, char_u *word, wordnode_T *tree, int flags, int region, …
2006 static wordnode_T *get_wordnode(spellinfo_T *spin);
2007 static void free_wordnode(spellinfo_T *spin, wordnode_T *n);
2008 static void wordtree_compress(spellinfo_T *spin, wordnode_T *root, char *name);
2009 static long node_compress(spellinfo_T *spin, wordnode_T *node, hashtab_T *ht, long *tot);
2013 static int sug_filltree(spellinfo_T *spin, slang_T *slang);
2014 static int sug_maketable(spellinfo_T *spin);
2015 static int sug_filltable(spellinfo_T *spin, wordnode_T *node, int startwordnr, garray_T *gap);
2017 static void sug_write(spellinfo_T *spin, char_u *fname);
2018 static void spell_message(spellinfo_T *spin, char_u *str);
2186 spell_read_aff(spellinfo_T *spin, char_u *fname) in spell_read_aff() argument
2234 spell_message(spin, IObuff); in spell_read_aff()
2237 do_rep = spin->si_rep.ga_len == 0; in spell_read_aff()
2240 do_repsal = spin->si_repsal.ga_len == 0; in spell_read_aff()
2243 do_sal = spin->si_sal.ga_len == 0; in spell_read_aff()
2246 do_mapline = spin->si_map.ga_len == 0; in spell_read_aff()
2251 aff = (afffile_T *)getroom(spin, sizeof(afffile_T), TRUE); in spell_read_aff()
2275 if (spin->si_conv.vc_type != CONV_NONE) in spell_read_aff()
2277 pc = string_convert(&spin->si_conv, rline, NULL); in spell_read_aff()
2323 if (aff->af_enc != NULL && !spin->si_ascii in spell_read_aff()
2324 && convert_setup(&spin->si_conv, aff->af_enc, in spell_read_aff()
2328 spin->si_conv.vc_fail = TRUE; in spell_read_aff()
2358 p = (char_u *)getroom(spin, in spell_read_aff()
2359 (spin->si_info == NULL ? 0 : STRLEN(spin->si_info)) in spell_read_aff()
2364 if (spin->si_info != NULL) in spell_read_aff()
2366 STRCPY(p, spin->si_info); in spell_read_aff()
2372 spin->si_info = p; in spell_read_aff()
2378 midword = getroom_save(spin, items[1]); in spell_read_aff()
2461 p = getroom(spin, STRLEN(items[1]) + 2, FALSE); in spell_read_aff()
2487 p = getroom(spin, l, FALSE); in spell_read_aff()
2548 garray_T *gap = &spin->si_comppat; in spell_read_aff()
2560 = getroom_save(spin, items[1]); in spell_read_aff()
2562 = getroom_save(spin, items[2]); in spell_read_aff()
2568 syllable = getroom_save(spin, items[1]); in spell_read_aff()
2572 spin->si_nobreak = TRUE; in spell_read_aff()
2576 spin->si_nosplitsugs = TRUE; in spell_read_aff()
2580 spin->si_nocompoundsugs = TRUE; in spell_read_aff()
2584 spin->si_nosugfile = TRUE; in spell_read_aff()
2626 cur_aff = (affheader_T *)getroom(spin, in spell_read_aff()
2675 check_renumber(spin); in spell_read_aff()
2676 cur_aff->ah_newID = ++spin->si_newprefID; in spell_read_aff()
2712 aff_entry = (affentry_T *)getroom(spin, in spell_read_aff()
2718 aff_entry->ae_chop = getroom_save(spin, items[2]); in spell_read_aff()
2721 aff_entry->ae_add = getroom_save(spin, items[3]); in spell_read_aff()
2734 if (!spin->si_ascii || !(has_non_ascii(aff_entry->ae_chop) in spell_read_aff()
2744 aff_entry->ae_cond = getroom_save(spin, items[4]); in spell_read_aff()
2801 spin, buf); in spell_read_aff()
2826 for (idx = spin->si_prefcond.ga_len - 1; idx >= 0; in spell_read_aff()
2829 p = ((char_u **)spin->si_prefcond.ga_data)[idx]; in spell_read_aff()
2833 if (idx < 0 && ga_grow(&spin->si_prefcond, 1) == OK) in spell_read_aff()
2836 idx = spin->si_prefcond.ga_len++; in spell_read_aff()
2837 pp = ((char_u **)spin->si_prefcond.ga_data) in spell_read_aff()
2842 *pp = getroom_save(spin, in spell_read_aff()
2863 tree_add_word(spin, p, spin->si_prefroot, n, in spell_read_aff()
2871 --spin->si_newprefID; in spell_read_aff()
2916 add_fromto(spin, items[0][3] == 'S' in spell_read_aff()
2917 ? &spin->si_repsal in spell_read_aff()
2918 : &spin->si_rep, items[1], items[2]); in spell_read_aff()
2940 if ((spin->si_map.ga_len > 0 in spell_read_aff()
2941 && vim_strchr(spin->si_map.ga_data, c) in spell_read_aff()
2950 ga_concat(&spin->si_map, items[1]); in spell_read_aff()
2951 ga_append(&spin->si_map, '/'); in spell_read_aff()
2962 spin->si_followup = sal_to_bool(items[2]); in spell_read_aff()
2964 spin->si_collapse = sal_to_bool(items[2]); in spell_read_aff()
2966 spin->si_rem_accents = sal_to_bool(items[2]); in spell_read_aff()
2969 add_fromto(spin, &spin->si_sal, items[1], in spell_read_aff()
2977 sofofrom = getroom_save(spin, items[1]); in spell_read_aff()
2982 sofoto = getroom_save(spin, items[1]); in spell_read_aff()
2990 if (HASHITEM_EMPTY(hash_find(&spin->si_commonwords, in spell_read_aff()
2996 hash_add(&spin->si_commonwords, p); in spell_read_aff()
3008 if (spin->si_clear_chartab) in spell_read_aff()
3013 spin->si_clear_chartab = FALSE; in spell_read_aff()
3022 if (!spin->si_ascii && !enc_utf8) in spell_read_aff()
3038 aff_check_number(spin->si_compmax, compmax, "COMPOUNDWORDMAX"); in spell_read_aff()
3039 spin->si_compmax = compmax; in spell_read_aff()
3044 aff_check_number(spin->si_compminlen, compminlen, "COMPOUNDMIN"); in spell_read_aff()
3045 spin->si_compminlen = compminlen; in spell_read_aff()
3052 aff_check_number(spin->si_compsylmax, compsylmax, "COMPOUNDSYLMAX"); in spell_read_aff()
3053 spin->si_compsylmax = compsylmax; in spell_read_aff()
3058 aff_check_number(spin->si_compoptions, compoptions, "COMPOUND options"); in spell_read_aff()
3059 spin->si_compoptions |= compoptions; in spell_read_aff()
3063 process_compflags(spin, aff, compflags); in spell_read_aff()
3066 if (spin->si_newcompID < spin->si_newprefID) in spell_read_aff()
3068 if (spin->si_newcompID == 127 || spin->si_newcompID == 255) in spell_read_aff()
3070 else if (spin->si_newprefID == 0 || spin->si_newprefID == 127) in spell_read_aff()
3078 aff_check_string(spin->si_syllable, syllable, "SYLLABLE"); in spell_read_aff()
3079 spin->si_syllable = syllable; in spell_read_aff()
3087 else if (spin->si_sal.ga_len > 0) in spell_read_aff()
3091 aff_check_string(spin->si_sofofr, sofofrom, "SOFOFROM"); in spell_read_aff()
3092 aff_check_string(spin->si_sofoto, sofoto, "SOFOTO"); in spell_read_aff()
3093 spin->si_sofofr = sofofrom; in spell_read_aff()
3094 spin->si_sofoto = sofoto; in spell_read_aff()
3100 aff_check_string(spin->si_midword, midword, "MIDWORD"); in spell_read_aff()
3101 spin->si_midword = midword; in spell_read_aff()
3250 spellinfo_T *spin, in process_compflags() argument
3268 if (spin->si_compflags != NULL) in process_compflags()
3269 len += (int)STRLEN(spin->si_compflags) + 1; in process_compflags()
3270 p = getroom(spin, len, FALSE); in process_compflags()
3273 if (spin->si_compflags != NULL) in process_compflags()
3275 STRCPY(p, spin->si_compflags); in process_compflags()
3278 spin->si_compflags = p; in process_compflags()
3301 ci = (compitem_T *)getroom(spin, sizeof(compitem_T), TRUE); in process_compflags()
3310 check_renumber(spin); in process_compflags()
3311 id = spin->si_newcompID--; in process_compflags()
3333 check_renumber(spellinfo_T *spin) in check_renumber() argument
3335 if (spin->si_newprefID == spin->si_newcompID && spin->si_newcompID < 128) in check_renumber()
3337 spin->si_newprefID = 127; in check_renumber()
3338 spin->si_newcompID = 255; in check_renumber()
3423 spellinfo_T *spin, in add_fromto() argument
3435 ftp->ft_from = getroom_save(spin, word); in add_fromto()
3437 ftp->ft_to = getroom_save(spin, word); in add_fromto()
3493 spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile) in spell_read_dic() argument
3532 spell_message(spin, IObuff); in spell_read_dic()
3535 spin->si_msg_count = 999999; in spell_read_dic()
3563 if (spin->si_conv.vc_type != CONV_NONE) in spell_read_dic()
3565 pc = string_convert(&spin->si_conv, line, NULL); in spell_read_dic()
3596 if (spin->si_ascii && has_non_ascii(w)) in spell_read_dic()
3605 if (spin->si_verbose && spin->si_msg_count > 10000) in spell_read_dic()
3607 spin->si_msg_count = 0; in spell_read_dic()
3613 lnum, spin->si_foldwcount + spin->si_keepwcount, w); in spell_read_dic()
3624 dw = (char_u *)getroom_save(spin, w); in spell_read_dic()
3664 if (spin->si_compflags != NULL) in spell_read_dic()
3671 if (store_word(spin, dw, flags, spin->si_region, in spell_read_dic()
3679 if (store_aff_word(spin, dw, afflist, affile, in spell_read_dic()
3685 if (store_aff_word(spin, dw, afflist, affile, in spell_read_dic()
3696 if (spin->si_ascii && non_ascii > 0) in spell_read_dic()
3824 spellinfo_T *spin, // spell info in store_aff_word() argument
3962 || spin->si_compflags != NULL) in store_aff_word()
3983 if (spin->si_compflags != NULL) in store_aff_word()
4015 if (spin->si_prefroot != NULL in store_aff_word()
4016 && spin->si_prefroot->wn_sibling != NULL) in store_aff_word()
4031 if (spin->si_compflags != NULL && !ae->ae_comppermit) in store_aff_word()
4040 if (store_word(spin, newword, use_flags, in store_aff_word()
4041 spin->si_region, use_pfxlist, in store_aff_word()
4048 if (store_aff_word(spin, newword, ae->ae_flags, in store_aff_word()
4060 if (store_aff_word(spin, newword, in store_aff_word()
4066 && store_aff_word(spin, newword, in store_aff_word()
4086 spell_read_wordfile(spellinfo_T *spin, char_u *fname) in spell_read_wordfile() argument
4112 spell_message(spin, IObuff); in spell_read_wordfile()
4136 if (spin->si_conv.vc_type != CONV_NONE) in spell_read_wordfile()
4138 pc = string_convert(&spin->si_conv, rline, NULL); in spell_read_wordfile()
4158 if (spin->si_conv.vc_type != CONV_NONE) in spell_read_wordfile()
4171 if (enc != NULL && !spin->si_ascii in spell_read_wordfile()
4172 && convert_setup(&spin->si_conv, enc, in spell_read_wordfile()
4177 spin->si_conv.vc_fail = TRUE; in spell_read_wordfile()
4184 if (spin->si_region_count > 1) in spell_read_wordfile()
4195 spin->si_region_count = (int)STRLEN(line) / 2; in spell_read_wordfile()
4196 STRCPY(spin->si_region_name, line); in spell_read_wordfile()
4199 spin->si_region = (1 << spin->si_region_count) - 1; in spell_read_wordfile()
4211 regionmask = spin->si_region; in spell_read_wordfile()
4233 if (l == 0 || l > spin->si_region_count) in spell_read_wordfile()
4252 if (spin->si_ascii && has_non_ascii(line)) in spell_read_wordfile()
4259 if (store_word(spin, line, flags, regionmask, NULL, FALSE) == FAIL) in spell_read_wordfile()
4270 if (spin->si_ascii && non_ascii > 0) in spell_read_wordfile()
4274 spell_message(spin, IObuff); in spell_read_wordfile()
4289 spellinfo_T *spin, in getroom() argument
4294 sblock_T *bl = spin->si_blocks; in getroom()
4311 if (!spin->si_did_emsg) in getroom()
4314 spin->si_did_emsg = TRUE; in getroom()
4318 bl->sb_next = spin->si_blocks; in getroom()
4319 spin->si_blocks = bl; in getroom()
4321 ++spin->si_blocks_cnt; in getroom()
4335 getroom_save(spellinfo_T *spin, char_u *s) in getroom_save() argument
4339 sc = (char_u *)getroom(spin, STRLEN(s) + 1, FALSE); in getroom_save()
4367 wordtree_alloc(spellinfo_T *spin) in wordtree_alloc() argument
4369 return (wordnode_T *)getroom(spin, sizeof(wordnode_T), TRUE); in wordtree_alloc()
4383 spellinfo_T *spin, in store_word() argument
4400 res = tree_add_word(spin, foldword, spin->si_foldroot, ct | flags, in store_word()
4405 ++spin->si_foldwcount; in store_word()
4412 res = tree_add_word(spin, word, spin->si_keeproot, flags, in store_word()
4417 ++spin->si_keepwcount; in store_word()
4430 spellinfo_T *spin, in tree_add_word() argument
4456 np = get_wordnode(spin); in tree_add_word()
4493 && (spin->si_sugtree in tree_add_word()
4505 || spin->si_sugtree in tree_add_word()
4510 np = get_wordnode(spin); in tree_add_word()
4548 ++spin->si_msg_count; in tree_add_word()
4550 if (spin->si_compress_cnt > 1) in tree_add_word()
4552 if (--spin->si_compress_cnt == 1) in tree_add_word()
4554 spin->si_blocks_cnt += compress_inc; in tree_add_word()
4570 if (spin->si_compress_cnt == 1 in tree_add_word()
4571 ? spin->si_free_count < MAXWLEN in tree_add_word()
4572 : spin->si_blocks_cnt >= compress_start) in tree_add_word()
4579 spin->si_blocks_cnt -= compress_inc; in tree_add_word()
4580 spin->si_compress_cnt = compress_added; in tree_add_word()
4582 if (spin->si_verbose) in tree_add_word()
4596 wordtree_compress(spin, spin->si_foldroot, "case-folded"); in tree_add_word()
4598 wordtree_compress(spin, spin->si_keeproot, "keep-case"); in tree_add_word()
4610 get_wordnode(spellinfo_T *spin) in get_wordnode() argument
4614 if (spin->si_first_free == NULL) in get_wordnode()
4615 n = (wordnode_T *)getroom(spin, sizeof(wordnode_T), TRUE); in get_wordnode()
4618 n = spin->si_first_free; in get_wordnode()
4619 spin->si_first_free = n->wn_child; in get_wordnode()
4621 --spin->si_free_count; in get_wordnode()
4625 n->wn_nr = ++spin->si_wordnode_nr; in get_wordnode()
4637 deref_wordnode(spellinfo_T *spin, wordnode_T *node) in deref_wordnode() argument
4647 cnt += deref_wordnode(spin, np->wn_child); in deref_wordnode()
4648 free_wordnode(spin, np); in deref_wordnode()
4661 free_wordnode(spellinfo_T *spin, wordnode_T *n) in free_wordnode() argument
4663 n->wn_child = spin->si_first_free; in free_wordnode()
4664 spin->si_first_free = n; in free_wordnode()
4665 ++spin->si_free_count; in free_wordnode()
4672 wordtree_compress(spellinfo_T *spin, wordnode_T *root, char *name) in wordtree_compress() argument
4684 n = node_compress(spin, root->wn_sibling, &ht, &tot); in wordtree_compress()
4687 if (spin->si_verbose || p_verbose > 2) in wordtree_compress()
4699 spell_message(spin, IObuff); in wordtree_compress()
4714 spellinfo_T *spin, in node_compress() argument
4741 compressed += node_compress(spin, child, ht, tot); in node_compress()
4758 compressed += deref_wordnode(spin, child); in node_compress()
4856 write_vim_spell(spellinfo_T *spin, char_u *fname) in write_vim_spell() argument
4894 if (spin->si_info != NULL) in write_vim_spell()
4899 i = (int)STRLEN(spin->si_info); in write_vim_spell()
4901 fwv &= fwrite(spin->si_info, (size_t)i, (size_t)1, fd); // <infotext> in write_vim_spell()
4906 if (spin->si_region_count > 1) in write_vim_spell()
4910 l = spin->si_region_count * 2; in write_vim_spell()
4912 fwv &= fwrite(spin->si_region_name, (size_t)l, (size_t)1, fd); in write_vim_spell()
4914 regionmask = (1 << spin->si_region_count) - 1; in write_vim_spell()
4928 if (!spin->si_ascii && !spin->si_add) in write_vim_spell()
4963 if (spin->si_midword != NULL) in write_vim_spell()
4968 i = (int)STRLEN(spin->si_midword); in write_vim_spell()
4970 fwv &= fwrite(spin->si_midword, (size_t)i, (size_t)1, fd); in write_vim_spell()
4975 if (spin->si_prefcond.ga_len > 0) in write_vim_spell()
4980 l = write_spell_prefcond(NULL, &spin->si_prefcond); in write_vim_spell()
4983 write_spell_prefcond(fd, &spin->si_prefcond); in write_vim_spell()
4996 gap = &spin->si_rep; in write_vim_spell()
5000 if (spin->si_sofofr != NULL && spin->si_sofoto != NULL) in write_vim_spell()
5002 gap = &spin->si_sal; in write_vim_spell()
5005 gap = &spin->si_repsal; in write_vim_spell()
5037 if (spin->si_followup) in write_vim_spell()
5039 if (spin->si_collapse) in write_vim_spell()
5041 if (spin->si_rem_accents) in write_vim_spell()
5066 if (spin->si_sofofr != NULL && spin->si_sofoto != NULL) in write_vim_spell()
5071 l = (int)STRLEN(spin->si_sofofr); in write_vim_spell()
5072 put_bytes(fd, (long_u)(l + STRLEN(spin->si_sofoto) + 4), 4); in write_vim_spell()
5076 fwv &= fwrite(spin->si_sofofr, l, (size_t)1, fd); // <sofofrom> in write_vim_spell()
5078 l = (int)STRLEN(spin->si_sofoto); in write_vim_spell()
5080 fwv &= fwrite(spin->si_sofoto, l, (size_t)1, fd); // <sofoto> in write_vim_spell()
5085 if (spin->si_commonwords.ht_used > 0) in write_vim_spell()
5098 todo = (int)spin->si_commonwords.ht_used; in write_vim_spell()
5099 for (hi = spin->si_commonwords.ht_array; todo > 0; ++hi) in write_vim_spell()
5115 if (spin->si_map.ga_len > 0) in write_vim_spell()
5119 l = spin->si_map.ga_len; in write_vim_spell()
5121 fwv &= fwrite(spin->si_map.ga_data, (size_t)l, (size_t)1, fd); in write_vim_spell()
5130 if (!spin->si_nosugfile in write_vim_spell()
5131 && (spin->si_sal.ga_len > 0 in write_vim_spell()
5132 || (spin->si_sofofr != NULL && spin->si_sofoto != NULL))) in write_vim_spell()
5139 spin->si_sugtime = time(NULL); in write_vim_spell()
5140 put_time(fd, spin->si_sugtime); // <timestamp> in write_vim_spell()
5146 if (spin->si_nosplitsugs) in write_vim_spell()
5156 if (spin->si_nocompoundsugs) in write_vim_spell()
5166 if (spin->si_compflags != NULL) in write_vim_spell()
5171 l = (int)STRLEN(spin->si_compflags); in write_vim_spell()
5172 for (i = 0; i < spin->si_comppat.ga_len; ++i) in write_vim_spell()
5173 l += (int)STRLEN(((char_u **)(spin->si_comppat.ga_data))[i]) + 1; in write_vim_spell()
5176 putc(spin->si_compmax, fd); // <compmax> in write_vim_spell()
5177 putc(spin->si_compminlen, fd); // <compminlen> in write_vim_spell()
5178 putc(spin->si_compsylmax, fd); // <compsylmax> in write_vim_spell()
5180 putc(spin->si_compoptions, fd); // <compoptions> in write_vim_spell()
5181 put_bytes(fd, (long_u)spin->si_comppat.ga_len, 2); in write_vim_spell()
5183 for (i = 0; i < spin->si_comppat.ga_len; ++i) in write_vim_spell()
5185 p = ((char_u **)(spin->si_comppat.ga_data))[i]; in write_vim_spell()
5191 fwv &= fwrite(spin->si_compflags, (size_t)STRLEN(spin->si_compflags), in write_vim_spell()
5196 if (spin->si_nobreak) in write_vim_spell()
5208 if (spin->si_syllable != NULL) in write_vim_spell()
5213 l = (int)STRLEN(spin->si_syllable); in write_vim_spell()
5215 fwv &= fwrite(spin->si_syllable, (size_t)l, (size_t)1, fd); in write_vim_spell()
5226 spin->si_memtot = 0; in write_vim_spell()
5230 tree = spin->si_foldroot->wn_sibling; in write_vim_spell()
5232 tree = spin->si_keeproot->wn_sibling; in write_vim_spell()
5234 tree = spin->si_prefroot->wn_sibling; in write_vim_spell()
5246 spin->si_memtot += nodecount + nodecount * sizeof(int); in write_vim_spell()
5459 spell_make_sugfile(spellinfo_T *spin, char_u *wfname) in spell_make_sugfile() argument
5478 spell_message(spin, (char_u *)_("Reading back spell file...")); in spell_make_sugfile()
5488 spin->si_blocks = NULL; in spell_make_sugfile()
5489 spin->si_blocks_cnt = 0; in spell_make_sugfile()
5490 spin->si_compress_cnt = 0; // will stay at 0 all the time in spell_make_sugfile()
5491 spin->si_free_count = 0; in spell_make_sugfile()
5492 spin->si_first_free = NULL; in spell_make_sugfile()
5493 spin->si_foldwcount = 0; in spell_make_sugfile()
5499 spell_message(spin, (char_u *)_("Performing soundfolding...")); in spell_make_sugfile()
5500 if (sug_filltree(spin, slang) == FAIL) in spell_make_sugfile()
5509 if (sug_maketable(spin) == FAIL) in spell_make_sugfile()
5513 (long)spin->si_spellbuf->b_ml.ml_line_count); in spell_make_sugfile()
5518 spell_message(spin, (char_u *)_(msg_compressing)); in spell_make_sugfile()
5519 wordtree_compress(spin, spin->si_foldroot, "case-folded"); in spell_make_sugfile()
5532 sug_write(spin, fname); in spell_make_sugfile()
5538 free_blocks(spin->si_blocks); in spell_make_sugfile()
5539 close_spellbuf(spin->si_spellbuf); in spell_make_sugfile()
5546 sug_filltree(spellinfo_T *spin, slang_T *slang) in sug_filltree() argument
5561 spin->si_foldroot = wordtree_alloc(spin); in sug_filltree()
5562 if (spin->si_foldroot == NULL) in sug_filltree()
5566 spin->si_sugtree = TRUE; in sug_filltree()
5608 if (tree_add_word(spin, tsalword, spin->si_foldroot, in sug_filltree()
5618 spin->si_blocks_cnt = 0; in sug_filltree()
5652 sug_maketable(spellinfo_T *spin) in sug_maketable() argument
5659 spin->si_spellbuf = open_spellbuf(); in sug_maketable()
5660 if (spin->si_spellbuf == NULL) in sug_maketable()
5668 if (sug_filltable(spin, spin->si_foldroot->wn_sibling, 0, &ga) == -1) in sug_maketable()
5682 spellinfo_T *spin, in sug_filltable() argument
5717 if (ml_append_buf(spin->si_spellbuf, (linenr_T)wordnr, in sug_filltable()
5734 wordnr = sug_filltable(spin, p->wn_child, wordnr, gap); in sug_filltable()
5791 sug_write(spellinfo_T *spin, char_u *fname) in sug_write() argument
5811 spell_message(spin, IObuff); in sug_write()
5824 put_time(fd, spin->si_sugtime); // <timestamp> in sug_write()
5829 spin->si_memtot = 0; in sug_write()
5830 tree = spin->si_foldroot->wn_sibling; in sug_write()
5842 spin->si_memtot += nodecount + nodecount * sizeof(int); in sug_write()
5850 wcount = spin->si_spellbuf->b_ml.ml_line_count; in sug_write()
5856 line = ml_get_buf(spin->si_spellbuf, lnum, FALSE); in sug_write()
5863 spin->si_memtot += len; in sug_write()
5871 _("Estimated runtime memory use: %d bytes"), spin->si_memtot); in sug_write()
5872 spell_message(spin, IObuff); in sug_write()
5904 spellinfo_T spin; in mkspell() local
5906 CLEAR_FIELD(spin); in mkspell()
5907 spin.si_verbose = !added_word; in mkspell()
5908 spin.si_ascii = ascii; in mkspell()
5909 spin.si_followup = TRUE; in mkspell()
5910 spin.si_rem_accents = TRUE; in mkspell()
5911 ga_init2(&spin.si_rep, (int)sizeof(fromto_T), 20); in mkspell()
5912 ga_init2(&spin.si_repsal, (int)sizeof(fromto_T), 20); in mkspell()
5913 ga_init2(&spin.si_sal, (int)sizeof(fromto_T), 20); in mkspell()
5914 ga_init2(&spin.si_map, (int)sizeof(char_u), 100); in mkspell()
5915 ga_init2(&spin.si_comppat, (int)sizeof(char_u *), 20); in mkspell()
5916 ga_init2(&spin.si_prefcond, (int)sizeof(char_u *), 50); in mkspell()
5917 hash_init(&spin.si_commonwords); in mkspell()
5918 spin.si_newcompID = 127; // start compound ID at first maximum in mkspell()
5944 fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc()); in mkspell()
5954 fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc()); in mkspell()
5958 spin.si_ascii = TRUE; in mkspell()
5962 spin.si_add = TRUE; in mkspell()
6007 spin.si_region_name[i * 2] = TOLOWER_ASC(innames[i][len - 2]); in mkspell()
6008 spin.si_region_name[i * 2 + 1] = in mkspell()
6012 spin.si_region_count = incount; in mkspell()
6014 spin.si_foldroot = wordtree_alloc(&spin); in mkspell()
6015 spin.si_keeproot = wordtree_alloc(&spin); in mkspell()
6016 spin.si_prefroot = wordtree_alloc(&spin); in mkspell()
6017 if (spin.si_foldroot == NULL in mkspell()
6018 || spin.si_keeproot == NULL in mkspell()
6019 || spin.si_prefroot == NULL) in mkspell()
6021 free_blocks(spin.si_blocks); in mkspell()
6030 if (!spin.si_add) in mkspell()
6031 spin.si_clear_chartab = TRUE; in mkspell()
6040 spin.si_conv.vc_type = CONV_NONE; in mkspell()
6041 spin.si_region = 1 << i; in mkspell()
6048 afile[i] = spell_read_aff(&spin, fname); in mkspell()
6056 if (spell_read_dic(&spin, fname, afile[i]) == FAIL) in mkspell()
6064 if (spell_read_wordfile(&spin, innames[i]) == FAIL) in mkspell()
6069 convert_setup(&spin.si_conv, NULL, NULL); in mkspell()
6072 if (spin.si_compflags != NULL && spin.si_nobreak) in mkspell()
6080 spell_message(&spin, (char_u *)_(msg_compressing)); in mkspell()
6081 wordtree_compress(&spin, spin.si_foldroot, "case-folded"); in mkspell()
6082 wordtree_compress(&spin, spin.si_keeproot, "keep-case"); in mkspell()
6083 wordtree_compress(&spin, spin.si_prefroot, "prefixes"); in mkspell()
6093 spell_message(&spin, IObuff); in mkspell()
6095 error = write_vim_spell(&spin, wfname) == FAIL; in mkspell()
6097 spell_message(&spin, (char_u *)_("Done!")); in mkspell()
6099 _("Estimated runtime memory use: %d bytes"), spin.si_memtot); in mkspell()
6100 spell_message(&spin, IObuff); in mkspell()
6110 ga_clear(&spin.si_rep); in mkspell()
6111 ga_clear(&spin.si_repsal); in mkspell()
6112 ga_clear(&spin.si_sal); in mkspell()
6113 ga_clear(&spin.si_map); in mkspell()
6114 ga_clear(&spin.si_comppat); in mkspell()
6115 ga_clear(&spin.si_prefcond); in mkspell()
6116 hash_clear_all(&spin.si_commonwords, 0); in mkspell()
6124 free_blocks(spin.si_blocks); in mkspell()
6130 if (spin.si_sugtime != 0 && !error && !got_int) in mkspell()
6131 spell_make_sugfile(&spin, wfname); in mkspell()
6145 spell_message(spellinfo_T *spin, char_u *str) in spell_message() argument
6147 if (spin->si_verbose || p_verbose > 2) in spell_message()
6149 if (!spin->si_verbose) in spell_message()
6153 if (!spin->si_verbose) in spell_message()