summaryrefslogtreecommitdiffstats
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-12 22:47:31 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-12 22:47:31 +0100
commit6e5ea8d2a995b32bbc5972edc4f827b959f2702f (patch)
treeb1ad7d6a83f53220227122719d5eb97dd32ff1e6 /src/structs.h
parente3c74d249ac36404d8af25f74baf335d143b30e3 (diff)
patch 8.1.0735: cannot handle binary datav8.1.0735
Problem: Cannot handle binary data. Solution: Add the Blob type. (Yasuhiro Matsumoto, closes #3638)
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/structs.h b/src/structs.h
index a53d1d0627..d573272027 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -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