Expose iso_node_get_type().

release-1.5.4.branch
Vreixo Formoso 15 years ago
parent 27670f8d3a
commit 70b9b87150
  1. 17
      src/libisofs.h
  2. 8
      src/node.c

@ -22,6 +22,18 @@ typedef struct Iso_Dir_Iter IsoDirIter;
/**
* The type of an IsoNode.
*
* When an user gets an IsoNode from an image, (s)he can use
* iso_node_get_type() to get the current type of the node, and then
* cast to the appropriate subtype. For example:
*
* ...
* IsoNode *node;
* res = iso_dir_iter_next(iter, &node);
* if (res == 1 && iso_node_get_type(node) == LIBISO_DIR) {
* IsoDir *dir = (IsoDir *)node;
* ...
* }
*/
enum IsoNodeType {
LIBISO_DIR,
@ -191,6 +203,11 @@ void iso_node_ref(IsoNode *node);
*/
void iso_node_unref(IsoNode *node);
/**
* Get the type of an IsoNode.
*/
enum IsoNodeType iso_node_get_type(IsoNode *node);
/**
* Set the name of a node. Note that if the node is already added to a dir
* this can fail if dir already contains a node with the new name.

@ -63,6 +63,14 @@ void iso_node_unref(IsoNode *node)
}
}
/**
* Get the type of an IsoNode.
*/
enum IsoNodeType iso_node_get_type(IsoNode *node)
{
return node->type;
}
/**
* Set the name of a node.
*

Loading…
Cancel
Save