comparison src/dict.c @ 9858:3e96d9ed2ca1 v7.4.2204

commit https://github.com/vim/vim/commit/b5ae48e9ffd3b8eb6ca4057de11f1bddcde8ce6f Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 12 22:23:25 2016 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Fri, 12 Aug 2016 22:30:07 +0200
parents ba98d7ce0d74
children 4aead6a9b7a9
comparison
equal deleted inserted replaced
9857:0ee54b6ef77d 9858:3e96d9ed2ca1
365 ++list->lv_refcount; 365 ++list->lv_refcount;
366 return OK; 366 return OK;
367 } 367 }
368 368
369 /* 369 /*
370 * Add a dict entry to dictionary "d".
371 * Returns FAIL when out of memory and when key already exists.
372 */
373 int
374 dict_add_dict(dict_T *d, char *key, dict_T *dict)
375 {
376 dictitem_T *item;
377
378 item = dictitem_alloc((char_u *)key);
379 if (item == NULL)
380 return FAIL;
381 item->di_tv.v_lock = 0;
382 item->di_tv.v_type = VAR_DICT;
383 item->di_tv.vval.v_dict = dict;
384 if (dict_add(d, item) == FAIL)
385 {
386 dictitem_free(item);
387 return FAIL;
388 }
389 ++dict->dv_refcount;
390 return OK;
391 }
392
393 /*
370 * Get the number of items in a Dictionary. 394 * Get the number of items in a Dictionary.
371 */ 395 */
372 long 396 long
373 dict_len(dict_T *d) 397 dict_len(dict_T *d)
374 { 398 {