dictModifyValue(3)

dictModifyValue3

Create/modify an item.

Usage

#include <util/dict.h>
NEOERR *dictModifyValue(dictCtx dict, const char *id, dictNewValueCB new_cb, 
                     dictUpdateValueCB update, void *rock);

Arguments

dict - dictionary to add pair to.
id - identifier of value
new - function to call to create new value (may be NULL)
update - function to call to modify value (if NULL, the old
value is freed, and <new> is used)
rock - context to pass to <new> or <update>.

Overview

Finds <id>'s value and calls <update>. If <id> is not in <dict>, calls <new> to obtain a new value.

MT-Level: Safe if <dict> thread-safe.

Return value

None.

Releases

10 releases since Debian 4.0 (Etch); the text changed 2 times.

  1. 4.0
  2. 5.0
  3. 6.0–13

From clearsilver-dev 0.10.5-6+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.