0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.0735: cannot handle binary data

Problem:    Cannot handle binary data.
Solution:   Add the Blob type. (Yasuhiro Matsumoto, closes #3638)
This commit is contained in:
Bram Moolenaar
2019-01-12 22:47:31 +01:00
parent e3c74d249a
commit 6e5ea8d2a9
27 changed files with 1354 additions and 114 deletions

View File

@@ -1251,6 +1251,7 @@ typedef double float_T;
typedef struct listvar_S list_T;
typedef struct dictvar_S dict_T;
typedef struct partial_S partial_T;
typedef struct blobvar_S blob_T;
typedef struct jobvar_S job_T;
typedef struct readq_S readq_T;
@@ -1272,6 +1273,7 @@ typedef enum
VAR_SPECIAL, // "v_number" is used
VAR_JOB, // "v_job" is used
VAR_CHANNEL, // "v_channel" is used
VAR_BLOB, // "v_blob" is used
} vartype_T;
/*
@@ -1295,6 +1297,7 @@ typedef struct
job_T *v_job; /* job value (can be NULL!) */
channel_T *v_channel; /* channel value (can be NULL!) */
#endif
blob_T *v_blob; /* blob value (can be NULL!) */
} vval;
} typval_T;
@@ -1401,6 +1404,16 @@ struct dictvar_S
dict_T *dv_used_prev; /* previous dict in used dicts list */
};
/*
* Structure to hold info about a blob.
*/
struct blobvar_S
{
garray_T bv_ga; // growarray with the data
int bv_refcount; // reference count
char bv_lock; // zero, VAR_LOCKED, VAR_FIXED
};
#if defined(FEAT_EVAL) || defined(PROTO)
typedef struct funccall_S funccall_T;
@@ -3526,6 +3539,7 @@ typedef struct lval_S
dict_T *ll_dict; /* The Dictionary or NULL */
dictitem_T *ll_di; /* The dictitem or NULL */
char_u *ll_newkey; /* New key for Dict in alloc. mem or NULL. */
blob_T *ll_blob; /* The Blob or NULL */
} lval_T;
/* Structure used to save the current state. Used when executing Normal mode