Lines Matching refs:d
30 dict_T *d; in dict_alloc() local
32 d = ALLOC_CLEAR_ONE(dict_T); in dict_alloc()
33 if (d != NULL) in dict_alloc()
37 first_dict->dv_used_prev = d; in dict_alloc()
38 d->dv_used_next = first_dict; in dict_alloc()
39 d->dv_used_prev = NULL; in dict_alloc()
40 first_dict = d; in dict_alloc()
42 hash_init(&d->dv_hashtab); in dict_alloc()
43 d->dv_lock = 0; in dict_alloc()
44 d->dv_scope = 0; in dict_alloc()
45 d->dv_refcount = 0; in dict_alloc()
46 d->dv_copyID = 0; in dict_alloc()
48 return d; in dict_alloc()
67 dict_T *d = dict_alloc(); in dict_alloc_lock() local
69 if (d != NULL) in dict_alloc_lock()
70 d->dv_lock = lock; in dict_alloc_lock()
71 return d; in dict_alloc_lock()
81 dict_T *d = dict_alloc_lock(0); in rettv_dict_alloc() local
83 if (d == NULL) in rettv_dict_alloc()
86 rettv_dict_set(rettv, d); in rettv_dict_alloc()
94 rettv_dict_set(typval_T *rettv, dict_T *d) in rettv_dict_set() argument
97 rettv->vval.v_dict = d; in rettv_dict_set()
98 if (d != NULL) in rettv_dict_set()
99 ++d->dv_refcount; in rettv_dict_set()
107 dict_free_contents(dict_T *d) in dict_free_contents() argument
109 hashtab_free_contents(&d->dv_hashtab); in dict_free_contents()
110 free_type(d->dv_type); in dict_free_contents()
111 d->dv_type = NULL; in dict_free_contents()
146 dict_free_dict(dict_T *d) in dict_free_dict() argument
149 if (d->dv_used_prev == NULL) in dict_free_dict()
150 first_dict = d->dv_used_next; in dict_free_dict()
152 d->dv_used_prev->dv_used_next = d->dv_used_next; in dict_free_dict()
153 if (d->dv_used_next != NULL) in dict_free_dict()
154 d->dv_used_next->dv_used_prev = d->dv_used_prev; in dict_free_dict()
155 vim_free(d); in dict_free_dict()
159 dict_free(dict_T *d) in dict_free() argument
163 dict_free_contents(d); in dict_free()
164 dict_free_dict(d); in dict_free()
173 dict_unref(dict_T *d) in dict_unref() argument
175 if (d != NULL && --d->dv_refcount <= 0) in dict_unref()
176 dict_free(d); in dict_unref()
353 dict_wrong_func_name(dict_T *d, typval_T *tv, char_u *name) in dict_wrong_func_name() argument
355 return (d == get_globvar_dict() in dict_wrong_func_name()
357 && d == &SCRIPT_ITEM(current_sctx.sc_sid)->sn_vars->sv_dict) in dict_wrong_func_name()
358 || &d->dv_hashtab == get_funccal_local_ht()) in dict_wrong_func_name()
368 dict_add(dict_T *d, dictitem_T *item) in dict_add() argument
370 if (dict_wrong_func_name(d, &item->di_tv, item->di_key)) in dict_add()
372 return hash_add(&d->dv_hashtab, item->di_key); in dict_add()
380 dict_add_number_special(dict_T *d, char *key, varnumber_T nr, vartype_T vartype) in dict_add_number_special() argument
389 if (dict_add(d, item) == FAIL) in dict_add_number_special()
402 dict_add_number(dict_T *d, char *key, varnumber_T nr) in dict_add_number() argument
404 return dict_add_number_special(d, key, nr, VAR_NUMBER); in dict_add_number()
412 dict_add_bool(dict_T *d, char *key, varnumber_T nr) in dict_add_bool() argument
414 return dict_add_number_special(d, key, nr, VAR_BOOL); in dict_add_bool()
422 dict_add_string(dict_T *d, char *key, char_u *str) in dict_add_string() argument
424 return dict_add_string_len(d, key, str, -1); in dict_add_string()
434 dict_add_string_len(dict_T *d, char *key, char_u *str, int len) in dict_add_string_len() argument
451 if (dict_add(d, item) == FAIL) in dict_add_string_len()
464 dict_add_list(dict_T *d, char *key, list_T *list) in dict_add_list() argument
474 if (dict_add(d, item) == FAIL) in dict_add_list()
487 dict_add_tv(dict_T *d, char *key, typval_T *tv) in dict_add_tv() argument
495 if (dict_add(d, item) == FAIL) in dict_add_tv()
508 dict_add_callback(dict_T *d, char *key, callback_T *cb) in dict_add_callback() argument
516 if (dict_add(d, item) == FAIL) in dict_add_callback()
538 dict_T *d = var->vval.v_dict; in dict_iterate_start() local
540 iter->dit_todo = d->dv_hashtab.ht_used; in dict_iterate_start()
541 iter->dit_hi = d->dv_hashtab.ht_array; in dict_iterate_start()
578 dict_add_dict(dict_T *d, char *key, dict_T *dict) in dict_add_dict() argument
588 if (dict_add(d, item) == FAIL) in dict_add_dict()
600 dict_len(dict_T *d) in dict_len() argument
602 if (d == NULL) in dict_len()
604 return (long)d->dv_hashtab.ht_used; in dict_len()
613 dict_find(dict_T *d, char_u *key, int len) in dict_find() argument
621 if (d == NULL) in dict_find()
638 hi = hash_find(&d->dv_hashtab, akey); in dict_find()
650 dict_get_tv(dict_T *d, char_u *key, typval_T *rettv) in dict_get_tv() argument
654 di = dict_find(d, key, -1); in dict_get_tv()
668 dict_get_string(dict_T *d, char_u *key, int save) in dict_get_string() argument
673 di = dict_find(d, key, -1); in dict_get_string()
687 dict_get_number(dict_T *d, char_u *key) in dict_get_number() argument
689 return dict_get_number_def(d, key, 0); in dict_get_number()
697 dict_get_number_def(dict_T *d, char_u *key, int def) in dict_get_number_def() argument
701 di = dict_find(d, key, -1); in dict_get_number_def()
713 dict_get_number_check(dict_T *d, char_u *key) in dict_get_number_check() argument
717 di = dict_find(d, key, -1); in dict_get_number_check()
733 dict_get_bool(dict_T *d, char_u *key, int def) in dict_get_bool() argument
737 di = dict_find(d, key, -1); in dict_get_bool()
756 dict_T *d; in dict2string() local
759 if ((d = tv->vval.v_dict) == NULL) in dict2string()
764 todo = (int)d->dv_hashtab.ht_used; in dict2string()
765 for (hi = d->dv_hashtab.ht_array; todo > 0 && !got_int; ++hi) in dict2string()
889 dict_T *d = NULL; in eval_dict() local
916 d = dict_alloc(); in eval_dict()
917 if (d == NULL) in eval_dict()
1005 item = dict_find(d, key, -1); in eval_dict()
1018 if (dict_add(d, item) == FAIL) in eval_dict()
1058 if (d != NULL) in eval_dict()
1059 dict_free(d); in eval_dict()
1065 rettv_dict_set(rettv, d); in eval_dict()
1202 dict_T *d; in dict_list() local
1216 if ((d = argvars[0].vval.v_dict) == NULL) in dict_list()
1220 todo = (int)d->dv_hashtab.ht_used; in dict_list()
1221 for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) in dict_list()
1349 dict_T *d; in dict_remove() local
1355 else if ((d = argvars[0].vval.v_dict) != NULL in dict_remove()
1356 && !value_check_lock(d->dv_lock, arg_errmsg, TRUE)) in dict_remove()
1361 di = dict_find(d, key, -1); in dict_remove()
1369 dictitem_remove(d, di); in dict_remove()