#include <stdint.h>
#include <stdio.h>
#include <wctype.h>
#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
#include "nvim/ex_cmds2.h"
#include "nvim/fileio.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/option.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
#include "nvim/path.h"
#include "nvim/regexp.h"
#include "nvim/screen.h"
#include "nvim/spell.h"
#include "nvim/spell_defs.h"
#include "nvim/spellfile.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
#include "nvim/vim.h"
#include <time.h>
Data Structures | |
struct | afffile_S |
struct | affentry_S |
struct | affheader_S |
struct | compitem_S |
struct | sblock_S |
struct | wordnode_S |
struct | spellinfo_S |
Macros | |
#define | BY_NOFLAGS 0 |
#define | BY_INDEX 1 |
#define | BY_FLAGS 2 |
#define | BY_FLAGS2 3 |
#define | BY_SPECIAL BY_FLAGS2 |
#define | ZERO_FLAG 65009 |
#define | SAL_F0LLOWUP 1 |
#define | SAL_COLLAPSE 2 |
#define | SAL_REM_ACCENTS 4 |
#define | VIMSPELLMAGIC "VIMspell" |
#define | VIMSPELLMAGICL (sizeof(VIMSPELLMAGIC) - 1) |
#define | VIMSPELLVERSION 50 |
#define | SN_REGION 0 |
#define | SN_CHARFLAGS 1 |
#define | SN_MIDWORD 2 |
#define | SN_PREFCOND 3 |
#define | SN_REP 4 |
#define | SN_SAL 5 |
#define | SN_SOFO 6 |
#define | SN_MAP 7 |
#define | SN_COMPOUND 8 |
#define | SN_SYLLABLE 9 |
#define | SN_NOBREAK 10 |
#define | SN_SUGFILE 11 |
#define | SN_REPSAL 12 |
#define | SN_WORDS 13 |
#define | SN_NOSPLITSUGS 14 |
#define | SN_INFO 15 |
#define | SN_NOCOMPOUNDSUGS 16 |
#define | SN_END 255 |
#define | SNF_REQUIRED 1 |
#define | CF_WORD 0x01 |
#define | CF_UPPER 0x02 |
#define | MAXLINELEN 500 |
#define | AFT_CHAR 0 |
#define | AFT_LONG 1 |
#define | AFT_CAPLONG 2 |
#define | AFT_NUM 3 |
#define | AH_KEY_LEN 17 |
#define | HI2AH(hi) ((affheader_T *)(hi)->hi_key) |
#define | HI2CI(hi) ((compitem_T *)(hi)->hi_key) |
#define | SBLOCKSIZE 16000 |
#define | WN_MASK 0xffff |
#define | HI2WN(hi) (wordnode_T *)((hi)->hi_key) |
#define | SPELL_READ_BYTES(buf, n, fd, exit_code) |
#define | SPELL_READ_NONNUL_BYTES(buf, n, fd, exit_code) |
#define | SHARED_MASK 0x8000000 |
#define | PFX_FLAGS (-256) |
#define | CONDIT_COMB 1 |
#define | CONDIT_CFIX 2 |
#define | CONDIT_SUF 4 |
#define | CONDIT_AFF 8 |
#define | MAXITEMCNT 30 |
Typedefs | |
typedef struct afffile_S | afffile_T |
typedef struct affentry_S | affentry_T |
typedef struct affheader_S | affheader_T |
typedef struct compitem_S | compitem_T |
typedef struct sblock_S | sblock_T |
typedef struct wordnode_S | wordnode_T |
typedef struct spellinfo_S | spellinfo_T |
Functions | |
slang_T * | spell_load_file (char_u *fname, char_u *lang, slang_T *old_lp, bool silent) |
void | suggest_load_files (void) |
if (len< 0) | |
if ((size_t) len >=SIZE_MAX/sizeof(int)) | |
if (len > 0) | |
int | spell_check_msm (void) |
void | ex_mkspell (exarg_T *eap) |
void | ex_spell (exarg_T *eap) |
void | spell_add_word (char_u *word, int len, SpellAddType what, int idx, bool undo) |
Variables | |
static int char_u * | bp |
idx_T * | ip |
long | len = get4c(fd) |
return | |
#define AFT_CAPLONG 2 |
#define AFT_CHAR 0 |
#define AFT_LONG 1 |
#define AFT_NUM 3 |
#define AH_KEY_LEN 17 |
#define BY_FLAGS 2 |
#define BY_FLAGS2 3 |
#define BY_INDEX 1 |
#define BY_NOFLAGS 0 |
#define BY_SPECIAL BY_FLAGS2 |
#define CF_UPPER 0x02 |
#define CF_WORD 0x01 |
#define CONDIT_AFF 8 |
#define CONDIT_CFIX 2 |
#define CONDIT_COMB 1 |
#define CONDIT_SUF 4 |
#define HI2AH | ( | hi | ) | ((affheader_T *)(hi)->hi_key) |
#define HI2CI | ( | hi | ) | ((compitem_T *)(hi)->hi_key) |
#define HI2WN | ( | hi | ) | (wordnode_T *)((hi)->hi_key) |
#define MAXITEMCNT 30 |
#define MAXLINELEN 500 |
#define PFX_FLAGS (-256) |
#define SAL_COLLAPSE 2 |
#define SAL_F0LLOWUP 1 |
#define SAL_REM_ACCENTS 4 |
#define SBLOCKSIZE 16000 |
#define SHARED_MASK 0x8000000 |
#define SN_CHARFLAGS 1 |
#define SN_COMPOUND 8 |
#define SN_END 255 |
#define SN_INFO 15 |
#define SN_MAP 7 |
#define SN_MIDWORD 2 |
#define SN_NOBREAK 10 |
#define SN_NOCOMPOUNDSUGS 16 |
#define SN_NOSPLITSUGS 14 |
#define SN_PREFCOND 3 |
#define SN_REGION 0 |
#define SN_REP 4 |
#define SN_REPSAL 12 |
#define SN_SAL 5 |
#define SN_SOFO 6 |
#define SN_SUGFILE 11 |
#define SN_SYLLABLE 9 |
#define SN_WORDS 13 |
#define SNF_REQUIRED 1 |
Read n bytes from fd to buf, returning on errors
[out] | buf | Buffer to read to, must be at least n bytes long. |
[in] | n | Amount of bytes to read. |
fd | FILE* to read from. | |
exit_code | Code to run before returning. |
Like SPELL_READ_BYTES, but also error out if NUL byte was read
#define VIMSPELLMAGIC "VIMspell" |
#define VIMSPELLMAGICL (sizeof(VIMSPELLMAGIC) - 1) |
#define VIMSPELLVERSION 50 |
#define WN_MASK 0xffff |
#define ZERO_FLAG 65009 |
typedef struct affentry_S affentry_T |
typedef struct affheader_S affheader_T |
typedef struct compitem_S compitem_T |
typedef struct spellinfo_S spellinfo_T |
typedef struct wordnode_S wordnode_T |
if | ( | (size_t) len >=SIZE_MAX/sizeof(int) | ) |
if | ( | len | , |
0 | |||
) |
if | ( | ) |
void spell_add_word | ( | char_u * | word, |
int | len, | ||
SpellAddType | what, | ||
int | idx, | ||
bool | undo | ||
) |
Add "word[len]" to 'spellfile' as a good or bad word.
what | SPELL_ADD_ values |
idx | "zG" and "zW": zero, otherwise index in 'spellfile' |
bool | // true for "zug", "zuG", "zuw" and "zuW" |
int spell_check_msm | ( | void | ) |
Load one spell file and store the info into a slang_T.
This is invoked in three ways:
silent | no error if file doesn't exist |
int char_u* bp |
idx_T* ip |
return |