Expose iso_node_get_type().
This commit is contained in:
parent
27670f8d3a
commit
70b9b87150
@ -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…
Reference in New Issue
Block a user