1
0
forked from aniani/vim

patch 7.4.2204

Problem:    It is not easy to get information about buffers, windows and
            tabpages.
Solution:   Add getbufinfo(), getwininfo() and gettabinfo(). (Yegappan
            Lakshmanan)
This commit is contained in:
Bram Moolenaar
2016-08-12 22:23:25 +02:00
parent ebcccad573
commit b5ae48e9ff
13 changed files with 528 additions and 1 deletions

View File

@@ -366,6 +366,30 @@ dict_add_list(dict_T *d, char *key, list_T *list)
return OK;
}
/*
* Add a dict entry to dictionary "d".
* Returns FAIL when out of memory and when key already exists.
*/
int
dict_add_dict(dict_T *d, char *key, dict_T *dict)
{
dictitem_T *item;
item = dictitem_alloc((char_u *)key);
if (item == NULL)
return FAIL;
item->di_tv.v_lock = 0;
item->di_tv.v_type = VAR_DICT;
item->di_tv.vval.v_dict = dict;
if (dict_add(d, item) == FAIL)
{
dictitem_free(item);
return FAIL;
}
++dict->dv_refcount;
return OK;
}
/*
* Get the number of items in a Dictionary.
*/