diff --git a/Makefile.am b/Makefile.am index b65b308..acec555 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,7 +75,11 @@ libisofs_libisofs_la_SOURCES = \ libisofs/rockridge.h \ libisofs/rockridge.c \ libisofs/joliet.c \ - libisofs/joliet.h + libisofs/joliet.h \ + libisofs/exclude.c \ + libisofs/exclude.h \ + libisofs/hash.h \ + libisofs/hash.c libinclude_HEADERS = \ libburn/libburn.h \ diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 8bfdab3..fedf0f9 100755 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -117,6 +117,26 @@ struct iso_tree_node *iso_tree_add_node(struct iso_tree_node *parent, struct iso_tree_node *iso_tree_radd_dir(struct iso_tree_node *parent, const char *path); + +/** + * Add the path of a file or directory to ignore when adding a directory recursively. + * + * \param path The path, on the local filesystem, of the file. + */ +void iso_exclude_add_path(const char *path); + +/** + * Remove a path that was set to be ignored when adding a directory recusively. + * + * \param path The path, on the local filesystem, of the file. + */ +void iso_exclude_remove_path(const char *path); + +/** + * Remove all paths that were set to be ignored when adding a directory recusively. + */ +void iso_exclude_empty(void); + /** * Creates a new, empty directory on the volume. * diff --git a/libisofs/tree.c b/libisofs/tree.c index e4b7ef7..08a1bbf 100755 --- a/libisofs/tree.c +++ b/libisofs/tree.c @@ -22,6 +22,7 @@ #include "tree.h" #include "util.h" #include "volume.h" +#include "exclude.h" static void set_default_stat(struct stat *s) @@ -157,6 +158,11 @@ iso_tree_radd_dir (struct iso_tree_node *parent, const char *path) continue; sprintf(child, "%s/%s", path, ent->d_name); + + /* see if this child is excluded. */ + if (iso_exclude_lookup(child)) + continue; + iso_tree_radd_dir(new, child); } closedir(dir);