]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Delete archive_matching_path_excluded and archive_matching_path_excluded_w.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Thu, 19 Jan 2012 04:54:43 +0000 (23:54 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Thu, 19 Jan 2012 04:54:43 +0000 (23:54 -0500)
They were not so helpful than I though at archive_read_disk.
Rename archive_matching_path_excluded_ae to archive_matching_path_excluded.
Rename archive_matching_time_excluded_ae to archive_matching_time_excluded.
Rename archive_matching_owner_excluded_ae to archive_matching_owner_excluded.
Rename archive_matching_excluded_ae to archive_matching_excluded.

SVN-Revision: 4178

cpio/cpio.c
libarchive/archive.h
libarchive/archive_matching.c
libarchive/archive_read_disk_posix.c
libarchive/archive_read_disk_windows.c
libarchive/test/test_archive_matching_owner.c
libarchive/test/test_archive_matching_path.c
libarchive/test/test_archive_matching_time.c
tar/read.c
tar/write.c

index c919d380b785edb9e87fc87fdf01c071a7816d3b..c0cb8a525fb150442b0a9e559e62997567bff7e9 100644 (file)
@@ -880,7 +880,7 @@ mode_in(struct cpio *cpio)
                        lafe_errc(1, archive_errno(a),
                            "%s", archive_error_string(a));
                }
-               if (archive_matching_path_excluded_ae(cpio->matching, entry))
+               if (archive_matching_path_excluded(cpio->matching, entry))
                        continue;
                if (cpio->option_rename) {
                        destpath = cpio_rename(archive_entry_pathname(entry));
@@ -982,7 +982,7 @@ mode_list(struct cpio *cpio)
                        lafe_errc(1, archive_errno(a),
                            "%s", archive_error_string(a));
                }
-               if (archive_matching_path_excluded_ae(cpio->matching, entry))
+               if (archive_matching_path_excluded(cpio->matching, entry))
                        continue;
                if (cpio->verbose)
                        list_item_verbose(cpio, entry);
index 44d53c5f4ef9d678080881ab890c97410bb7c811..524f210c907a5843b55985a2613e0da48e7e58dc 100644 (file)
@@ -818,27 +818,23 @@ __LA_DECL int     archive_matching_free(struct archive *);
 /*
  * Test if archive_entry is excluded.
  * This is a convenience function. This is the same as calling all
- * archive_matching_path_excluded_ae, archive_matching_time_excluded_ae
- * and archive_matching_owner_excluded_ae.
+ * archive_matching_path_excluded, archive_matching_time_excluded
+ * and archive_matching_owner_excluded.
  */
