summaryrefslogtreecommitdiff
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-06-21 06:15:46 +0200
committerBram Moolenaar <Bram@vim.org>2010-06-21 06:15:46 +0200
commita8ffcbbf5d6070380e41b3d0841c3944396a27c0 (patch)
treeb8608922fc9956be229912f1323b0d0a94de526c /src/structs.h
parent191e0a2bc7cb4787e19aa1f8c6958b47e05d7882 (diff)
downloadvim-git-a8ffcbbf5d6070380e41b3d0841c3944396a27c0.tar.gz
Crypt the swapfile.
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/structs.h b/src/structs.h
index 4f72f998b..a1c7e9d9a 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -392,7 +392,7 @@ struct block_hdr
bhdr_T *bh_prev; /* previous block_hdr in used list */
bhdr_T *bh_hash_next; /* next block_hdr in hash list */
bhdr_T *bh_hash_prev; /* previous block_hdr in hash list */
- blocknr_T bh_bnum; /* block number */
+ blocknr_T bh_bnum; /* block number */
char_u *bh_data; /* pointer to memory (for used block) */
int bh_page_count; /* number of pages in this block */
@@ -491,12 +491,15 @@ typedef struct
# endif
} cmdmod_T;
+typedef struct file_buffer buf_T; /* forward declaration */
+
/*
* Simplistic hashing scheme to quickly locate the blocks in the used list.
* 64 blocks are found directly (64 * 4K = 256K, most files are smaller).
*/
#define MEMHASHSIZE 64
#define MEMHASH(nr) ((nr) & (MEMHASHSIZE - 1))
+#define MF_SEED_LEN 8
struct memfile
{
@@ -516,6 +519,16 @@ struct memfile
blocknr_T mf_infile_count; /* number of pages in the file */
unsigned mf_page_size; /* number of bytes in a page */
int mf_dirty; /* TRUE if there are dirty blocks */
+#ifdef FEAT_CRYPT
+ buf_T *mf_buffer; /* bufer this memfile is for */
+ char_u mf_seed[MF_SEED_LEN]; /* seed for encryption */
+
+ /* Values for key, method and seed used for reading data blocks when
+ * updating for a newly set key or method. Only when mf_old_key != NULL. */
+ char_u *mf_old_key;
+ int mf_old_cm;
+ char_u mf_old_seed[MF_SEED_LEN];
+#endif
};
/*
@@ -1229,8 +1242,6 @@ typedef struct {
* A buffer is new if the associated file has never been loaded yet.
*/
-typedef struct file_buffer buf_T;
-
struct file_buffer
{
memline_T b_ml; /* associated memline (also contains line