cfg_find_predefined_item()

Find a node earlier in a configuration tree.

Synopsis:

#include <asr/cfg.h>
 
cfg_item_t* cfg_find_predefined_item(const cfg_item_t *base, const char *key, int levels)

Arguments:

base

A pointer to the node to begin the search in.

key

A '/' separated list of node names to search for.

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_predefined_item() function performs a restricted search for a node with key, starting with the previous siblings of base, and then moving up to the parent of base, the previous siblings of the parent of base, and so on.

Returns:

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