cfg_find_item()

Find a node in a configuration tree.

Synopsis:

#include <asr/cfg.h>
 
cfg_item_t* cfg_find_item(const cfg_item_t *node, const char *cname, int levels)

Arguments:

node

A pointer to the node to begin the search in.

cname

A '/' separated list of node names that leads to the desired node.

levels

Indicates how high up the hiearchy the search will go (0 = siblings only; -1 = all the way to the root).

Library:

libasr

Description:

The cfg_find_item() function performs a restricted hiearchical search starting at node for a node with cname. For example, if cname is "phone/digit-dialing", cfg_find_item() searches for the "phone" node within the subtree of node, and then searches for the "digit-dialing" node within the "phone" node.

Returns:

A pointer to the matching configuration node; NULL if the item wasn't found.