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 <string.h>
7 #include <stdbool.h>
8 #include <assert.h>
9 
10 #include "nvim/types.h"
11 #include "nvim/hashtab.h"
12 #include "nvim/garray.h"
13 #include "nvim/mbyte.h"
14 #include "nvim/func_attr.h"
15 #include "nvim/lib/queue.h"
16 #include "nvim/profile.h" // for proftime_T
17 #include "nvim/pos.h" // for linenr_T
18 #include "nvim/gettext.h"
19 #include "nvim/message.h"
20 #include "nvim/macros.h"
21 #ifdef LOG_LIST_ACTIONS
22 # include "nvim/memory.h"
23 #endif
24 
26 typedef int64_t varnumber_T;
27 typedef uint64_t uvarnumber_T;
28 
30 typedef double float_T;
31 
33 enum { DO_NOT_FREE_CNT = (INT_MAX / 2) };
34 
36 enum {
53 
55 #define VARNUMBER_MAX INT64_MAX
56 #define UVARNUMBER_MAX UINT64_MAX
57 
59 #define VARNUMBER_MIN INT64_MIN
60 
62 #define PRIdVARNUMBER PRId64
63 
64 typedef struct listvar_S list_T;
65 typedef struct dictvar_S dict_T;
66 typedef struct partial_S partial_T;
67 
68 typedef struct ufunc ufunc_T;
69 
70 typedef enum {
74 } CallbackType;
75 
76 typedef struct {
77  union {
80  } data;
82 } Callback;
83 #define CALLBACK_NONE ((Callback){ .type = kCallbackNone })
84 
86 typedef struct dict_watcher {
88  char *key_pattern;
91  bool busy; // prevent recursion if the dict is changed in the callback
92 } DictWatcher;
93 
95 typedef enum {
100 
102 typedef enum {
105  VAR_FIXED = 2,
106 } VarLockStatus;
107 
109 typedef enum {
118  VAR_PARTIAL,
120 } VarType;
121 
123 typedef struct {
134  } vval;
135 } typval_T;
136 
138 typedef enum {
140  VAR_SCOPE = 1,
142 } ScopeType;
144 
146 typedef struct listitem_S listitem_T;
147 
148 struct listitem_S {
152 };
153 
155 typedef struct listwatch_S listwatch_T;
156 
157 struct listwatch_S {
160 };
161 
164 struct listvar_S {
173  int lv_len;
174  int lv_idx;
175  int lv_copyID;
177 };
178 
179 // Static list with 10 items. Use tv_list_init_static10() to initialize.
180 typedef struct {
181  list_T sl_list; // must be first
182  listitem_T sl_items[10];
184 
185 #define TV_LIST_STATIC10_INIT { \
186  .sl_list = { \
187  .lv_first = NULL, \
188  .lv_last = NULL, \
189  .lv_refcount = 0, \
190  .lv_len = 0, \
191  .lv_watch = NULL, \
192  .lv_idx_item = NULL, \
193  .lv_lock = VAR_FIXED, \
194  .lv_used_next = NULL, \
195  .lv_used_prev = NULL, \
196  }, \
197  }
198 
199 #define TV_DICTITEM_STRUCT(...) \
200  struct { \
201  typval_T di_tv; /* Structure that holds scope dictionary itself. */ \
202  uint8_t di_flags; /* Flags. */ \
203  char_u di_key[__VA_ARGS__]; /* Key value. */ \
204  }
205 
212 typedef TV_DICTITEM_STRUCT(1) ScopeDictDictItem;
213 
220 
222 typedef enum {
228 } DictItemFlags;
229 
231 struct dictvar_S {
234  int dv_refcount;
236  int dv_copyID;
242 };
243 
245 typedef int scid_T;
247 #define PRIdSCID "d"
248 
249 // SCript ConteXt (SCTX): identifies a script script line.
250 // When sourcing a script "sc_lnum" is zero, "sourcing_lnum" is the current
251 // line number. When executing a user function "sc_lnum" is the line where the
252 // function was defined, "sourcing_lnum" is the line number inside the
253 // function. When stored with a function, mapping, option, etc. "sc_lnum" is
254 // the line number in the script "sc_sid".
255 typedef struct {
256  scid_T sc_sid; // script ID
257  int sc_seq; // sourcing sequence number
258  linenr_T sc_lnum; // line number
259 } sctx_T;
260 
261 // Structure to hold info for a function that is currently being executed.
262 typedef struct funccall_S funccall_T;
263 
265 struct ufunc {
267  int uf_flags;
268  int uf_calls;
269  bool uf_cleared;
274  // Profiling the function as a whole.
279  // Profiling the function per line.
289  int uf_refcount;
293 };
295 
297 #define MAX_FUNC_ARGS 20
298 
299 struct partial_S {
303  bool pt_auto;
305  int pt_argc;
309 };
310 
312 typedef struct ht_stack_S {
314  struct ht_stack_S *prev;
315 } ht_stack_T;
316 
318 typedef struct list_stack_S {
321 } list_stack_T;
322 
324 typedef struct {
326  int idx;
327 } ListSortItem;
328 
329 typedef int (*ListSorter)(const void *, const void *);
330 
331 #ifdef LOG_LIST_ACTIONS
332 
334 typedef struct {
335  uintptr_t l;
336  uintptr_t li1;
337  uintptr_t li2;
338  int len;
339  const char *action;
340 } ListLogEntry;
341 
342 typedef struct list_log ListLog;
343 
345 struct list_log {
346  ListLog *next;
347  size_t capacity;
348  size_t size;
349  ListLogEntry entries[];
350 };
351 
352 extern ListLog *list_log_first;
353 extern ListLog *list_log_last;
354 
355 static inline ListLog *list_log_alloc(const size_t size)
357 
363 static inline ListLog *list_log_new(const size_t size)
364 {
365  ListLog *ret = xmalloc(offsetof(ListLog, entries)
366  + size * sizeof(ret->entries[0]));
367  ret->size = 0;
368  ret->capacity = size;
369  ret->next = NULL;
370  if (list_log_first == NULL) {
371  list_log_first = ret;
372  } else {
373  list_log_last->next = ret;
374  }
375  list_log_last = ret;
376  return ret;
377 }
378 
379 static inline void list_log(const list_T *const l,
380  const listitem_T *const li1,
381  const listitem_T *const li2,
382  const char *const action)
384 
394 static inline void list_log(const list_T *const l,
395  const listitem_T *const li1,
396  const listitem_T *const li2,
397  const char *const action)
398 {
399  ListLog *tgt;
400  if (list_log_first == NULL) {
401  tgt = list_log_new(128);
402  } else if (list_log_last->size == list_log_last->capacity) {
403  tgt = list_log_new(list_log_last->capacity * 2);
404  } else {
405  tgt = list_log_last;
406  }
407  tgt->entries[tgt->size++] = (ListLogEntry) {
408  .l = (uintptr_t)l,
409  .li1 = (uintptr_t)li1,
410  .li2 = (uintptr_t)li2,
411  .len = (l == NULL ? 0 : l->lv_len),
412  .action = action,
413  };
414 }
415 #else
416 # define list_log(...)
417 # define list_write_log(...)
418 # define list_free_log()
419 #endif
420 
421 // In a hashtab item "hi_key" points to "di_key" in a dictitem.
422 // This avoids adding a pointer to the hashtab item.
423 
425 #define TV_DICT_HI2DI(hi) \
426  ((dictitem_T *)((hi)->hi_key - offsetof(dictitem_T, di_key)))
427 
428 static inline void tv_list_ref(list_T *const l)
430 
436 static inline void tv_list_ref(list_T *const l)
437 {
438  if (l == NULL) {
439  return;
440  }
441  l->lv_refcount++;
442 }
443 
444 static inline void tv_list_set_ret(typval_T *const tv, list_T *const l)
446 
451 static inline void tv_list_set_ret(typval_T *const tv, list_T *const l)
452 {
453  tv->v_type = VAR_LIST;
454  tv->vval.v_list = l;
455  tv_list_ref(l);
456 }
457 
458 static inline VarLockStatus tv_list_locked(const list_T *const l)
460 
466 static inline VarLockStatus tv_list_locked(const list_T *const l)
467 {
468  if (l == NULL) {
469  return VAR_FIXED;
470  }
471  return l->lv_lock;
472 }
473 
480 static inline void tv_list_set_lock(list_T *const l,
481  const VarLockStatus lock)
482 {
483  if (l == NULL) {
484  assert(lock == VAR_FIXED);
485  return;
486  }
487  l->lv_lock = lock;
488 }
489 
496 static inline void tv_list_set_copyid(list_T *const l,
497  const int copyid)
499 {
500  l->lv_copyID = copyid;
501 }
502 
503 static inline int tv_list_len(const list_T *const l)
505 
509 static inline int tv_list_len(const list_T *const l)
510 {
511  list_log(l, NULL, NULL, "len");
512  if (l == NULL) {
513  return 0;
514  }
515  return l->lv_len;
516 }
517 
518 static inline int tv_list_copyid(const list_T *const l)
520 
526 static inline int tv_list_copyid(const list_T *const l)
527 {
528  return l->lv_copyID;
529 }
530 
531 static inline list_T *tv_list_latest_copy(const list_T *const l)
533 
541 static inline list_T *tv_list_latest_copy(const list_T *const l)
542 {
543  return l->lv_copylist;
544 }
545 
546 static inline int tv_list_uidx(const list_T *const l, int n)
548 
555 static inline int tv_list_uidx(const list_T *const l, int n)
556 {
557  // Negative index is relative to the end.
558  if (n < 0) {
559  n += tv_list_len(l);
560  }
561 
562  // Check for index out of range.
563  if (n < 0 || n >= tv_list_len(l)) {
564  return -1;
565  }
566  return n;
567 }
568 
569 static inline bool tv_list_has_watchers(const list_T *const l)
571 
579 static inline bool tv_list_has_watchers(const list_T *const l)
580 {
581  return l && l->lv_watch;
582 }
583 
584 static inline listitem_T *tv_list_first(const list_T *const l)
586 
592 static inline listitem_T *tv_list_first(const list_T *const l)
593 {
594  if (l == NULL) {
595  list_log(l, NULL, NULL, "first");
596  return NULL;
597  }
598  list_log(l, l->lv_first, NULL, "first");
599  return l->lv_first;
600 }
601 
602 static inline listitem_T *tv_list_last(const list_T *const l)
604 
610 static inline listitem_T *tv_list_last(const list_T *const l)
611 {
612  if (l == NULL) {
613  list_log(l, NULL, NULL, "last");
614  return NULL;
615  }
616  list_log(l, l->lv_last, NULL, "last");
617  return l->lv_last;
618 }
619 
620 static inline void tv_dict_set_ret(typval_T *const tv, dict_T *const d)
622 
627 static inline void tv_dict_set_ret(typval_T *const tv, dict_T *const d)
628 {
629  tv->v_type = VAR_DICT;
630  tv->vval.v_dict = d;
631  if (d != NULL) {
632  d->dv_refcount++;
633  }
634 }
635 
636 static inline long tv_dict_len(const dict_T *const d)
638 
642 static inline long tv_dict_len(const dict_T *const d)
643 {
644  if (d == NULL) {
645  return 0L;
646  }
647  return (long)d->dv_hashtab.ht_used;
648 }
649 
650 static inline bool tv_dict_is_watched(const dict_T *const d)
652 
658 static inline bool tv_dict_is_watched(const dict_T *const d)
659 {
660  return d && !QUEUE_EMPTY(&d->watchers);
661 }
662 
668 static inline void tv_init(typval_T *const tv)
669 {
670  if (tv != NULL) {
671  memset(tv, 0, sizeof(*tv));
672  }
673 }
674 
675 #define TV_INITIAL_VALUE \
676  ((typval_T) { \
677  .v_type = VAR_UNKNOWN, \
678  .v_lock = VAR_UNLOCKED, \
679  })
680 
685 extern const char *const tv_empty_string;
686 
688 extern bool tv_in_free_unref_items;
689 
697 #define _TV_LIST_ITER_MOD(modifier, l, li, code) \
698  do { \
699  modifier list_T *const l_ = (l); \
700  list_log(l_, NULL, NULL, "iter" #modifier); \
701  if (l_ != NULL) { \
702  for (modifier listitem_T *li = l_->lv_first; \
703  li != NULL; li = li->li_next) { \
704  code \
705  } \
706  } \
707  } while (0)
708 
717 #define TV_LIST_ITER(l, li, code) \
718  _TV_LIST_ITER_MOD(, l, li, code)
719 
728 #define TV_LIST_ITER_CONST(l, li, code) \
729  _TV_LIST_ITER_MOD(const, l, li, code)
730 
731 // Below macros are macros to avoid duplicating code for functionally identical
732 // const and non-const function variants.
733 
739 #define TV_LIST_ITEM_TV(li) (&(li)->li_tv)
740 
747 #define TV_LIST_ITEM_NEXT(l, li) ((li)->li_next)
748 
755 #define TV_LIST_ITEM_PREV(l, li) ((li)->li_prev)
756 // List argument is not used currently, but it is a must for lists implemented
757 // as a pair (size(in list), array) without terminator - basically for lists on
758 // top of kvec.
759 
765 #define TV_DICT_ITER(d, di, code) \
766  HASHTAB_ITER(&(d)->dv_hashtab, di##hi_, { \
767  { \
768  dictitem_T *const di = TV_DICT_HI2DI(di##hi_); \
769  { \
770  code \
771  } \
772  } \
773  })
774 
775 static inline bool tv_get_float_chk(const typval_T *const tv,
776  float_T *const ret_f)
778 
779 // FIXME circular dependency, cannot import message.h.
780 bool emsgf(const char *const fmt, ...);
781 
790 static inline bool tv_get_float_chk(const typval_T *const tv,
791  float_T *const ret_f)
792 {
793  if (tv->v_type == VAR_FLOAT) {
794  *ret_f = tv->vval.v_float;
795  return true;
796  }
797  if (tv->v_type == VAR_NUMBER) {
798  *ret_f = (float_T)tv->vval.v_number;
799  return true;
800  }
801  emsgf(_("E808: Number or Float required"));
802  return false;
803 }
804 
805 static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
808 
813 static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
814 {
815  return QUEUE_DATA(q, DictWatcher, node);
816 }
817 
818 static inline bool tv_is_func(const typval_T tv)
820 
828 static inline bool tv_is_func(const typval_T tv)
829 {
830  return tv.v_type == VAR_FUNC || tv.v_type == VAR_PARTIAL;
831 }
832 
837 #define TV_TRANSLATE (SIZE_MAX)
838 
842 #define TV_CSTRING (SIZE_MAX - 1)
843 
844 #ifdef UNIT_TESTING
845 // Do not use enum constants, see commit message.
846 EXTERN const size_t kTVCstring INIT(= TV_CSTRING);
847 EXTERN const size_t kTVTranslate INIT(= TV_TRANSLATE);
848 #endif
849 
850 #ifdef INCLUDE_GENERATED_DECLARATIONS
851 # include "eval/typval.h.generated.h"
852 #endif
853 #endif // NVIM_EVAL_TYPVAL_H
typval_T tv
Definition: typval.c:1544
#define REAL_FATTR_NONNULL_RET
Definition: func_attr.h:191
listitem_T * item
Sorted list item.
Definition: typval.h:325
dict_T * v_dict
Dictionary for VAR_DICT, can be NULL.
Definition: typval.h:132
typval_T li_tv
Item value.
Definition: typval.h:151
Unknown (unspecified) value.
Definition: typval.h:110
dict_T * dv_used_prev
Previous dictionary in used dictionaries list.
Definition: typval.h:240
#define _(x)
Definition: gettext.h:20
int dv_copyID
ID used when recursivery traversing a value.
Definition: typval.h:236
Callback callback
Definition: typval.h:87
int lv_len
Number of items.
Definition: typval.h:173
sctx_T uf_script_ctx
Definition: typval.h:288
listitem_T * li_next
Next item in list.
Definition: typval.h:149
int scid_T
Type used for script ID.
Definition: typval.h:245
proftime_T uf_tml_children
time spent in children for this line
Definition: typval.h:284
Definition: typval.h:72
int lv_copyID
ID used by deepcopy().
Definition: typval.h:175
#define FUNC_ATTR_CONST
Definition: func_attr.h:239
CallbackType
Definition: typval.h:70
Partial, .v_partial is used.
Definition: typval.h:119
proftime_T uf_tm_self
time spent in function itself
Definition: typval.h:277
#define TV_TRANSLATE
Definition: typval.h:837
Definition: typval.h:164
struct ht_stack_S ht_stack_T
Structure used for explicit stack while garbage collecting hash tables.
partial_T * partial
Definition: typval.h:79
funccall_T * uf_scoped
l: local variables for closure
Definition: typval.h:291
Definition: coverity-model.c:39
#define QUEUE_DATA(ptr, type, field)
Definition: queue.h:33
#define TV_CSTRING
Definition: typval.h:842
Structure that holds an internal variable value.
Definition: typval.h:123
Definition: typval.h:148
hashtab_T * ht
Definition: typval.h:313
const int ret
Definition: eval.c:1005
struct ht_stack_S * prev
Definition: typval.h:314
int * uf_tml_count
nr of times line was executed
Definition: typval.h:280
proftime_T uf_tml_wait
start wait time for current line
Definition: typval.h:285
User lock, can be unlocked.
Definition: typval.h:104
Definition: typval.h:157
v:true
Definition: typval.h:97
scid_T sc_sid
Definition: typval.h:256
list_T * list
Definition: typval.h:319
listitem_T * lw_item
Item being watched.
Definition: typval.h:158
Not locked.
Definition: typval.h:103
dict_T * d
Definition: eval.c:15782
return NULL
Definition: eval.c:23938
int len
Definition: helpers.c:1461
String, .v_string is used.
Definition: typval.h:112
Locked value.
Definition: typval.h:226
DictItemFlags
Flags for dictitem_T.di_flags.
Definition: typval.h:222
Read-only value.
Definition: typval.h:223
Number, .v_number is used.
Definition: typval.h:111
Definition: queue.h:27
bool tv_in_free_unref_items
Specifies that free_unref_items() function has (not) been entered.
Definition: typval.c:40
int sc_seq
Definition: typval.h:257
v:null
Definition: typval.h:98
void * xmalloc(size_t size) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1) FUNC_ATTR_NONNULL_RET
Definition: memory.c:102
static int REAL_FATTR_WARN_UNUSED_RESULT
Definition: typval_encode.c.h:295
garray_T uf_lines
function lines
Definition: typval.h:271
int uf_tml_execed
line being timed was executed
Definition: typval.h:287
Structure representing one list item, used for sort array.
Definition: typval.h:324
proftime_T * uf_tml_self
time spent in a line itself
Definition: typval.h:282
garray_T uf_args
arguments
Definition: typval.h:270
int uf_varargs
variable nr of arguments
Definition: typval.h:266
int uf_tml_idx
index of line being timed; -1 if none
Definition: typval.h:286
Structure used for explicit stack while garbage collecting hash tables.
Definition: typval.h:312
#define REAL_FATTR_NONNULL_ALL
Definition: func_attr.h:183
Structure used by trans_function_name()
Definition: eval.c:269
SpecialVarValue
Special variable values.
Definition: typval.h:95
bool uf_cleared
func_clear() was already called
Definition: typval.h:269
VarType v_type
Variable type.
Definition: typval.h:124
partial_T * v_partial
Closure: function with args.
Definition: typval.h:133
Definition: typval.h:299
v:false
Definition: typval.h:96
uint64_t uvarnumber_T
Definition: typval.h:27
size_t key_pattern_len
Definition: typval.h:89
#define EXTERN
Definition: macros.h:7
Definition: typval.h:73
SpecialVarValue v_special
Special value, for VAR_SPECIAL.
Definition: typval.h:128
Definition: typval.h:47
listwatch_T * lw_next
Next watcher.
Definition: typval.h:159
argv[2] vval v_dict dv_refcount
Definition: typval.c:1187
assert(len >=0)
enum @7 ListLenSpecials
Additional values for tv_list_alloc() len argument.
struct dict_watcher DictWatcher
Structure holding dictionary watcher.
list_T * lv_used_next
next list in used lists list.
Definition: typval.h:170
list_T sl_list
Definition: typval.h:181
Definition: typval.h:33
Definition: coverity-model.c:40
Definition: typval.h:180
#define FUNC_ATTR_WARN_UNUSED_RESULT
Definition: func_attr.h:240
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:272
list_T * v_list
List for VAR_LIST, can be NULL.
Definition: typval.h:131
QUEUE node
Definition: typval.h:90
Definition: garray.h:12
Not a scope dictionary.
Definition: typval.h:139
list_T * lv_copylist
Copied list used by deepcopy().
Definition: typval.h:169
int uf_prof_initialized
Definition: typval.h:273
typval_T * pt_argv
Arguments in allocated array.
Definition: typval.h:307
char_u uf_name[]
Definition: typval.h:292
dict_T * dv_used_next
Next dictionary in used dictionaries list.
Definition: typval.h:239
Structure to hold info for a user function.
Definition: typval.h:265
struct list_stack_S * prev
Definition: typval.h:320
Floating-point value, .v_float is used.
Definition: typval.h:116
VarLockStatus v_lock
Variable lock status.
Definition: typval.h:125
char_u * funcref
Definition: typval.h:78
#define REAL_FATTR_NONNULL_ARG(...)
Definition: func_attr.h:187
Definition: typval.h:117
listwatch_T * lv_watch
First watcher, NULL if none.
Definition: typval.h:167
Scope dictionary which requires prefix (a:, v:, …).
Definition: typval.h:140
char_u * v_string
String, for VAR_STRING and VAR_FUNC, can be NULL.
Definition: typval.h:130
VarType
VimL variable types, for use in typval_T.v_type.
Definition: typval.h:109
VarLockStatus
Variable lock status for typval_T.v_lock.
Definition: typval.h:102
union typval_T::typval_vval_union vval
Actual value.
int action
Definition: eval.c:15779
Definition: typval.h:141
static char size_t n
Definition: memline.c:3372
varnumber_T v_number
Number, for VAR_NUMBER.
Definition: typval.h:127
int pt_refcount
Reference count.
Definition: typval.h:300
proftime_T * uf_tml_total
time spent in a line + children
Definition: typval.h:281
Definition: typval.h:76
VarLockStatus lv_lock
Zero, VAR_LOCKED, VAR_FIXED.
Definition: typval.h:176
List, .v_list is used.
Definition: typval.h:114
QUEUE watchers
Dictionary key watchers set by user code.
Definition: typval.h:241
#define TV_DICTITEM_STRUCT(...)
Definition: typval.h:199
Value, read-only in the sandbox.
Definition: typval.h:224
memset(lp, 0, sizeof(lval_T))
Separately allocated.
Definition: typval.h:227
linenr_T sc_lnum
Definition: typval.h:258
long linenr_T
Definition: pos.h:4
int lv_refcount
Reference count.
Definition: typval.h:172
Structure representing a Dictionary.
Definition: typval.h:231
Definition: hashtab.h:62
double float_T
Type used for VimL VAR_FLOAT values.
Definition: typval.h:30
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:276
int64_t varnumber_T
Type used for VimL VAR_NUMBER values.
Definition: typval.h:26
Definition: typval.h:126
Structure used for explicit stack while garbage collecting lists.
Definition: typval.h:318
bool busy
Definition: typval.h:91
proftime_T uf_tml_start
start time for current line
Definition: typval.h:283
list_T * lv_used_prev
Previous list in used lists list.
Definition: typval.h:171
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:174
Function reference, .v_string is used as function name.
Definition: typval.h:113
int uf_tm_count
nr of calls
Definition: typval.h:275
char * key_pattern
Definition: typval.h:88
#define FUNC_ATTR_ALWAYS_INLINE
Definition: func_attr.h:241
char_u * pt_name
Function name; when NULL use pt_func->name.
Definition: typval.h:301
list_T * l
Definition: eval.c:15487
listitem_T * lv_first
First item, NULL if none.
Definition: typval.h:165
listitem_T * li_prev
Previous item in list.
Definition: typval.h:150
#define REAL_FATTR_PURE
Definition: func_attr.h:163
CallbackType type
Definition: typval.h:81
Locked forever.
Definition: typval.h:105
Structure holding dictionary watcher.
Definition: typval.h:86
Fixed value: cannot be :unlet or remove()d.
Definition: typval.h:225
Definition: typval.h:51
ScopeType dv_scope
Definition: typval.h:233
Definition: typval.h:255
#define FUNC_ATTR_NONNULL_ALL
Definition: func_attr.h:243
const char *const tv_empty_string
Definition: typval.c:46
int idx
Sorted list item index.
Definition: typval.h:326
VarLockStatus dv_lock
Whole dictionary lock status.
Definition: typval.h:232
proftime_T uf_tm_children
time spent in children this call
Definition: typval.h:278
int(* ListSorter)(const void *, const void *)
Definition: typval.h:329
Dictionary, .v_dict is used.
Definition: typval.h:115
int uf_flags
Definition: typval.h:267
float_T v_float
Floating-point number, for VAR_FLOAT.
Definition: typval.h:129
Definition: typval.h:41
ScopeType
Values for (struct dictvar_S).dv_scope.
Definition: typval.h:138
listitem_T * lv_idx_item
When not NULL item at index "lv_idx".
Definition: typval.h:168
int uf_refcount
reference count, see func_name_refcount()
Definition: typval.h:290
uint64_t proftime_T
Definition: profile.h:7
dict_T * dv_copydict
Copied dict used by deepcopy().
Definition: typval.h:238
listitem_T * lv_last
Last item, NULL if none.
Definition: typval.h:166
int uf_calls
nr of active calls
Definition: typval.h:268
#define INIT(...)
Definition: macros.h:8
dict_T * pt_dict
Dict for "self".
Definition: typval.h:308
hashtab_T dv_hashtab
Hashtab containing all items.
Definition: typval.h:237
ufunc_T * pt_func
Definition: typval.h:302
Definition: typval.h:71
#define list_log(...)
Definition: typval.h:416