cfg_attach_item()

Detach an item from its current parent and attach it to another node.

Synopsis:

#include <asr/cfg.h>
 
cfg_item_t* cfg_attach_item(cfg_item_t *parent, cfg_item_t *item, int tail)

Arguments:

parent

A pointer to the node to attach the item to.

item

A pointer to the item to attach to parent.

tail

Specifies whether the child is prepended (0) or appended (1) to the parent's list of children.

Library:

libasr

Description:

The cfg_attach_item() function detaches the specified configuration item from its parent and attaches it as a child to the specified node (parent). If parent is NULL, this function is equivalent to cfg_detach_item(). If parent isn't NULL, tail specifies whether the child is prepended (0) or appended (1) to the parent's list of children.

Returns:

A pointer to the item; NULL on error.