cfg_replace_item()

Replace a node in a configuration tree.

Synopsis:

#include <asr/cfg.h>
 
cfg_item_t* cfg_replace_item(cfg_item_t *base, const char *ckey, const char *new_value)

Arguments:

base

A pointer to the root of the configuration tree to search.

ckey

The key of the node to search for.

new_value

The value of the replacement node.

Library:

libasr

Description:

The cfg_replace_item() function deletes the first node under base with the key ckey. It then inserts a new node with the key ckey and value new_value as a child of base, in front of its sibling nodes.

Returns:

A pointer to the new configuration item.