aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memfile.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/memfile.h')
-rw-r--r--src/nvim/memfile.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/nvim/memfile.h b/src/nvim/memfile.h
index 085fa22f12..687ac042a4 100644
--- a/src/nvim/memfile.h
+++ b/src/nvim/memfile.h
@@ -1,16 +1,25 @@
-#ifndef NVIM_MEMFILE_H
-#define NVIM_MEMFILE_H
+#pragma once
-#include "nvim/buffer_defs.h"
-#include "nvim/memfile_defs.h"
+#include "nvim/buffer_defs.h" // IWYU pragma: keep
+#include "nvim/memfile_defs.h" // IWYU pragma: export
/// flags for mf_sync()
-#define MFS_ALL 1 /// also sync blocks with negative numbers
-#define MFS_STOP 2 /// stop syncing when a character is available
-#define MFS_FLUSH 4 /// flushed file to disk
-#define MFS_ZERO 8 /// only write block 0
+enum {
+ MFS_ALL = 1, ///< also sync blocks with negative numbers
+ MFS_STOP = 2, ///< stop syncing when a character is available
+ MFS_FLUSH = 4, ///< flushed file to disk
+ MFS_ZERO = 8, ///< only write block 0
+};
+
+enum {
+ /// Minimal size for block 0 of a swap file.
+ /// NOTE: This depends on size of struct block0! It's not done with a sizeof(),
+ /// because struct block0 is defined in memline.c (Sorry).
+ /// The maximal block size is arbitrary.
+ MIN_SWAP_PAGE_SIZE = 1048,
+ MAX_SWAP_PAGE_SIZE = 50000,
+};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "memfile.h.generated.h"
#endif
-#endif // NVIM_MEMFILE_H