Mercurial > vim
comparison src/structs.h @ 15454:1d2b5c016f17 v8.1.0735
patch 8.1.0735: cannot handle binary data
commit https://github.com/vim/vim/commit/6e5ea8d2a995b32bbc5972edc4f827b959f2702f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 12 22:47:31 2019 +0100
patch 8.1.0735: cannot handle binary data
Problem: Cannot handle binary data.
Solution: Add the Blob type. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/3638)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 12 Jan 2019 23:00:06 +0100 |
parents | 58b125df3e9b |
children | 55ccc2d353bd |
comparison
equal
deleted
inserted
replaced
15453:cdee6e827112 | 15454:1d2b5c016f17 |
---|---|
1249 typedef double float_T; | 1249 typedef double float_T; |
1250 | 1250 |
1251 typedef struct listvar_S list_T; | 1251 typedef struct listvar_S list_T; |
1252 typedef struct dictvar_S dict_T; | 1252 typedef struct dictvar_S dict_T; |
1253 typedef struct partial_S partial_T; | 1253 typedef struct partial_S partial_T; |
1254 typedef struct blobvar_S blob_T; | |
1254 | 1255 |
1255 typedef struct jobvar_S job_T; | 1256 typedef struct jobvar_S job_T; |
1256 typedef struct readq_S readq_T; | 1257 typedef struct readq_S readq_T; |
1257 typedef struct writeq_S writeq_T; | 1258 typedef struct writeq_S writeq_T; |
1258 typedef struct jsonq_S jsonq_T; | 1259 typedef struct jsonq_S jsonq_T; |
1270 VAR_DICT, // "v_dict" is used | 1271 VAR_DICT, // "v_dict" is used |
1271 VAR_FLOAT, // "v_float" is used | 1272 VAR_FLOAT, // "v_float" is used |
1272 VAR_SPECIAL, // "v_number" is used | 1273 VAR_SPECIAL, // "v_number" is used |
1273 VAR_JOB, // "v_job" is used | 1274 VAR_JOB, // "v_job" is used |
1274 VAR_CHANNEL, // "v_channel" is used | 1275 VAR_CHANNEL, // "v_channel" is used |
1276 VAR_BLOB, // "v_blob" is used | |
1275 } vartype_T; | 1277 } vartype_T; |
1276 | 1278 |
1277 /* | 1279 /* |
1278 * Structure to hold an internal variable without a name. | 1280 * Structure to hold an internal variable without a name. |
1279 */ | 1281 */ |
1293 partial_T *v_partial; /* closure: function with args */ | 1295 partial_T *v_partial; /* closure: function with args */ |
1294 #ifdef FEAT_JOB_CHANNEL | 1296 #ifdef FEAT_JOB_CHANNEL |
1295 job_T *v_job; /* job value (can be NULL!) */ | 1297 job_T *v_job; /* job value (can be NULL!) */ |
1296 channel_T *v_channel; /* channel value (can be NULL!) */ | 1298 channel_T *v_channel; /* channel value (can be NULL!) */ |
1297 #endif | 1299 #endif |
1300 blob_T *v_blob; /* blob value (can be NULL!) */ | |
1298 } vval; | 1301 } vval; |
1299 } typval_T; | 1302 } typval_T; |
1300 | 1303 |
1301 /* Values for "dv_scope". */ | 1304 /* Values for "dv_scope". */ |
1302 #define VAR_SCOPE 1 /* a:, v:, s:, etc. scope dictionaries */ | 1305 #define VAR_SCOPE 1 /* a:, v:, s:, etc. scope dictionaries */ |
1397 int dv_copyID; /* ID used by deepcopy() */ | 1400 int dv_copyID; /* ID used by deepcopy() */ |
1398 hashtab_T dv_hashtab; /* hashtab that refers to the items */ | 1401 hashtab_T dv_hashtab; /* hashtab that refers to the items */ |
1399 dict_T *dv_copydict; /* copied dict used by deepcopy() */ | 1402 dict_T *dv_copydict; /* copied dict used by deepcopy() */ |
1400 dict_T *dv_used_next; /* next dict in used dicts list */ | 1403 dict_T *dv_used_next; /* next dict in used dicts list */ |
1401 dict_T *dv_used_prev; /* previous dict in used dicts list */ | 1404 dict_T *dv_used_prev; /* previous dict in used dicts list */ |
1405 }; | |
1406 | |
1407 /* | |
1408 * Structure to hold info about a blob. | |
1409 */ | |
1410 struct blobvar_S | |
1411 { | |
1412 garray_T bv_ga; // growarray with the data | |
1413 int bv_refcount; // reference count | |
1414 char bv_lock; // zero, VAR_LOCKED, VAR_FIXED | |
1402 }; | 1415 }; |
1403 | 1416 |
1404 #if defined(FEAT_EVAL) || defined(PROTO) | 1417 #if defined(FEAT_EVAL) || defined(PROTO) |
1405 typedef struct funccall_S funccall_T; | 1418 typedef struct funccall_S funccall_T; |
1406 | 1419 |
3524 long ll_n2; /* Second index for list range */ | 3537 long ll_n2; /* Second index for list range */ |
3525 int ll_empty2; /* Second index is empty: [i:] */ | 3538 int ll_empty2; /* Second index is empty: [i:] */ |
3526 dict_T *ll_dict; /* The Dictionary or NULL */ | 3539 dict_T *ll_dict; /* The Dictionary or NULL */ |
3527 dictitem_T *ll_di; /* The dictitem or NULL */ | 3540 dictitem_T *ll_di; /* The dictitem or NULL */ |
3528 char_u *ll_newkey; /* New key for Dict in alloc. mem or NULL. */ | 3541 char_u *ll_newkey; /* New key for Dict in alloc. mem or NULL. */ |
3542 blob_T *ll_blob; /* The Blob or NULL */ | |
3529 } lval_T; | 3543 } lval_T; |
3530 | 3544 |
3531 /* Structure used to save the current state. Used when executing Normal mode | 3545 /* Structure used to save the current state. Used when executing Normal mode |
3532 * commands while in any other mode. */ | 3546 * commands while in any other mode. */ |
3533 typedef struct { | 3547 typedef struct { |