Go to the documentation of this file. 1 #ifndef NVIM_EVAL_TYPVAL_ENCODE_H
6 #define NVIM_EVAL_TYPVAL_ENCODE_H
67 #define _mp_size kv_size
68 #define _mp_init kvi_init
69 #define _mp_destroy kvi_destroy
70 #define _mp_push kvi_push
71 #define _mp_pop kv_pop
72 #define _mp_last kv_last
74 static inline size_t tv_strlen(
const typval_T *
const tv)
85 static inline size_t tv_strlen(
const typval_T *
const tv)
99 #define _TYPVAL_ENCODE_DO_CHECK_SELF_REFERENCE(val, copyID_attr, copyID, \
102 const int te_csr_ret = _TYPVAL_ENCODE_CHECK_SELF_REFERENCE(TYPVAL_ENCODE_FIRST_ARG_NAME, \
103 (val), &(val)->copyID_attr, mpstack, \
104 copyID, conv_type, objname); \
105 if (te_csr_ret != NOTDONE) { \
110 #define _TYPVAL_ENCODE_FUNC_NAME_INNER_2(pref, name, suf) \
112 #define _TYPVAL_ENCODE_FUNC_NAME_INNER(pref, name, suf) \
113 _TYPVAL_ENCODE_FUNC_NAME_INNER_2(pref, name, suf)
125 #define _TYPVAL_ENCODE_FUNC_NAME(pref, suf) \
126 _TYPVAL_ENCODE_FUNC_NAME_INNER(pref, TYPVAL_ENCODE_NAME, suf)
129 #define _TYPVAL_ENCODE_CHECK_SELF_REFERENCE \
130 _TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _check_self_reference)
133 #define _TYPVAL_ENCODE_ENCODE \
134 _TYPVAL_ENCODE_FUNC_NAME(encode_vim_to_, )
137 #define _TYPVAL_ENCODE_CONVERT_ONE_VALUE \
138 _TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _convert_one_value)
141 #define TYPVAL_ENCODE_NODICT_VAR \
142 _TYPVAL_ENCODE_FUNC_NAME(_typval_encode_, _nodict_var)
144 #endif // NVIM_EVAL_TYPVAL_ENCODE_H
typval_T tv
Definition: typval.c:1705
int saved_copyID
copyID item used to have.
Definition: typval_encode.h:37
Structure that holds an internal variable value.
Definition: typval.h:135
MPConvPartialStage stage
Stage at which partial is being converted.
Definition: typval_encode.h:52
@ VAR_STRING
String, .v_string is used.
Definition: typval.h:122
char * p
Definition: eval.c:2017
@ kMPConvPartialArgs
About to convert arguments.
Definition: typval_encode.h:28
@ kMPConvPartialSelf
About to convert self dictionary.
Definition: typval_encode.h:29
MPConvStackValType
Type of the stack entry.
Definition: typval_encode.h:18
typval_T * argv
Start of the argument list.
Definition: typval_encode.h:57
MPConvPartialStage
Stage at which partial is being converted.
Definition: typval_encode.h:27
Structure representing current VimL to messagepack conversion state.
Definition: typval_encode.h:34
@ kMPConvPairs
Convert mapping represented as a list_T* of pairs.
Definition: typval_encode.h:21
char * v_string
String, for VAR_STRING and VAR_FUNC, can be NULL.
Definition: typval.h:143
VarType v_type
Variable type.
Definition: typval.h:136
@ kMPConvPartialEnd
Already converted everything.
Definition: typval_encode.h:30
MPConvStackValType type
Type of the stack entry.
Definition: typval_encode.h:35
typval_T * tv
Currently converted typval_T.
Definition: typval_encode.h:36
#define REAL_FATTR_NONNULL_ALL
Definition: func_attr.h:183
listitem_T * li
Currently converted list item.
Definition: typval_encode.h:49
list_T * list
Currently converted list.
Definition: typval_encode.h:48
typval_T * arg
Currently converted argument.
Definition: typval_encode.h:56
@ kMPConvPartial
Convert partial_T* partial.
Definition: typval_encode.h:22
@ kMPConvPartialList
Convert argc/argv pair coming from a partial.
Definition: typval_encode.h:23
dict_T * dict
Currently converted dictionary.
Definition: typval_encode.h:40
union typval_T::typval_vval_union vval
Actual value.
@ kMPConvList
Convert list_T *list.
Definition: typval_encode.h:20
typedef kvec_withinit_t(MPConvStackVal, 8) MPConvStack
Stack used to convert VimL values to messagepack.
size_t todo
Amount of items left to process.
Definition: typval_encode.h:45
list_T *const l
Definition: funcs.c:8835
#define REAL_FATTR_PURE
Definition: func_attr.h:163
@ kMPConvDict
Convert dict_T *dictionary.
Definition: typval_encode.h:19
Definition: coverity-model.c:40
partial_T * pt
Currently converted partial.
Definition: typval_encode.h:53
static int REAL_FATTR_WARN_UNUSED_RESULT REAL_FATTR_ALWAYS_INLINE
Definition: typval_encode.c.h:267
return NULL
Definition: eval.c:9971
static int REAL_FATTR_WARN_UNUSED_RESULT
Definition: typval_encode.c.h:302
dict_T ** dictp
Definition: typval_encode.h:41