#ifndef NVIM_BUFFER_DEFS_H
#define NVIM_BUFFER_DEFS_H
#include <stdbool.h>
#include <stdint.h>
// for FILE
#include <stdio.h>
typedef struct file_buffer buf_T; // Forward declaration
// Reference to a buffer that stores the value of buf_free_count.
// bufref_valid() only needs to check "buf" when the count differs.
typedef struct {
buf_T *br_buf;
int br_fnum;
int br_buf_free_count;
} bufref_T;
// for garray_T
#include "nvim/garray.h"
// for ScreenGrid
#include "nvim/grid_defs.h"
// for HLF_COUNT
#include "nvim/highlight_defs.h"
// for pos_T, lpos_T and linenr_T
#include "nvim/pos.h"
// for the number window-local and buffer-local options
#include "nvim/option_defs.h"
// for jump list and tag stack sizes in a buffer and mark types
#include "nvim/mark_defs.h"
// for u_header_T; needs buf_T.
#include "nvim/undo_defs.h"
// for hashtab_T
#include "nvim/hashtab.h"
// for dict_T
#include "nvim/eval/typval.h"
// for proftime_T
#include "nvim/profile.h"
// for String
#include "nvim/api/private/defs.h"
// for Map(K, V)
#include "nvim/map.h"
// for kvec
#include "nvim/lib/kvec.h"
// for marktree
#include "nvim/marktree.h"
#define GETFILE_SUCCESS(x) ((x) <= 0)
#define MODIFIABLE(buf) (buf->b_p_ma)
/*
* Flags for w_valid.
* These are set when something in a window structure becomes invalid, except
* when the cursor is moved. Call check_cursor_moved() before testing one of
* the flags.
* These are reset when that thing has been updated and is valid again.
*
* Every function that invalidates one of these must call one of the
* invalidate_* functions.
*
* w_valid is supposed to be used only in screen.c. From other files, use the
* functions that set or reset the flags.
*
* VALID_BOTLINE VALID_BOTLINE_AP
* on on w_botline valid
* off on w_botline approximated
* off off w_botline not valid
* on off not possible
*/
#define VALID_WROW 0x01 // w_wrow (window row) is valid
#define VALID_WCOL 0x02 // w_wcol (window col) is valid
#define VALID_VIRTCOL 0x04 // w_virtcol (file col) is valid
#define VALID_CHEIGHT 0x08 // w_cline_height and w_cline_folded valid
#define VALID_CROW 0x10 // w_cline_row is valid
#define VALID_BOTLINE 0x20 // w_botine and w_empty_rows are valid
#define VALID_BOTLINE_AP 0x40 // w_botine is approximated
#define VALID_TOPLINE 0x80 // w_topline is valid (for cursor position)
// flags for b_flags
#define BF_RECOVERED 0x01 // buffer has been recovered
#define BF_CHECK_RO 0x02 // need to check readonly when loading file
// into buffer (set by ":e", may be reset by
// ":buf")
#define BF_NEVERLOADED 0x04 // file has never been loaded into buffer,
// many variables still need to be set
#define BF_NOTEDITED 0x08 // Set when file name is changed after
// starting to edit, reset when file is
// written out.
#define BF_NEW 0x10 // file didn't exist when editing started
#define BF_NEW_W 0x20 // Warned for BF_NEW and file created
#define BF_READERR 0x40 // got errors while reading the file
#define BF_DUMMY 0x80 // dummy buffer, only used internally
#define BF_PRESERVED 0x100 // ":preserve" was used
#define BF_SYN_SET 0x200 // 'syntax' option was set
// Mask to check for flags that prevent normal writing
#define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR)
typedef struct window_S win_T;
typedef struct wininfo_S wininfo_T;
typedef struct frame_S frame_T;
typedef uint64_t disptick_T; // display tick type
// for struct memline (it needs memfile_T)
#include "nvim/memline_defs.h"
// for struct memfile, bhdr_T, blocknr_T... (it needs buf_T)
#include "nvim/memfile_defs.h"
// for regprog_T. Needs win_T and buf_T.
#include "nvim/regexp_defs.h"
// for synstate_T (needs reg_extmatch_T, win_T, buf_T)
#include "nvim/syntax_defs.h"
// for sign_entry_T
#include "nvim/os/fs_defs.h" // for FileID
#include "nvim/sign_defs.h"
#include "nvim/terminal.h" // for Terminal
/*
* The taggy struct is used to store the information about a :tag command.
*/
typedef struct taggy <
|