cfg_add_item_string()

Create a new node from a key and add it to a configuration tree.

Synopsis:

#include <asr/cfg.h>
 
cfg_item_t* cfg_add_item_string(cfg_item_t *current, const char *ckey_value)

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_value

A string consisting of the name for the new node and optionally a value. If NULL, the name "anon" is assigned, with an empty string assigned as the value.

Library:

libasr

Description:

The cfg_add_item_string() function creates a new a configuration item with the name and optional value specified by ckey_value. If ckey_value contains a '{' character, it will be removed from the assigned value. For example, the key string "mynode = special {" becomes the key "mynode" and the value "special". The new item is added as a child of the specified node (current), behind its sibling nodes.

Returns:

A pointer to the new node.