diff --git a/src/libisofs.h b/src/libisofs.h index 38e1353..dd73618 100644 --- a/src/libisofs.h +++ b/src/libisofs.h @@ -43,6 +43,16 @@ enum IsoNodeType { LIBISO_BOOT }; +/** + * Flag used to hide a file in the RR/ISO or Joliet tree. + * + * \see iso_node_set_hidden + */ +enum IsoHideNodeFlag { + LIBISO_HIDE_ON_RR = 1 << 0, + LIBISO_HIDE_ON_JOLIET = 1 << 1 +}; + /** * Create a new image, empty. * @@ -300,6 +310,25 @@ void iso_node_set_ctime(IsoNode *node, time_t time); */ time_t iso_node_get_ctime(const IsoNode *node); +/** + * Set if the node will be hidden in RR/ISO tree, Joliet tree or both. + * + * If the file is setted as hidden in one tree, it won't be included there, so + * it won't be visible in a OS accessing CD using that tree. For example, + * GNU/Linux systems access to Rock Ridge / ISO9960 tree in order to see + * what is recorded on CD, while MS Windows make use of the Joliet tree. If a + * file is hidden only in Joliet, it won't be visible in Windows systems, + * while still visible in Linux. + * + * If a file is hidden in both trees, it won't be written to image. + * + * @param node + * The node that is to be hidden. + * @param hide_attrs + * IsoHideNodeFlag's to set the trees in which file will be hidden. + */ +void iso_node_set_hidden(IsoNode *node, int hide_attrs); + /** * Add a new node to a dir. Note that this function don't add a new ref to * the node, so you don't need to free it, it will be automatically freed diff --git a/src/node.c b/src/node.c index 41edd51..d38294c 100644 --- a/src/node.c +++ b/src/node.c @@ -229,6 +229,11 @@ time_t iso_node_get_ctime(const IsoNode *node) return node->ctime; } +void iso_node_set_hidden(IsoNode *node, int hide_attrs) +{ + node->hidden = hide_attrs; +} + /** * Add a new node to a dir. Note that this function don't add a new ref to * the node, so you don't need to free it, it will be automatically freed diff --git a/src/node.h b/src/node.h index 931cd51..34abad5 100644 --- a/src/node.h +++ b/src/node.h @@ -20,16 +20,6 @@ #include #include -/** - * Flag used to hide a file in the RR/ISO or Joliet tree. - * - * \see iso_tree_node_set_hidden - */ -enum IsoHideNodeFlag { - LIBISO_HIDE_ON_RR = 1 << 0, - LIBISO_HIDE_ON_JOLIET = 1 << 1 -}; - /** * */ diff --git a/src/tree.c b/src/tree.c index 751e6f7..f4e2978 100644 --- a/src/tree.c +++ b/src/tree.c @@ -360,7 +360,7 @@ int iso_tree_add_node(IsoImage *image, IsoDir *parent, const char *path, result = iso_tree_add_node_builder(image, parent, file, image->builder, node); /* free the file */ - iso_file_source_unref(file); + iso_file_source_unref(file); return result; }