Browse Source

Expose iso_node_set_hidden(), to let a node be hidden in RR/ISO or Joliet tree.

release-1.5.4.branch
Vreixo Formoso 15 years ago
parent
commit
60d68df84c
  1. 29
      src/libisofs.h
  2. 5
      src/node.c
  3. 10
      src/node.h
  4. 2
      src/tree.c

29
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

5
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

10
src/node.h

@ -20,16 +20,6 @@
#include <unistd.h>
#include <stdint.h>
/**
* 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
};
/**
*
*/

2
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;
}

Loading…
Cancel
Save