cfg_insert_item()

Insert a node in a configuration tree.

Synopsis:

#include <asr/cfg.h>
 
cfg_item_t* cfg_insert_item(cfg_item_t *current, const char *ckey, const char *cvalue)

Arguments:

current

A pointer to the node to add the new configuration item to. If NULL, the new configuration item becomes the root of a new configuration tree.

ckey

The name for the new node. If NULL, the name "anon" is assigned.

cvalue

The value for the new node. If NULL, an empty string is assigned.

Library:

libasr

Description:

The cfg_insert_item() function creates a new a configuration item with the specifed name (ckey) and optional value (cvalue). Spaces and quotes are removed from the name and the value; any variable references are resolved before the new item is created. The new item is added as a child of the specified node (current), in front of its sibling nodes.

Returns:

A pointer to the new node.