-__LA_DECL int  archive_matching_excluded_ae(struct archive *,
+__LA_DECL int  archive_matching_excluded(struct archive *,
                    struct archive_entry *);
 
 /*
- * Test if filename is excluded. The conditions are set by following functions.
+ * Test if pathname is excluded. The conditions are set by following functions.
  */
 __LA_DECL int  archive_matching_path_excluded(struct archive *,
-                   const char *_filename);
-__LA_DECL int  archive_matching_path_excluded_w(struct archive *,
-                   const wchar_t *_filename);
-__LA_DECL int  archive_matching_path_excluded_ae(struct archive *,
                    struct archive_entry *);
-/* Add exclusion fielname pattern. */
+/* Add exclusion pathname pattern. */
 __LA_DECL int  archive_matching_exclude_pattern(struct archive *,
                    const char *);
 __LA_DECL int  archive_matching_exclude_pattern_w(struct archive *,
                    const wchar_t *);
-/* Add inclusion fielname pattern. */
+/* Add inclusion pathname pattern. */
 __LA_DECL int  archive_matching_include_pattern(struct archive *,
                    const char *);
 __LA_DECL int  archive_matching_include_pattern_w(struct archive *,
@@ -860,7 +856,7 @@ __LA_DECL int       archive_matching_path_unmatched_inclusions_next_w(
  * Test if a file is excluded by its time stamp.
  * The conditions are set by following functions.
  */
-__LA_DECL int  archive_matching_time_excluded_ae(struct archive *,
+__LA_DECL int  archive_matching_time_excluded(struct archive *,
                    struct archive_entry *);
 /* Set inclusion file times. */
 __LA_DECL int  archive_matching_newer_mtime(struct archive *,
@@ -901,7 +897,7 @@ __LA_DECL int       archive_matching_pathname_newer_mtime_ae(
  * Test if a file is excluded by its uid ,gid, uname or gname.
  * The conditions are set by following functions.
  */
-__LA_DECL int  archive_matching_owner_excluded_ae(struct archive *,
+__LA_DECL int  archive_matching_owner_excluded(struct archive *,
                    struct archive_entry *);
 /* Add inclusion uid, gid, uname and gname. */
 __LA_DECL int  archive_matching_include_uid(struct archive *,
index 8d49ddab2b1ec736bad695eccdbd153eb1ece7b4..5893ef9e63e2a2bc045b0dd29b6004fa8eb3f0c0 100644 (file)
@@ -244,7 +244,7 @@ archive_matching_free(struct archive *_a)
  * Returns <0 if something error happened.
  */
 int
-archive_matching_excluded_ae(struct archive *_a, struct archive_entry *entry)
+archive_matching_excluded(struct archive *_a, struct archive_entry *entry)
 {
        struct archive_matching *a;
        int r;
@@ -368,51 +368,13 @@ archive_matching_include_pattern_w(struct archive *_a, const wchar_t *pattern)
  * Returns <0 if something error happened.
  */
 int
-archive_matching_path_excluded(struct archive *_a, const char *pathname)
-{
-       struct archive_matching *a;
-
-       archive_check_magic(_a, ARCHIVE_MATCHING_MAGIC,
-           ARCHIVE_STATE_NEW, "archive_matching_path_excluded");
-
-       if (pathname == NULL || *pathname == L'\0')
-               return (0);
-       a = (struct archive_matching *)_a;
-
-       /* If we don't have exclusion/inclusion pattern set at all,
-        * the pathname is always not excluded. */
-       if ((a->setflag & PATTERN_IS_SET) == 0)
-               return (0);
-       return (path_excluded(a, 1, pathname));
-}
-
-int
-archive_matching_path_excluded_w(struct archive *_a, const wchar_t *pathname)
-{
-       struct archive_matching *a;
-
-       archive_check_magic(_a, ARCHIVE_MATCHING_MAGIC,
-           ARCHIVE_STATE_NEW, "archive_matching_path_excluded_w");
-
-       if (pathname == NULL || *pathname == L'\0')
-               return (0);
-       a = (struct archive_matching *)_a;
-
-       /* If we don't have exclusion/inclusion pattern set at all,
-        * the pathname is always not excluded. */
-       if ((a->setflag & PATTERN_IS_SET) == 0)
-               return (0);
-       return (path_excluded(a, 0, pathname));
-}
-
-int
-archive_matching_path_excluded_ae(struct archive *_a,
+archive_matching_path_excluded(struct archive *_a,
     struct archive_entry *entry)
 {
        struct archive_matching *a;
 
        archive_check_magic(_a, ARCHIVE_MATCHING_MAGIC,
-           ARCHIVE_STATE_NEW, "archive_matching_path_excluded_ae");
+           ARCHIVE_STATE_NEW, "archive_matching_path_excluded");
 
        a = (struct archive_matching *)_a;
        if (entry == NULL) {
@@ -1051,7 +1013,7 @@ archive_matching_pathname_newer_mtime_ae(struct archive *_a,
  * Returns <0 if something error happened.
  */
 int
-archive_matching_time_excluded_ae(struct archive *_a,
+archive_matching_time_excluded(struct archive *_a,
     struct archive_entry *entry)
 {
        struct archive_matching *a;
@@ -1492,7 +1454,7 @@ archive_matching_include_gname_w(struct archive *_a, const wchar_t *gname)
  * Returns <0 if something error happened.
  */
 int
-archive_matching_owner_excluded_ae(struct archive *_a,
+archive_matching_owner_excluded(struct archive *_a,
     struct archive_entry *entry)
 {
        struct archive_matching *a;
index 88b89b6122f7de884740e2502cb0f3c74d6d4f3d..15c778637c39b95f33f17baba027828443d92fe3 100644 (file)
@@ -914,8 +914,7 @@ next_entry:
         * Perform path matching.
         */
        if (a->matching) {
-               r = archive_matching_path_excluded(a->matching,
-                       tree_current_path(t));
+               r = archive_matching_path_excluded(a->matching, entry);
                if (r < 0) {
                        archive_set_error(&(a->archive), errno,
                            "Faild : %s", archive_error_string(a->matching));
@@ -1020,7 +1019,7 @@ next_entry:
         * Perform time matching.
         */
        if (a->matching) {
-               r = archive_matching_time_excluded_ae(a->matching, entry);
+               r = archive_matching_time_excluded(a->matching, entry);
                if (r < 0) {
                        archive_set_error(&(a->archive), errno,
                            "Faild : %s", archive_error_string(a->matching));
@@ -1047,7 +1046,7 @@ next_entry:
         * Perform owner matching.
         */
        if (a->matching) {
-               r = archive_matching_owner_excluded_ae(a->matching, entry);
+               r = archive_matching_owner_excluded(a->matching, entry);
                if (r < 0) {
                        archive_set_error(&(a->archive), errno,
                            "Faild : %s", archive_error_string(a->matching));
index 814d4bec8505b8f66f014b23f878e5d03a8fb1a8..58369db56f07c2bf318c88677cf41c8d41c4257a 100644 (file)
@@ -795,8 +795,7 @@ next_entry:
         * Perform path matching.
         */
        if (a->matching) {
-               r = archive_matching_path_excluded_w(a->matching,
-                       tree_current_path(t));
+               r = archive_matching_path_excluded(a->matching, entry);
                if (r < 0) {
                        archive_set_error(&(a->archive), errno,
                            "Faild : %s", archive_error_string(a->matching));
@@ -863,7 +862,7 @@ next_entry:
         * Perform time matching.
         */
        if (a->matching) {
-               r = archive_matching_time_excluded_ae(a->matching, entry);
+               r = archive_matching_time_excluded(a->matching, entry);
                if (r < 0) {
                        archive_set_error(&(a->archive), errno,
                            "Faild : %s", archive_error_string(a->matching));
@@ -890,7 +889,7 @@ next_entry:
         * Perform owner matching.
         */
        if (a->matching) {
-               r = archive_matching_owner_excluded_ae(a->matching, entry);
+               r = archive_matching_owner_excluded(a->matching, entry);
                if (r < 0) {
                        archive_set_error(&(a->archive), errno,
                            "Faild : %s", archive_error_string(a->matching));
index 50c63ec4fe8088a2ba6f60f592a5ad4e2eb4e08c..7ed90e24f28f7b101e844a86154f3dbc565053b2 100644 (file)
@@ -44,24 +44,24 @@ test_uid(void)
 
        archive_entry_set_uid(ae, 0);
        failure("uid 0 should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_set_uid(ae, 1000);
        failure("uid 1000 should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_set_uid(ae, 1001);
        failure("uid 1001 should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_set_uid(ae, 1002);
        failure("uid 1002 should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_set_uid(ae, 1003);
        failure("uid 1003 should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Clean up. */
        archive_entry_free(ae);
@@ -86,24 +86,24 @@ test_gid(void)
 
        archive_entry_set_gid(ae, 0);
        failure("uid 0 should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_set_gid(ae, 1000);
        failure("uid 1000 should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_set_gid(ae, 1001);
        failure("uid 1001 should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_set_gid(ae, 1002);
        failure("uid 1002 should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_set_gid(ae, 1003);
        failure("uid 1003 should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Clean up. */
        archive_entry_free(ae);
@@ -128,24 +128,24 @@ test_uname_mbs(void)
 
        archive_entry_copy_uname(ae, "unknown");
        failure("User 'unknown' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_copy_uname(ae, "foo");
        failure("User 'foo' should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_copy_uname(ae, "foo1");
        failure("User 'foo1' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_copy_uname(ae, "bar");
        failure("User 'bar' should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_copy_uname(ae, "bar1");
        failure("User 'bar1' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Clean up. */
        archive_entry_free(ae);
@@ -170,24 +170,24 @@ test_uname_wcs(void)
 
        archive_entry_copy_uname_w(ae, L"unknown");
        failure("User 'unknown' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_copy_uname_w(ae, L"foo");
        failure("User 'foo' should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_copy_uname_w(ae, L"foo1");
        failure("User 'foo1' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_copy_uname_w(ae, L"bar");
        failure("User 'bar' should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_copy_uname_w(ae, L"bar1");
        failure("User 'bar1' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Clean up. */
        archive_entry_free(ae);
@@ -212,24 +212,24 @@ test_gname_mbs(void)
 
        archive_entry_copy_gname(ae, "unknown");
        failure("Group 'unknown' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_copy_gname(ae, "foo");
        failure("Group 'foo' should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_copy_gname(ae, "foo1");
        failure("Group 'foo1' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_copy_gname(ae, "bar");
        failure("Group 'bar' should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_copy_gname(ae, "bar1");
        failure("Group 'bar1' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Clean up. */
        archive_entry_free(ae);
@@ -254,24 +254,24 @@ test_gname_wcs(void)
 
        archive_entry_copy_gname_w(ae, L"unknown");
        failure("Group 'unknown' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_copy_gname_w(ae, L"foo");
        failure("Group 'foo' should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_copy_gname_w(ae, L"foo1");
        failure("Group 'foo1' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_copy_gname_w(ae, L"bar");
        failure("Group 'bar' should not be excluded");
-       assertEqualInt(0, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_copy_gname_w(ae, L"bar1");
        failure("Group 'bar1' should be excluded");
-       assertEqualInt(1, archive_matching_owner_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_owner_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Clean up. */
        archive_entry_free(ae);
index 2ac3e1aceb06c4a0ed5c0426fc0c4fa4594a105a..9ad5b8ce9084ef3c25ba00b3e62ec415046bd0b0 100644 (file)
@@ -43,24 +43,26 @@ test_exclusion_mbs(void)
        assertEqualIntA(m, 0, archive_matching_exclude_pattern(m, "^aa*"));
 
        /* Test with 'aa1234', which should be excluded. */
-       failure("'aa1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded(m, "aa1234"));
-       failure("'aa1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded_w(m, L"aa1234"));
        archive_entry_copy_pathname(ae, "aa1234");
        failure("'aa1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_path_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
+       archive_entry_clear(ae);
+       archive_entry_copy_pathname_w(ae, L"aa1234");
+       failure("'aa1234' should be excluded");
+       assertEqualInt(1, archive_matching_path_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Test with 'a1234', which should not be excluded. */
-       failure("'a1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded(m, "a1234"));
-       failure("'a1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded_w(m, L"a1234"));
        archive_entry_copy_pathname(ae, "a1234");
        failure("'a1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_path_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
+       archive_entry_clear(ae);
+       archive_entry_copy_pathname_w(ae, L"a1234");
+       failure("'a1234' should not be excluded");
+       assertEqualInt(0, archive_matching_path_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /* Clean up. */
        archive_entry_free(ae);
@@ -84,24 +86,26 @@ test_exclusion_wcs(void)
        assertEqualIntA(m, 0, archive_matching_exclude_pattern_w(m, L"^aa*"));
 
        /* Test with 'aa1234', which should be excluded. */
-       failure("'aa1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded(m, "aa1234"));
-       failure("'aa1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded_w(m, L"aa1234"));
        archive_entry_copy_pathname(ae, "aa1234");
        failure("'aa1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_path_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
+       archive_entry_clear(ae);
+       archive_entry_copy_pathname_w(ae, L"aa1234");
+       failure("'aa1234' should be excluded");
+       assertEqualInt(1, archive_matching_path_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Test with 'a1234', which should not be excluded. */
-       failure("'a1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded(m, "a1234"));
-       failure("'a1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded_w(m, L"a1234"));
        archive_entry_copy_pathname(ae, "a1234");
        failure("'a1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_path_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
+       archive_entry_clear(ae);
+       archive_entry_copy_pathname_w(ae, L"a1234");
+       failure("'a1234' should not be excluded");
+       assertEqualInt(0, archive_matching_path_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /* Clean up. */
        archive_entry_free(ae);
@@ -126,24 +130,26 @@ test_inclusion_mbs(void)
        assertEqualIntA(m, 0, archive_matching_include_pattern(m, "^aa*"));
 
        /* Test with 'aa1234', which should not be excluded. */
-       failure("'aa1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded(m, "aa1234"));
-       failure("'aa1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded_w(m, L"aa1234"));
        archive_entry_copy_pathname(ae, "aa1234");
        failure("'aa1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_path_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
+       archive_entry_clear(ae);
+       archive_entry_copy_pathname_w(ae, L"aa1234");
+       failure("'aa1234' should not be excluded");
+       assertEqualInt(0, archive_matching_path_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /* Test with 'a1234', which should be excluded. */
-       failure("'a1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded(m, "a1234"));
-       failure("'a1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded_w(m, L"a1234"));
        archive_entry_copy_pathname(ae, "a1234");
        failure("'a1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_path_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
+       archive_entry_clear(ae);
+       archive_entry_copy_pathname_w(ae, L"a1234");
+       failure("'a1234' should be excluded");
+       assertEqualInt(1, archive_matching_path_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify unmatched_inclusions. */
        assertEqualInt(0, archive_matching_path_unmatched_inclusions(m));
@@ -173,24 +179,26 @@ test_inclusion_wcs(void)
        assertEqualIntA(m, 0, archive_matching_include_pattern_w(m, L"^aa*"));
 
        /* Test with 'aa1234', which should not be excluded. */
-       failure("'aa1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded(m, "aa1234"));
-       failure("'aa1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded_w(m, L"aa1234"));
        archive_entry_copy_pathname(ae, "aa1234");
        failure("'aa1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_path_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
+       archive_entry_clear(ae);
+       archive_entry_copy_pathname_w(ae, L"aa1234");
+       failure("'aa1234' should not be excluded");
+       assertEqualInt(0, archive_matching_path_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /* Test with 'a1234', which should be excluded. */
-       failure("'a1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded(m, "a1234"));
-       failure("'a1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded_w(m, L"a1234"));
        archive_entry_copy_pathname(ae, "a1234");
        failure("'a1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_path_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
+       archive_entry_clear(ae);
+       archive_entry_copy_pathname_w(ae, L"a1234");
+       failure("'a1234' should be excluded");
+       assertEqualInt(1, archive_matching_path_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify unmatched_inclusions. */
        assertEqualInt(0, archive_matching_path_unmatched_inclusions(m));
@@ -222,24 +230,26 @@ test_exclusion_and_inclusion(void)
        assertEqualIntA(m, 0, archive_matching_include_pattern(m, "^a1*"));
 
        /* Test with 'aa1234', which should not be excluded. */
-       failure("'aa1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded(m, "aa1234"));
-       failure("'aa1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded_w(m, L"aa1234"));
        archive_entry_copy_pathname(ae, "aa1234");
        failure("'aa1234' should not be excluded");
-       assertEqualInt(0, archive_matching_path_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_path_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
+       archive_entry_clear(ae);
+       archive_entry_copy_pathname_w(ae, L"aa1234");
+       failure("'aa1234' should not be excluded");
+       assertEqualInt(0, archive_matching_path_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /* Test with 'aaa1234', which should be excluded. */
-       failure("'aaa1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded(m, "aaa1234"));
-       failure("'aaa1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded_w(m, L"aaa1234"));
        archive_entry_copy_pathname(ae, "aaa1234");
        failure("'aaa1234' should be excluded");
-       assertEqualInt(1, archive_matching_path_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_path_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
+       archive_entry_clear(ae);
+       archive_entry_copy_pathname_w(ae, L"aaa1234");
+       failure("'aaa1234' should be excluded");
+       assertEqualInt(1, archive_matching_path_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify unmatched_inclusions. */
        assertEqualInt(1, archive_matching_path_unmatched_inclusions(m));
index b110e6382fd91e19bbe19b04deac7cb1a9369f1b..667a39fe96f4b7d0021ea7348c98b4f33c64d521 100644 (file)
@@ -46,31 +46,31 @@ test_newer_time(void)
        archive_entry_set_mtime(ae, 7880, 0);
        archive_entry_set_ctime(ae, 7880, 0);
        failure("Both Its mtime and ctime should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_set_mtime(ae, 7879, 999);
        archive_entry_set_ctime(ae, 7879, 999);
        failure("Both Its mtime and ctime should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        archive_entry_set_mtime(ae, 7881, 0);
        archive_entry_set_ctime(ae, 7881, 0);
        failure("Both Its mtime and ctime should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        archive_entry_set_mtime(ae, 7880, 1);
        archive_entry_set_ctime(ae, 7880, 0);
        failure("Its mtime should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        archive_entry_set_mtime(ae, 7880, 0);
        archive_entry_set_ctime(ae, 7880, 1);
        failure("Its ctime should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Clean up. */
        archive_entry_free(ae);
@@ -115,8 +115,8 @@ test_newer_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'mid' file. */
        archive_entry_clear(ae);
@@ -124,8 +124,8 @@ test_newer_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'new' file. */
        archive_entry_clear(ae);
@@ -133,8 +133,8 @@ test_newer_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /*
         * Test 'newer ctime than'.
@@ -159,8 +159,8 @@ test_newer_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'mid' file. */
        archive_entry_clear(ae);
@@ -168,8 +168,8 @@ test_newer_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'new' file. */
        archive_entry_clear(ae);
@@ -177,8 +177,8 @@ test_newer_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        assertChdir("..");
        /* Clean up. */
@@ -225,8 +225,8 @@ test_newer_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'mid' file. */
        archive_entry_clear(ae);
@@ -234,8 +234,8 @@ test_newer_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'new' file. */
        archive_entry_clear(ae);
@@ -243,8 +243,8 @@ test_newer_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /*
         * Test 'newer ctime than'.
@@ -269,8 +269,8 @@ test_newer_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'mid' file. */
        archive_entry_clear(ae);
@@ -278,8 +278,8 @@ test_newer_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'new' file. */
        archive_entry_clear(ae);
@@ -287,8 +287,8 @@ test_newer_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        assertChdir("..");
        /* Clean up. */
@@ -317,31 +317,31 @@ test_older_time(void)
        archive_entry_set_mtime(ae, 7880, 0);
        archive_entry_set_ctime(ae, 7880, 0);
        failure("Both Its mtime and ctime should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_set_mtime(ae, 7879, 999);
        archive_entry_set_ctime(ae, 7879, 999);
        failure("Both Its mtime and ctime should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        archive_entry_set_mtime(ae, 7881, 0);
        archive_entry_set_ctime(ae, 7881, 0);
        failure("Both Its mtime and ctime should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        archive_entry_set_mtime(ae, 7880, 1);
        archive_entry_set_ctime(ae, 7879, 0);
        failure("Its mtime should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        archive_entry_set_mtime(ae, 7879, 0);
        archive_entry_set_ctime(ae, 7880, 1);
        failure("Its ctime should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Clean up. */
        archive_entry_free(ae);
@@ -386,8 +386,8 @@ test_older_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /* Verify 'mid' file. */
        archive_entry_clear(ae);
@@ -395,8 +395,8 @@ test_older_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'new' file. */
        archive_entry_clear(ae);
@@ -404,8 +404,8 @@ test_older_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /*
         * Test 'older ctime than'.
@@ -430,8 +430,8 @@ test_older_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /* Verify 'mid' file. */
        archive_entry_clear(ae);
@@ -439,8 +439,8 @@ test_older_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'new' file. */
        archive_entry_clear(ae);
@@ -448,8 +448,8 @@ test_older_than_file_mbs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        assertChdir("..");
        /* Clean up. */
@@ -496,8 +496,8 @@ test_older_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /* Verify 'mid' file. */
        archive_entry_clear(ae);
@@ -505,8 +505,8 @@ test_older_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'new' file. */
        archive_entry_clear(ae);
@@ -514,8 +514,8 @@ test_older_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /*
         * Test 'older ctime than'.
@@ -540,8 +540,8 @@ test_older_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        /* Verify 'mid' file. */
        archive_entry_clear(ae);
@@ -549,8 +549,8 @@ test_older_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        /* Verify 'new' file. */
        archive_entry_clear(ae);
@@ -558,8 +558,8 @@ test_older_than_file_wcs(void)
        assertEqualIntA(a, ARCHIVE_OK,
            archive_read_disk_entry_from_file(a, ae, -1, NULL));
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        assertChdir("..");
        /* Clean up. */
@@ -579,58 +579,58 @@ excluded(struct archive *m)
        archive_entry_copy_pathname(ae, "file1");
        archive_entry_set_mtime(ae, 7879, 999);
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_set_mtime(ae, 7880, 0);
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_set_mtime(ae, 7880, 1);
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        archive_entry_copy_pathname(ae, "file2");
        archive_entry_set_mtime(ae, 7879, 999);
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_set_mtime(ae, 7880, 0);
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_set_mtime(ae, 7880, 1);
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
        archive_entry_copy_pathname(ae, "file3");
        archive_entry_set_mtime(ae, 7879, 999);
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_set_mtime(ae, 7880, 0);
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
        archive_entry_set_mtime(ae, 7880, 1);
        failure("It should be excluded");
-       assertEqualInt(1, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(1, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(1, archive_matching_time_excluded(m, ae));
+       assertEqualInt(1, archive_matching_excluded(m, ae));
 
        archive_entry_copy_pathname(ae, "file4");
        archive_entry_set_mtime(ae, 7879, 999);
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_set_mtime(ae, 7880, 0);
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
        archive_entry_set_mtime(ae, 7880, 1);
        failure("It should not be excluded");
-       assertEqualInt(0, archive_matching_time_excluded_ae(m, ae));
-       assertEqualInt(0, archive_matching_excluded_ae(m, ae));
+       assertEqualInt(0, archive_matching_time_excluded(m, ae));
+       assertEqualInt(0, archive_matching_excluded(m, ae));
 
 
        /* Clean up. */
index 90d8a8f2eef163e93f96bfd9c39670bab7b6b2e8..f103de53afc40c4966db05b51fe989a1e2520bdd 100644 (file)
@@ -236,12 +236,6 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
                if (bsdtar->gname)
                        archive_entry_set_gname(entry, bsdtar->gname);
 
-               /*
-                * Exclude entries that are too old.
-                */
-               if (archive_matching_time_excluded_ae(bsdtar->matching, entry))
-                       continue; /* skip it. */
-
                /*
                 * Note that pattern exclusions are checked before
                 * pathname rewrites are handled.  This gives more
@@ -251,8 +245,7 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
                 * rewrite, there would be no way to exclude foo1/bar
                 * while allowing foo2/bar.)
                 */
-               if (archive_matching_path_excluded_ae(bsdtar->matching,
-                   entry))
+               if (archive_matching_excluded(bsdtar->matching, entry))
                        continue; /* Excluded by a pattern test. */
 
                if (mode == 't') {
index 817d5a4be5e1ae972160c933abe71935197fe1ba..cb5e8f16095e8fa396190d0a3d4e7379e6f453f2 100644 (file)
@@ -591,11 +591,7 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina)
        int e;
 
        while (ARCHIVE_OK == (e = archive_read_next_header(ina, &in_entry))) {
-               if (archive_matching_time_excluded_ae(bsdtar->matching,
-                   in_entry))
-                       continue;
-               if (archive_matching_path_excluded_ae(bsdtar->matching,
-                   in_entry))
+               if (archive_matching_excluded(bsdtar->matching, in_entry))
                        continue;
                if (bsdtar->option_interactive &&
                    !yes("copy '%s'", archive_entry_pathname(in_entry)))