Add function to get the parent of a given node.
This commit is contained in:
parent
e9e1d28333
commit
53c2215ab3
@ -836,6 +836,18 @@ int iso_node_take(IsoNode *node);
|
|||||||
*/
|
*/
|
||||||
int iso_node_remove(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.
|
* Get an iterator for the children of the given dir.
|
||||||
*
|
*
|
||||||
|
15
src/node.c
15
src/node.c
@ -489,6 +489,21 @@ int iso_node_remove(IsoNode *node)
|
|||||||
return ret;
|
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 */
|
/* TODO #00005 optimize iso_dir_iter_take */
|
||||||
int iso_dir_iter_take(IsoDirIter *iter)
|
int iso_dir_iter_take(IsoDirIter *iter)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user