Add function to get the parent of a given node.

release-1.5.4.branch
Vreixo Formoso 15 years ago
parent e9e1d28333
commit 53c2215ab3
  1. 12
      src/libisofs.h
  2. 15
      src/node.c

@ -836,6 +836,18 @@ int iso_node_take(IsoNode *node);
*/
int iso_node_remove(IsoNode *node);
/*
* Get the parent of the given iso tree node. No extra ref is added to the
* returned directory, you must take your ref. with iso_node_ref() if you
* need it.
*
* If node is the root node, the same node will be returned as its parent.
*
* This returns NULL if the node doesn't pertain to any tree
* (it was removed/take).
*/
IsoDir *iso_node_get_parent(IsoNode *node);
/**
* Get an iterator for the children of the given dir.
*

@ -489,6 +489,21 @@ int iso_node_remove(IsoNode *node)
return ret;
}
/*
* Get the parent of the given iso tree node. No extra ref is added to the
* returned directory, you must take your ref. with iso_node_ref() if you
* need it.
*
* If node is the root node, the same node will be returned as its parent.
*
* This returns NULL if the node doesn't pertain to any tree
* (it was removed/take).
*/
IsoDir *iso_node_get_parent(IsoNode *node)
{
return node->parent;
}
/* TODO #00005 optimize iso_dir_iter_take */
int iso_dir_iter_take(IsoDirIter *iter)
{

Loading…
Cancel
Save