memline_defs.h
Go to the documentation of this file.
1 #ifndef NVIM_MEMLINE_DEFS_H
2 #define NVIM_MEMLINE_DEFS_H
3 
4 #include "nvim/memfile_defs.h"
5 
11 typedef struct info_pointer {
12  blocknr_T ip_bnum; // block number
13  linenr_T ip_low; // lowest lnum in this block
14  linenr_T ip_high; // highest lnum in this block
15  int ip_index; // index for block with current lnum
16 } infoptr_T; // block/index pair
17 
18 typedef struct ml_chunksize {
21 } chunksize_T;
22 
23 // Flags when calling ml_updatechunk()
24 #define ML_CHNK_ADDLINE 1
25 #define ML_CHNK_DELLINE 2
26 #define ML_CHNK_UPDLINE 3
27 
43 typedef struct memline {
44  linenr_T ml_line_count; // number of lines in the buffer
45 
46  memfile_T *ml_mfp; // pointer to associated memfile
47 
48 #define ML_EMPTY 1 // empty buffer
49 #define ML_LINE_DIRTY 2 // cached line was changed and allocated
50 #define ML_LOCKED_DIRTY 4 // ml_locked was changed
51 #define ML_LOCKED_POS 8 // ml_locked needs positive block number
52  int ml_flags;
53 
54  infoptr_T *ml_stack; // stack of pointer blocks (array of IPTRs)
55  int ml_stack_top; // current top of ml_stack
56  int ml_stack_size; // total number of entries in ml_stack
57 
58  linenr_T ml_line_lnum; // line number of cached line, 0 if not valid
59  char_u *ml_line_ptr; // pointer to cached line
60 
61  bhdr_T *ml_locked; // block used by last ml_get
62  linenr_T ml_locked_low; // first line in ml_locked
63  linenr_T ml_locked_high; // last line in ml_locked
64  int ml_locked_lineadd; // number of lines inserted in ml_locked
68 } memline_T;
69 
70 #endif // NVIM_MEMLINE_DEFS_H
linenr_T ml_line_lnum
Definition: memline_defs.h:58
linenr_T ml_line_count
Definition: memline_defs.h:44
blocknr_T ip_bnum
Definition: memline_defs.h:12
int ip_index
Definition: memline_defs.h:15
int ml_stack_top
Definition: memline_defs.h:55
linenr_T ml_locked_low
Definition: memline_defs.h:62
struct info_pointer infoptr_T
linenr_T ip_high
Definition: memline_defs.h:14
char_u * ml_line_ptr
Definition: memline_defs.h:59
A memory file.
Definition: memfile_defs.h:90
chunksize_T * ml_chunksize
Definition: memline_defs.h:65
infoptr_T * ml_stack
Definition: memline_defs.h:54
Definition: memline_defs.h:11
struct ml_chunksize chunksize_T
Definition: memline_defs.h:18
linenr_T ip_low
Definition: memline_defs.h:13
long mlcs_totalsize
Definition: memline_defs.h:20
Definition: memline_defs.h:43
int ml_flags
Definition: memline_defs.h:52
Definition: memfile_defs.h:63
int ml_locked_lineadd
Definition: memline_defs.h:64
int ml_numchunks
Definition: memline_defs.h:66
bhdr_T * ml_locked
Definition: memline_defs.h:61
linenr_T ml_locked_high
Definition: memline_defs.h:63
int ml_stack_size
Definition: memline_defs.h:56
int mlcs_numlines
Definition: memline_defs.h:19
long linenr_T
Definition: pos.h:4
int64_t blocknr_T
Definition: memfile_defs.h:16
unsigned char char_u
Definition: types.h:11
struct memline memline_T
int ml_usedchunks
Definition: memline_defs.h:67
memfile_T * ml_mfp
Definition: memline_defs.h:46