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  infoptr_T *ml_stack; // stack of pointer blocks (array of IPTRs)
49  int ml_stack_top; // current top of ml_stack
50  int ml_stack_size; // total number of entries in ml_stack
51 
52 #define ML_EMPTY 1 // empty buffer
53 #define ML_LINE_DIRTY 2 // cached line was changed and allocated
54 #define ML_LOCKED_DIRTY 4 // ml_locked was changed
55 #define ML_LOCKED_POS 8 // ml_locked needs positive block number
56  int ml_flags;
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  size_t ml_line_offset; // cached byte offset of ml_line_lnum
61  int ml_line_offset_ff; // fileformat of cached line
62 
63  bhdr_T *ml_locked; // block used by last ml_get
64  linenr_T ml_locked_low; // first line in ml_locked
65  linenr_T ml_locked_high; // last line in ml_locked
66  int ml_locked_lineadd; // number of lines inserted in ml_locked
70 } memline_T;
71 
72 #endif // NVIM_MEMLINE_DEFS_H
memline::ml_locked_lineadd
int ml_locked_lineadd
Definition: memline_defs.h:66
memline::ml_mfp
memfile_T * ml_mfp
Definition: memline_defs.h:46
memline::ml_stack_top
int ml_stack_top
Definition: memline_defs.h:49
memline::ml_usedchunks
int ml_usedchunks
Definition: memline_defs.h:69
memline::ml_line_count
linenr_T ml_line_count
Definition: memline_defs.h:44
memline::ml_stack
infoptr_T * ml_stack
Definition: memline_defs.h:48
memline_T
struct memline memline_T
memline::ml_line_ptr
char_u * ml_line_ptr
Definition: memline_defs.h:59
memfile
A memory file.
Definition: memfile_defs.h:90
infoptr_T
struct info_pointer infoptr_T
info_pointer::ip_high
linenr_T ip_high
Definition: memline_defs.h:14
blocknr_T
int64_t blocknr_T
Definition: memfile_defs.h:16
memline::ml_numchunks
int ml_numchunks
Definition: memline_defs.h:68
memline::ml_chunksize
chunksize_T * ml_chunksize
Definition: memline_defs.h:67
memline::ml_flags
int ml_flags
Definition: memline_defs.h:56
memline::ml_line_lnum
linenr_T ml_line_lnum
Definition: memline_defs.h:58
info_pointer::ip_low
linenr_T ip_low
Definition: memline_defs.h:13
info_pointer::ip_bnum
blocknr_T ip_bnum
Definition: memline_defs.h:12
ml_chunksize
Definition: memline_defs.h:18
memfile_defs.h
info_pointer::ip_index
int ip_index
Definition: memline_defs.h:15
memline::ml_locked
bhdr_T * ml_locked
Definition: memline_defs.h:63
chunksize_T
struct ml_chunksize chunksize_T
memline::ml_stack_size
int ml_stack_size
Definition: memline_defs.h:50
ml_chunksize::mlcs_numlines
int mlcs_numlines
Definition: memline_defs.h:19
char_u
unsigned char char_u
Definition: types.h:12
memline::ml_locked_high
linenr_T ml_locked_high
Definition: memline_defs.h:65
bhdr
Definition: memfile_defs.h:63
memline::ml_locked_low
linenr_T ml_locked_low
Definition: memline_defs.h:64
memline
Definition: memline_defs.h:43
linenr_T
long linenr_T
Definition: pos.h:7
ml_chunksize::mlcs_totalsize
long mlcs_totalsize
Definition: memline_defs.h:20
memline::ml_line_offset_ff
int ml_line_offset_ff
Definition: memline_defs.h:61
memline::ml_line_offset
size_t ml_line_offset
Definition: memline_defs.h:60
info_pointer
Definition: memline_defs.h:11