Lines Matching refs:lp
309 static int read_prefcond_section(FILE *fd, slang_T *lp);
312 static int read_words_section(FILE *fd, slang_T *lp, int len);
315 static int set_sofo(slang_T *lp, char_u *from, char_u *to);
316 static void set_sal_first(slang_T *lp);
322 static void set_map_str(slang_T *lp, char_u *map);
358 slang_T *lp = NULL; in spell_load_file() local
386 lp = slang_alloc(lang); in spell_load_file()
387 if (lp == NULL) in spell_load_file()
391 lp->sl_fname = vim_strsave(fname); in spell_load_file()
392 if (lp->sl_fname == NULL) in spell_load_file()
396 lp->sl_add = strstr((char *)gettail(fname), SPL_FNAME_ADD) != NULL; in spell_load_file()
399 lp = old_lp; in spell_load_file()
447 lp->sl_info = read_string(fd, len); // <infotext> in spell_load_file()
448 if (lp->sl_info == NULL) in spell_load_file()
453 res = read_region_section(fd, lp, len); in spell_load_file()
461 lp->sl_midword = read_string(fd, len); // <midword> in spell_load_file()
462 if (lp->sl_midword == NULL) in spell_load_file()
467 res = read_prefcond_section(fd, lp); in spell_load_file()
471 res = read_rep_section(fd, &lp->sl_rep, lp->sl_rep_first); in spell_load_file()
475 res = read_rep_section(fd, &lp->sl_repsal, lp->sl_repsal_first); in spell_load_file()
479 res = read_sal_section(fd, lp); in spell_load_file()
483 res = read_sofo_section(fd, lp); in spell_load_file()
490 set_map_str(lp, p); in spell_load_file()
495 res = read_words_section(fd, lp, len); in spell_load_file()
499 lp->sl_sugtime = get8ctime(fd); // <timestamp> in spell_load_file()
503 lp->sl_nosplitsugs = TRUE; in spell_load_file()
507 lp->sl_nocompoundsugs = TRUE; in spell_load_file()
511 res = read_compound(fd, lp, len); in spell_load_file()
515 lp->sl_nobreak = TRUE; in spell_load_file()
519 lp->sl_syllable = read_string(fd, len); // <syllable> in spell_load_file()
520 if (lp->sl_syllable == NULL) in spell_load_file()
522 if (init_syl_tab(lp) != OK) in spell_load_file()
556 res = spell_read_tree(fd, &lp->sl_fbyts, &lp->sl_fbyts_len, in spell_load_file()
557 &lp->sl_fidxs, FALSE, 0); in spell_load_file()
562 res = spell_read_tree(fd, &lp->sl_kbyts, NULL, &lp->sl_kidxs, FALSE, 0); in spell_load_file()
567 res = spell_read_tree(fd, &lp->sl_pbyts, NULL, &lp->sl_pidxs, TRUE, in spell_load_file()
568 lp->sl_prefixcnt); in spell_load_file()
575 lp->sl_next = first_lang; in spell_load_file()
576 first_lang = lp; in spell_load_file()
585 if (lp != NULL && old_lp == NULL) in spell_load_file()
586 slang_free(lp); in spell_load_file()
587 lp = NULL; in spell_load_file()
598 return lp; in spell_load_file()
669 langp_T *lp; in suggest_load_files() local
685 lp = LANGP_ENTRY(curwin->w_s->b_langp, lpi); in suggest_load_files()
686 slang = lp->lp_slang; in suggest_load_files()
844 read_region_section(FILE *fd, slang_T *lp, int len) in read_region_section() argument
851 lp->sl_regions[i] = getc(fd); // <regionname> in read_region_section()
852 lp->sl_regions[len] = NUL; in read_region_section()
899 read_prefcond_section(FILE *fd, slang_T *lp) in read_prefcond_section() argument
912 lp->sl_prefprog = ALLOC_CLEAR_MULT(regprog_T *, cnt); in read_prefcond_section()
913 if (lp->sl_prefprog == NULL) in read_prefcond_section()
915 lp->sl_prefixcnt = cnt; in read_prefcond_section()
933 lp->sl_prefprog[i] = vim_regcomp(buf, RE_MAGIC + RE_STRING); in read_prefcond_section()
1141 read_words_section(FILE *fd, slang_T *lp, int len) in read_words_section() argument
1164 count_common_word(lp, word, -1, 10); in read_words_section()
1409 set_sofo(slang_T *lp, char_u *from, char_u *to) in set_sofo() argument
1425 gap = &lp->sl_sal; in set_sofo()
1439 ++lp->sl_sal_first[c & 0xff]; in set_sofo()
1446 if (lp->sl_sal_first[i] > 0) in set_sofo()
1448 p = alloc(sizeof(int) * (lp->sl_sal_first[i] * 2 + 1)); in set_sofo()
1457 vim_memset(lp->sl_sal_first, 0, sizeof(salfirst_T) * 256); in set_sofo()
1475 lp->sl_sal_first[c] = i; in set_sofo()
1485 lp->sl_sal_first[from[i]] = to[i]; in set_sofo()
1486 lp->sl_sal.ga_len = 1; // indicates we have soundfolding in set_sofo()
1496 set_sal_first(slang_T *lp) in set_sal_first() argument
1502 garray_T *gap = &lp->sl_sal; in set_sal_first()
1504 sfirst = lp->sl_sal_first; in set_sal_first()
6612 set_map_str(slang_T *lp, char_u *map) in set_map_str() argument
6621 lp->sl_has_map = FALSE; in set_map_str()
6624 lp->sl_has_map = TRUE; in set_map_str()
6628 lp->sl_map_array[i] = 0; in set_map_str()
6629 hash_init(&lp->sl_map_hash); in set_map_str()
6665 hi = hash_lookup(&lp->sl_map_hash, b, hash); in set_map_str()
6667 hash_add_item(&lp->sl_map_hash, hi, b, hash); in set_map_str()
6677 lp->sl_map_array[c] = headc; in set_map_str()