typval.h
Go to the documentation of this file.
1 #ifndef NVIM_EVAL_TYPVAL_H
2 #define NVIM_EVAL_TYPVAL_H
3 
4 #include <inttypes.h>
5 #include <stddef.h>
6 #include <stdint.h>
7 #include <string.h>
8 #include <stdbool.h>
9 #include <assert.h>
10 #include <limits.h>
11 
12 #include "nvim/types.h"
13 #include "nvim/hashtab.h"
14 #include "nvim/garray.h"
15 #include "nvim/mbyte.h"
16 #include "nvim/func_attr.h"
17 #include "nvim/lib/queue.h"
18 #include "nvim/profile.h" // for proftime_T
19 #include "nvim/pos.h" // for linenr_T
20 #include "nvim/gettext.h"
21 #include "nvim/message.h"
22 #include "nvim/macros.h"
23 #ifdef LOG_LIST_ACTIONS
24 # include "nvim/memory.h"
25 #endif
26 
28 typedef int64_t varnumber_T;
29 typedef uint64_t uvarnumber_T;
30 
32 typedef double float_T;
33 
35 enum { DO_NOT_FREE_CNT = (INT_MAX / 2) };
36 
38 enum {
55 
57 #define VARNUMBER_MAX INT64_MAX
58 #define UVARNUMBER_MAX UINT64_MAX
59 
61 #define VARNUMBER_MIN INT64_MIN
62 
64 #define PRIdVARNUMBER PRId64
65 
66 typedef struct listvar_S list_T;
67 typedef struct dictvar_S dict_T;
68 typedef struct partial_S partial_T;
69 
70 typedef struct ufunc ufunc_T;
71 
72 typedef enum {
76 } CallbackType;
77 
78 typedef struct {
79  union {
82  } data;
84 } Callback;
85 #define CALLBACK_NONE ((Callback){ .type = kCallbackNone })
86 
88 typedef struct dict_watcher {
90  char *key_pattern;
93  bool busy; // prevent recursion if the dict is changed in the callback
94 } DictWatcher;
95 
97 typedef enum {
102 
104 typedef enum {
107  VAR_FIXED = 2,
108 } VarLockStatus;
109 
111 typedef enum {
120  VAR_PARTIAL,
122 } VarType;
123 
125 typedef struct {
136  } vval;
137 } typval_T;
138 
140 typedef enum {
142  VAR_SCOPE = 1,
144 } ScopeType;
146 
148 typedef struct listitem_S listitem_T;
149 
150 struct listitem_S {
154 };
155 
157 typedef struct listwatch_S listwatch_T;
158 
159 struct listwatch_S {
162 };
163 
166 struct listvar_S {
175  int lv_len;
176  int lv_idx;
177  int lv_copyID;
179 };
180 
181 // Static list with 10 items. Use tv_list_init_static10() to initialize.
182 typedef struct {
183  list_T sl_list; // must be first
184  listitem_T sl_items[10];
186 
187 #define TV_LIST_STATIC10_INIT { \
188  .sl_list = { \
189  .lv_first = NULL, \
190  .lv_last = NULL, \
191  .lv_refcount = 0, \
192  .lv_len = 0, \
193  .lv_watch = NULL, \
194  .lv_idx_item = NULL, \
195  .lv_lock = VAR_FIXED, \
196  .lv_used_next = NULL, \
197  .lv_used_prev = NULL, \
198  }, \
199  }
200 
201 #define TV_DICTITEM_STRUCT(...) \
202  struct { \
203  typval_T di_tv; /* Structure that holds scope dictionary itself. */ \
204  uint8_t di_flags; /* Flags. */ \
205  char_u di_key[__VA_ARGS__]; /* Key value. */ \
206  }
207 
214 typedef TV_DICTITEM_STRUCT(1) ScopeDictDictItem;
215 
222 
224 typedef enum {
230 } DictItemFlags;
231 
233 struct dictvar_S {
236  int dv_refcount;
238  int dv_copyID;
244 };
245 
247 typedef int scid_T;
249 #define PRIdSCID "d"
250 
251 // Structure to hold info for a function that is currently being executed.
252 typedef struct funccall_S funccall_T;
253 
255 struct ufunc {
257  int uf_flags;
258  int uf_calls;
259  bool uf_cleared;
263  // Profiling the function as a whole.
268  // Profiling the function per line.
278  int uf_refcount;
282 };
284 
286 #define MAX_FUNC_ARGS 20
287 
288 struct partial_S {
292  bool pt_auto;
294  int pt_argc;
298 };
299 
301 typedef struct ht_stack_S {
303  struct ht_stack_S *prev;
304 } ht_stack_T;
305 
307 typedef struct list_stack_S {
310 } list_stack_T;
311 
313 typedef struct {
315  int idx;
316 } ListSortItem;
317 
318 typedef int (*ListSorter)(const void *, const void *);
319 
320 #ifdef LOG_LIST_ACTIONS
321 
323 typedef struct {
324  uintptr_t l;
325  uintptr_t li1;
326  uintptr_t li2;
327  int len;
328  const char *action;
329 } ListLogEntry;
330 
331 typedef struct list_log ListLog;
332 
334 struct list_log {
335  ListLog *next;
336  size_t capacity;
337  size_t size;
338  ListLogEntry entries[];
339 };
340 
341 extern ListLog *list_log_first;
342 extern ListLog *list_log_last;
343 
344 static inline ListLog *list_log_alloc(const size_t size)
346 
352 static inline ListLog *list_log_new(const size_t size)
353 {
354  ListLog *ret = xmalloc(offsetof(ListLog, entries)
355  + size * sizeof(ret->entries[0]));
356  ret->size = 0;
357  ret->capacity = size;
358  ret->next = NULL;
359  if (list_log_first == NULL) {
360  list_log_first = ret;
361  } else {
362  list_log_last->next = ret;
363  }
364  list_log_last = ret;
365  return ret;
366 }
367 
368 static inline void list_log(const list_T *const l,
369  const listitem_T *const li1,
370  const listitem_T *const li2,
371  const char *const action)
373 
383 static inline void list_log(const list_T *const l,
384  const listitem_T *const li1,
385  const listitem_T *const li2,
386  const char *const action)
387 {
388  ListLog *tgt;
389  if (list_log_first == NULL) {
390  tgt = list_log_new(128);
391  } else if (list_log_last->size == list_log_last->capacity) {
392  tgt = list_log_new(list_log_last->capacity * 2);
393  } else {
394  tgt = list_log_last;
395  }
396  tgt->entries[tgt->size++] = (ListLogEntry) {
397  .l = (uintptr_t)l,
398  .li1 = (uintptr_t)li1,
399  .li2 = (uintptr_t)li2,
400  .len = (l == NULL ? 0 : l->lv_len),
401  .action = action,
402  };
403 }
404 #else
405 # define list_log(...)
406 # define list_write_log(...)
407 # define list_free_log()
408 #endif
409 
410 // In a hashtab item "hi_key" points to "di_key" in a dictitem.
411 // This avoids adding a pointer to the hashtab item.
412 
414 #define TV_DICT_HI2DI(hi) \
415  ((dictitem_T *)((hi)->hi_key - offsetof(dictitem_T, di_key)))
416 
417 static inline void tv_list_ref(list_T *const l)
419 
425 static inline void tv_list_ref(list_T *const l)
426 {
427  if (l == NULL) {
428  return;
429  }
430  l->lv_refcount++;
431 }
432 
433 static inline void tv_list_set_ret(typval_T *const tv, list_T *const l)
435 
440 static inline void tv_list_set_ret(typval_T *const tv, list_T *const l)
441 {
442  tv->v_type = VAR_LIST;
443  tv->vval.v_list = l;
444  tv_list_ref(l);
445 }
446 
447 static inline VarLockStatus tv_list_locked(const list_T *const l)
449 
455 static inline VarLockStatus tv_list_locked(const list_T *const l)
456 {
457  if (l == NULL) {
458  return VAR_FIXED;
459  }
460  return l->lv_lock;
461 }
462 
469 static inline void tv_list_set_lock(list_T *const l,
470  const VarLockStatus lock)
471 {
472  if (l == NULL) {
473  assert(lock == VAR_FIXED);
474  return;
475  }
476  l->lv_lock = lock;
477 }
478 
485 static inline void tv_list_set_copyid(list_T *const l,
486  const int copyid)
488 {
489  l->lv_copyID = copyid;
490 }
491 
492 static inline int tv_list_len(const list_T *const l)
494 
498 static inline int tv_list_len(const list_T *const l)
499 {
500  list_log(l, NULL, NULL, "len");
501  if (l == NULL) {
502  return 0;
503  }
504  return l->lv_len;
505 }
506 
507 static inline int tv_list_copyid(const list_T *const l)
509 
515 static inline int tv_list_copyid(const list_T *const l)
516 {
517  return l->lv_copyID;
518 }
519 
520 static inline list_T *tv_list_latest_copy(const list_T *const l)
522 
530 static inline list_T *tv_list_latest_copy(const list_T *const l)
531 {
532  return l->lv_copylist;
533 }
534 
535 static inline int tv_list_uidx(const list_T *const l, int n)
537 
544 static inline int tv_list_uidx(const list_T *const l, int n)
545 {
546  // Negative index is relative to the end.
547  if (n < 0) {
548  n += tv_list_len(l);
549  }
550 
551  // Check for index out of range.
552  if (n < 0 || n >= tv_list_len(l)) {
553  return -1;
554  }
555  return n;
556 }
557 
558 static inline bool tv_list_has_watchers(const list_T *const l)
560 
568 static inline bool tv_list_has_watchers(const list_T *const l)
569 {
570  return l && l->lv_watch;
571 }
572 
573 static inline listitem_T *tv_list_first(const list_T *const l)
575 
581 static inline listitem_T *tv_list_first(const list_T *const l)
582 {
583  if (l == NULL) {
584  list_log(l, NULL, NULL, "first");
585  return NULL;
586  }
587  list_log(l, l->lv_first, NULL, "first");
588  return l->lv_first;
589 }
590 
591 static inline listitem_T *tv_list_last(const list_T *const l)
593 
599 static inline listitem_T *tv_list_last(const list_T *const l)
600 {
601  if (l == NULL) {
602  list_log(l, NULL, NULL, "last");
603  return NULL;
604  }
605  list_log(l, l->lv_last, NULL, "last");
606  return l->lv_last;
607 }
608 
609 static inline void tv_dict_set_ret(typval_T *const tv, dict_T *const d)
611 
616 static inline void tv_dict_set_ret(typval_T *const tv, dict_T *const d)
617 {
618  tv->v_type = VAR_DICT;
619  tv->vval.v_dict = d;
620  if (d != NULL) {
621  d->dv_refcount++;
622  }
623 }
624 
625 static inline long tv_dict_len(const dict_T *const d)
627 
631 static inline long tv_dict_len(const dict_T *const d)
632 {
633  if (d == NULL) {
634  return 0L;
635  }
636  return (long)d->dv_hashtab.ht_used;
637 }
638 
639 static inline bool tv_dict_is_watched(const dict_T *const d)
641 
647 static inline bool tv_dict_is_watched(const dict_T *const d)
648 {
649  return d && !QUEUE_EMPTY(&d->watchers);
650 }
651 
657 static inline void tv_init(typval_T *const tv)
658 {
659  if (tv != NULL) {
660  memset(tv, 0, sizeof(*tv));
661  }
662 }
663 
664 #define TV_INITIAL_VALUE \
665  ((typval_T) { \
666  .v_type = VAR_UNKNOWN, \
667  .v_lock = VAR_UNLOCKED, \
668  })
669 
674 extern const char *const tv_empty_string;
675 
677 extern bool tv_in_free_unref_items;
678 
686 #define _TV_LIST_ITER_MOD(modifier, l, li, code) \
687  do { \
688  modifier list_T *const l_ = (l); \
689  list_log(l_, NULL, NULL, "iter" #modifier); \
690  if (l_ != NULL) { \
691  for (modifier listitem_T *li = l_->lv_first; \
692  li != NULL; li = li->li_next) { \
693  code \
694  } \
695  } \
696  } while (0)
697 
706 #define TV_LIST_ITER(l, li, code) \
707  _TV_LIST_ITER_MOD(, l, li, code)
708 
717 #define TV_LIST_ITER_CONST(l, li, code) \
718  _TV_LIST_ITER_MOD(const, l, li, code)
719 
720 // Below macros are macros to avoid duplicating code for functionally identical
721 // const and non-const function variants.
722 
728 #define TV_LIST_ITEM_TV(li) (&(li)->li_tv)
729 
736 #define TV_LIST_ITEM_NEXT(l, li) ((li)->li_next)
737 
744 #define TV_LIST_ITEM_PREV(l, li) ((li)->li_prev)
745 // List argument is not used currently, but it is a must for lists implemented
746 // as a pair (size(in list), array) without terminator - basically for lists on
747 // top of kvec.
748 
754 #define TV_DICT_ITER(d, di, code) \
755  HASHTAB_ITER(&(d)->dv_hashtab, di##hi_, { \
756  { \
757  dictitem_T *const di = TV_DICT_HI2DI(di##hi_); \
758  { \
759  code \
760  } \
761  } \
762  })
763 
764 static inline bool tv_get_float_chk(const typval_T *const tv,
765  float_T *const ret_f)
767 
768 // FIXME circular dependency, cannot import message.h.
769 bool emsgf(const char *const fmt, ...);
770 
779 static inline bool tv_get_float_chk(const typval_T *const tv,
780  float_T *const ret_f)
781 {
782  if (tv->v_type == VAR_FLOAT) {
783  *ret_f = tv->vval.v_float;
784  return true;
785  }
786  if (tv->v_type == VAR_NUMBER) {
787  *ret_f = (float_T)tv->vval.v_number;
788  return true;
789  }
790  emsgf(_("E808: Number or Float required"));
791  return false;
792 }
793 
794 static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
797 
802 static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
803 {
804  return QUEUE_DATA(q, DictWatcher, node);
805 }
806 
807 static inline bool tv_is_func(const typval_T tv)
809 
817 static inline bool tv_is_func(const typval_T tv)
818 {
819  return tv.v_type == VAR_FUNC || tv.v_type == VAR_PARTIAL;
820 }
821 
826 #define TV_TRANSLATE (SIZE_MAX)
827 
831 #define TV_CSTRING (SIZE_MAX - 1)
832 
833 #ifdef UNIT_TESTING
834 // Do not use enum constants, see commit message.
835 EXTERN const size_t kTVCstring INIT(= TV_CSTRING);
836 EXTERN const size_t kTVTranslate INIT(= TV_TRANSLATE);
837 #endif
838 
839 #ifdef INCLUDE_GENERATED_DECLARATIONS
840 # include "eval/typval.h.generated.h"
841 #endif
842 #endif // NVIM_EVAL_TYPVAL_H
typval_T tv
Definition: typval.c:1539
#define REAL_FATTR_NONNULL_RET
Definition: func_attr.h:191
listitem_T * item
Sorted list item.
Definition: typval.h:314
dict_T * v_dict
Dictionary for VAR_DICT, can be NULL.
Definition: typval.h:134
#define FUNC_ATTR_WARN_UNUSED_RESULT
Definition: func_attr.h:235
typval_T li_tv
Item value.
Definition: typval.h:153
Unknown (unspecified) value.
Definition: typval.h:112
dict_T * dv_used_prev
Previous dictionary in used dictionaries list.
Definition: typval.h:242
#define _(x)
Definition: gettext.h:15
int dv_copyID
ID used when recursivery traversing a value.
Definition: typval.h:238
Callback callback
Definition: typval.h:89
int lv_len
Number of items.
Definition: typval.h:175
listitem_T * li_next
Next item in list.
Definition: typval.h:151
int scid_T
Type used for script ID.
Definition: typval.h:247
proftime_T uf_tml_children
time spent in children for this line
Definition: typval.h:273
Definition: typval.h:74
int lv_copyID
ID used by deepcopy().
Definition: typval.h:177
#define FUNC_ATTR_CONST
Definition: func_attr.h:234
CallbackType
Definition: typval.h:72
Partial, .v_partial is used.
Definition: typval.h:121
proftime_T uf_tm_self
time spent in function itself
Definition: typval.h:266
#define TV_TRANSLATE
Definition: typval.h:826
Definition: typval.h:49
Definition: typval.h:166
struct ht_stack_S ht_stack_T
Structure used for explicit stack while garbage collecting hash tables.
partial_T * partial
Definition: typval.h:81
funccall_T * uf_scoped
l: local variables for closure
Definition: typval.h:280
Definition: coverity-model.c:65
#define QUEUE_DATA(ptr, type, field)
Definition: queue.h:33
#define TV_CSTRING
Definition: typval.h:831
Structure that holds an internal variable value.
Definition: typval.h:125
scid_T uf_script_ID
Definition: typval.h:277
Definition: typval.h:150
hashtab_T * ht
Definition: typval.h:302
int int ret
Definition: eval.c:19473
struct ht_stack_S * prev
Definition: typval.h:303
int * uf_tml_count
nr of times line was executed
Definition: typval.h:269
proftime_T uf_tml_wait
start wait time for current line
Definition: typval.h:274
User lock, can be unlocked.
Definition: typval.h:106
Definition: typval.h:159
v:true
Definition: typval.h:99
list_T * list
Definition: typval.h:308
listitem_T * lw_item
Item being watched.
Definition: typval.h:160
Not locked.
Definition: typval.h:105
dict_T * d
Definition: eval.c:14699
return NULL
Definition: eval.c:22200
int len
Definition: helpers.c:1160
String, .v_string is used.
Definition: typval.h:114
Locked value.
Definition: typval.h:228
enum @4 ListLenSpecials
Additional values for tv_list_alloc() len argument.
DictItemFlags
Flags for dictitem_T.di_flags.
Definition: typval.h:224
Read-only value.
Definition: typval.h:225
Number, .v_number is used.
Definition: typval.h:113
Definition: queue.h:27
bool tv_in_free_unref_items
Specifies that free_unref_items() function has (not) been entered.
Definition: typval.c:40
v:null
Definition: typval.h:100
void * xmalloc(size_t size) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1) FUNC_ATTR_NONNULL_RET
Definition: memory.c:120
static int REAL_FATTR_WARN_UNUSED_RESULT
Definition: typval_encode.c.h:295
garray_T uf_lines
function lines
Definition: typval.h:261
int uf_tml_execed
line being timed was executed
Definition: typval.h:276
Structure representing one list item, used for sort array.
Definition: typval.h:313
proftime_T * uf_tml_self
time spent in a line itself
Definition: typval.h:271
garray_T uf_args
arguments
Definition: typval.h:260
int uf_varargs
variable nr of arguments
Definition: typval.h:256
int uf_tml_idx
index of line being timed; -1 if none
Definition: typval.h:275
Structure used for explicit stack while garbage collecting hash tables.
Definition: typval.h:301
#define REAL_FATTR_NONNULL_ALL
Definition: func_attr.h:183
Structure used by trans_function_name()
Definition: eval.c:263
SpecialVarValue
Special variable values.
Definition: typval.h:97
bool uf_cleared
func_clear() was already called
Definition: typval.h:259
VarType v_type
Variable type.
Definition: typval.h:126
partial_T * v_partial
Closure: function with args.
Definition: typval.h:135
Definition: typval.h:288
v:false
Definition: typval.h:98
uint64_t uvarnumber_T
Definition: typval.h:29
size_t key_pattern_len
Definition: typval.h:91
#define EXTERN
Definition: macros.h:7
Definition: typval.h:75
SpecialVarValue v_special
Special value, for VAR_SPECIAL.
Definition: typval.h:130
listwatch_T * lw_next
Next watcher.
Definition: typval.h:161
assert(len >=0)
struct dict_watcher DictWatcher
Structure holding dictionary watcher.
list_T * lv_used_next
next list in used lists list.
Definition: typval.h:172
list_T sl_list
Definition: typval.h:183
Definition: coverity-model.c:66
Definition: typval.h:182
bool emsgf(const char *const fmt,...)
Print an error message with unknown number of arguments.
int uf_profiling
true when func is being profiled
Definition: typval.h:262
list_T * v_list
List for VAR_LIST, can be NULL.
Definition: typval.h:133
QUEUE node
Definition: typval.h:92
Definition: garray.h:12
Not a scope dictionary.
Definition: typval.h:141
Definition: typval.h:43
list_T * lv_copylist
Copied list used by deepcopy().
Definition: typval.h:171
typval_T * pt_argv
Arguments in allocated array.
Definition: typval.h:296
char_u uf_name[]
Definition: typval.h:281
dict_T * dv_used_next
Next dictionary in used dictionaries list.
Definition: typval.h:241
Structure to hold info for a user function.
Definition: typval.h:255
struct list_stack_S * prev
Definition: typval.h:309
Floating-point value, .v_float is used.
Definition: typval.h:118
VarLockStatus v_lock
Variable lock status.
Definition: typval.h:127
char_u * funcref
Definition: typval.h:80
#define REAL_FATTR_NONNULL_ARG(...)
Definition: func_attr.h:187
Definition: typval.h:119
listwatch_T * lv_watch
First watcher, NULL if none.
Definition: typval.h:169
Scope dictionary which requires prefix (a:, v:, …).
Definition: typval.h:142
Definition: typval.h:35
char_u * v_string
String, for VAR_STRING and VAR_FUNC, can be NULL.
Definition: typval.h:132
VarType
VimL variable types, for use in typval_T.v_type.
Definition: typval.h:111
VarLockStatus
Variable lock status for typval_T.v_lock.
Definition: typval.h:104
union typval_T::typval_vval_union vval
Actual value.
int action
Definition: eval.c:14696
Definition: typval.h:143
static char size_t n
Definition: memline.c:3251
varnumber_T v_number
Number, for VAR_NUMBER.
Definition: typval.h:129
int pt_refcount
Reference count.
Definition: typval.h:289
proftime_T * uf_tml_total
time spent in a line + children
Definition: typval.h:270
Definition: typval.h:78
VarLockStatus lv_lock
Zero, VAR_LOCKED, VAR_FIXED.
Definition: typval.h:178
List, .v_list is used.
Definition: typval.h:116
QUEUE watchers
Dictionary key watchers set by user code.
Definition: typval.h:243
#define TV_DICTITEM_STRUCT(...)
Definition: typval.h:201
Value, read-only in the sandbox.
Definition: typval.h:226
memset(lp, 0, sizeof(lval_T))
Separately allocated.
Definition: typval.h:229
int lv_refcount
Reference count.
Definition: typval.h:174
Structure representing a Dictionary.
Definition: typval.h:233
Definition: hashtab.h:62
double float_T
Type used for VimL VAR_FLOAT values.
Definition: typval.h:32
static int REAL_FATTR_WARN_UNUSED_RESULT REAL_FATTR_ALWAYS_INLINE
Definition: typval_encode.c.h:258
proftime_T uf_tm_total
time spent in function + children
Definition: typval.h:265
argv[2] vval v_dict dv_refcount
Definition: typval.c:1187
int64_t varnumber_T
Type used for VimL VAR_NUMBER values.
Definition: typval.h:28
Definition: typval.h:128
Structure used for explicit stack while garbage collecting lists.
Definition: typval.h:307
bool busy
Definition: typval.h:93
proftime_T uf_tml_start
start time for current line
Definition: typval.h:272
list_T * lv_used_prev
Previous list in used lists list.
Definition: typval.h:173
struct list_stack_S list_stack_T
Structure used for explicit stack while garbage collecting lists.
unsigned char char_u
Definition: types.h:11
int lv_idx
Index of a cached item, used for optimising repeated l[idx].
Definition: typval.h:176
Function reference, .v_string is used as function name.
Definition: typval.h:115
int uf_tm_count
nr of calls
Definition: typval.h:264
char * key_pattern
Definition: typval.h:90
Definition: typval.h:53
#define FUNC_ATTR_ALWAYS_INLINE
Definition: func_attr.h:236
char_u * pt_name
Function name; when NULL use pt_func->name.
Definition: typval.h:290
listitem_T * lv_first
First item, NULL if none.
Definition: typval.h:167
listitem_T * li_prev
Previous item in list.
Definition: typval.h:152
#define REAL_FATTR_PURE
Definition: func_attr.h:163
CallbackType type
Definition: typval.h:83
Locked forever.
Definition: typval.h:107
Structure holding dictionary watcher.
Definition: typval.h:88
Fixed value: cannot be :unlet or remove()d.
Definition: typval.h:227
list_T *const l
Definition: eval.c:14750
ScopeType dv_scope
Definition: typval.h:235
#define FUNC_ATTR_NONNULL_ALL
Definition: func_attr.h:238
const char *const tv_empty_string
Definition: typval.c:46
int idx
Sorted list item index.
Definition: typval.h:315
VarLockStatus dv_lock
Whole dictionary lock status.
Definition: typval.h:234
proftime_T uf_tm_children
time spent in children this call
Definition: typval.h:267
int(* ListSorter)(const void *, const void *)
Definition: typval.h:318
Dictionary, .v_dict is used.
Definition: typval.h:117
int uf_flags
Definition: typval.h:257
float_T v_float
Floating-point number, for VAR_FLOAT.
Definition: typval.h:131
ScopeType
Values for (struct dictvar_S).dv_scope.
Definition: typval.h:140
listitem_T * lv_idx_item
When not NULL item at index "lv_idx".
Definition: typval.h:170
int uf_refcount
reference count, see func_name_refcount()
Definition: typval.h:279
uint64_t proftime_T
Definition: profile.h:7
dict_T * dv_copydict
Copied dict used by deepcopy().
Definition: typval.h:240
listitem_T * lv_last
Last item, NULL if none.
Definition: typval.h:168
int uf_calls
nr of active calls
Definition: typval.h:258
#define INIT(...)
Definition: macros.h:8
dict_T * pt_dict
Dict for "self".
Definition: typval.h:297
hashtab_T dv_hashtab
Hashtab containing all items.
Definition: typval.h:239
ufunc_T * pt_func
Definition: typval.h:291
Definition: typval.h:73
#define list_log(...)
Definition: typval.h:405