diff options
Diffstat (limited to 'src/nvim/spell_defs.h')
-rw-r--r-- | src/nvim/spell_defs.h | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/src/nvim/spell_defs.h b/src/nvim/spell_defs.h index dfa399750f..005f3aa9e4 100644 --- a/src/nvim/spell_defs.h +++ b/src/nvim/spell_defs.h @@ -4,16 +4,14 @@ #include <stdint.h> #include "nvim/buffer_defs.h" -#include "nvim/garray_defs.h" -#include "nvim/hashtab_defs.h" -#include "nvim/regexp_defs.h" -/// Assume max. word len is this many bytes. -/// Some places assume a word length fits in a byte, thus it can't be above 255. -enum { MAXWLEN = 254, }; +enum { + /// Assume max. word len is this many bytes. + /// Some places assume a word length fits in a byte, thus it can't be above 255. + MAXWLEN = 254, +}; -/// Number of regions supported. -enum { MAXREGIONS = 8, }; +enum { MAXREGIONS = 8, }; ///< Number of regions supported. /// Type used for indexes in the word tree need to be at least 4 bytes. If int /// is 8 bytes we could use something smaller, but what? @@ -77,7 +75,7 @@ enum { /// Info from "REP", "REPSAL" and "SAL" entries in ".aff" file used in si_rep, /// si_repsal, sl_rep, and si_sal. Not for sl_sal! /// One replacement: from "ft_from" to "ft_to". -typedef struct fromto_S { +typedef struct { char *ft_from; char *ft_to; } fromto_T; @@ -85,7 +83,7 @@ typedef struct fromto_S { /// Info from "SAL" entries in ".aff" file used in sl_sal. /// The info is split for quick processing by spell_soundfold(). /// Note that "sm_oneof" and "sm_rules" point into sm_lead. -typedef struct salitem_S { +typedef struct { char *sm_lead; ///< leading letters int sm_leadlen; ///< length of "sm_lead" char *sm_oneof; ///< letters from () or NULL @@ -191,7 +189,7 @@ struct slang_S { }; /// Structure used in "b_langp", filled from 'spelllang'. -typedef struct langp_S { +typedef struct { slang_T *lp_slang; ///< info for this language slang_T *lp_sallang; ///< language used for sound folding or NULL slang_T *lp_replang; ///< language used for REP items or NULL @@ -215,18 +213,6 @@ typedef struct { uint8_t st_upper[256]; ///< chars: upper case } spelltab_T; -// Use our own character-case definitions, because the current locale may -// differ from what the .spl file uses. -// These must not be called with negative number! -// Multi-byte implementation. For Unicode we can call utf_*(), but don't do -// that for ASCII, because we don't want to use 'casemap' here. Otherwise use -// the "w" library function for characters above 255. -#define SPELL_TOFOLD(c) ((c) >= 128 ? utf_fold(c) : (int)spelltab.st_fold[c]) - -#define SPELL_TOUPPER(c) ((c) >= 128 ? mb_toupper(c) : (int)spelltab.st_upper[c]) - -#define SPELL_ISUPPER(c) ((c) >= 128 ? mb_isupper(c) : spelltab.st_isu[c]) - /// Values for "what" argument of spell_add_word() typedef enum { SPELL_ADD_GOOD = 0, @@ -234,7 +220,7 @@ typedef enum { SPELL_ADD_RARE = 2, } SpellAddType; -typedef struct wordcount_S { +typedef struct { uint16_t wc_count; ///< nr of times word was seen char wc_word[]; ///< word } wordcount_T; |