aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2008-03-15 11:04:45 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2008-03-15 11:04:45 +0000
commit0b315cd9ae430c8d1a1ea1af6b1548ebb116891c (patch)
tree7be5eb8b35baa3907c7b49e38c58aafb5bc3c194 /lib
parentc43d294189a0dcbe6370c3ab9ed621fdf68f576d (diff)
downloadsrc-0b315cd9ae430c8d1a1ea1af6b1548ebb116891c.tar.gz
src-0b315cd9ae430c8d1a1ea1af6b1548ebb116891c.zip
Remove the duplicate "archive_format" and "archive_format_name" fields
from the private archive_write structure and fix up all writers to use the format fields in the base "archive" structure. This error made it impossible to query the format after setting up a writer because the write format was stored in an inaccessible place.
Notes
Notes: svn path=/head/; revision=177220
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_write_private.h7
-rw-r--r--lib/libarchive/archive_write_set_format_ar.c12
-rw-r--r--lib/libarchive/archive_write_set_format_cpio.c4
-rw-r--r--lib/libarchive/archive_write_set_format_cpio_newc.c4
-rw-r--r--lib/libarchive/archive_write_set_format_pax.c12
-rw-r--r--lib/libarchive/archive_write_set_format_shar.c8
-rw-r--r--lib/libarchive/archive_write_set_format_ustar.c4
7 files changed, 22 insertions, 29 deletions
diff --git a/lib/libarchive/archive_write_private.h b/lib/libarchive/archive_write_private.h
index 7764fdd9b4d9..8deabbf0e0e3 100644
--- a/lib/libarchive/archive_write_private.h
+++ b/lib/libarchive/archive_write_private.h
@@ -82,13 +82,6 @@ struct archive_write {
} compressor;
/*
- * Again, write support is considerably simpler because there's
- * no need for an auction.
- */
- int archive_format;
- const char *archive_format_name;
-
- /*
* Pointers to format-specific functions for writing. They're
* initialized by archive_write_set_format_XXX() calls.
*/
diff --git a/lib/libarchive/archive_write_set_format_ar.c b/lib/libarchive/archive_write_set_format_ar.c
index 6a223c3ae787..3473c46e9667 100644
--- a/lib/libarchive/archive_write_set_format_ar.c
+++ b/lib/libarchive/archive_write_set_format_ar.c
@@ -87,8 +87,8 @@ archive_write_set_format_ar_bsd(struct archive *_a)
struct archive_write *a = (struct archive_write *)_a;
int r = archive_write_set_format_ar(a);
if (r == ARCHIVE_OK) {
- a->archive_format = ARCHIVE_FORMAT_AR_BSD;
- a->archive_format_name = "ar (BSD)";
+ a->archive.archive_format = ARCHIVE_FORMAT_AR_BSD;
+ a->archive.archive_format_name = "ar (BSD)";
}
return (r);
}
@@ -99,8 +99,8 @@ archive_write_set_format_ar_svr4(struct archive *_a)
struct archive_write *a = (struct archive_write *)_a;
int r = archive_write_set_format_ar(a);
if (r == ARCHIVE_OK) {
- a->archive_format = ARCHIVE_FORMAT_AR_GNU;
- a->archive_format_name = "ar (GNU/SVR4)";
+ a->archive.archive_format = ARCHIVE_FORMAT_AR_GNU;
+ a->archive.archive_format_name = "ar (GNU/SVR4)";
}
return (r);
}
@@ -204,7 +204,7 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry)
return (ARCHIVE_WARN);
}
- if (a->archive_format == ARCHIVE_FORMAT_AR_GNU) {
+ if (a->archive.archive_format == ARCHIVE_FORMAT_AR_GNU) {
/*
* SVR4/GNU variant use a "/" to mark then end of the filename,
* make it possible to have embedded spaces in the filename.
@@ -261,7 +261,7 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry)
return (ARCHIVE_WARN);
}
}
- } else if (a->archive_format == ARCHIVE_FORMAT_AR_BSD) {
+ } else if (a->archive.archive_format == ARCHIVE_FORMAT_AR_BSD) {
/*
* BSD variant: for any file name which is more than
* 16 chars or contains one or more embedded space(s), the
diff --git a/lib/libarchive/archive_write_set_format_cpio.c b/lib/libarchive/archive_write_set_format_cpio.c
index 631830e99cf8..c500e52913ad 100644
--- a/lib/libarchive/archive_write_set_format_cpio.c
+++ b/lib/libarchive/archive_write_set_format_cpio.c
@@ -97,8 +97,8 @@ archive_write_set_format_cpio(struct archive *_a)
a->format_finish_entry = archive_write_cpio_finish_entry;
a->format_finish = archive_write_cpio_finish;
a->format_destroy = archive_write_cpio_destroy;
- a->archive_format = ARCHIVE_FORMAT_CPIO_POSIX;
- a->archive_format_name = "POSIX cpio";
+ a->archive.archive_format = ARCHIVE_FORMAT_CPIO_POSIX;
+ a->archive.archive_format_name = "POSIX cpio";
return (ARCHIVE_OK);
}
diff --git a/lib/libarchive/archive_write_set_format_cpio_newc.c b/lib/libarchive/archive_write_set_format_cpio_newc.c
index 6580b52faa34..f9d89e5c25d6 100644
--- a/lib/libarchive/archive_write_set_format_cpio_newc.c
+++ b/lib/libarchive/archive_write_set_format_cpio_newc.c
@@ -102,8 +102,8 @@ archive_write_set_format_cpio_newc(struct archive *_a)
a->format_finish_entry = archive_write_newc_finish_entry;
a->format_finish = archive_write_newc_finish;
a->format_destroy = archive_write_newc_destroy;
- a->archive_format = ARCHIVE_FORMAT_CPIO_SVR4_NOCRC;
- a->archive_format_name = "SVR4 cpio nocrc";
+ a->archive.archive_format = ARCHIVE_FORMAT_CPIO_SVR4_NOCRC;
+ a->archive.archive_format_name = "SVR4 cpio nocrc";
return (ARCHIVE_OK);
}
diff --git a/lib/libarchive/archive_write_set_format_pax.c b/lib/libarchive/archive_write_set_format_pax.c
index 3004e76658e7..6f05a99292ad 100644
--- a/lib/libarchive/archive_write_set_format_pax.c
+++ b/lib/libarchive/archive_write_set_format_pax.c
@@ -85,8 +85,8 @@ archive_write_set_format_pax_restricted(struct archive *_a)
struct archive_write *a = (struct archive_write *)_a;
int r;
r = archive_write_set_format_pax(&a->archive);
- a->archive_format = ARCHIVE_FORMAT_TAR_PAX_RESTRICTED;
- a->archive_format_name = "restricted POSIX pax interchange";
+ a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_RESTRICTED;
+ a->archive.archive_format_name = "restricted POSIX pax interchange";
return (r);
}
@@ -116,8 +116,8 @@ archive_write_set_format_pax(struct archive *_a)
a->format_finish = archive_write_pax_finish;
a->format_destroy = archive_write_pax_destroy;
a->format_finish_entry = archive_write_pax_finish_entry;
- a->archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
- a->archive_format_name = "POSIX pax interchange";
+ a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
+ a->archive.archive_format_name = "POSIX pax interchange";
return (ARCHIVE_OK);
}
@@ -701,7 +701,7 @@ archive_write_pax_header(struct archive_write *a,
* already set (we're already generating an extended header, so
* may as well include these).
*/
- if (a->archive_format != ARCHIVE_FORMAT_TAR_PAX_RESTRICTED ||
+ if (a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_RESTRICTED ||
need_extension) {
if (archive_entry_mtime(entry_main) < 0 ||
@@ -764,7 +764,7 @@ archive_write_pax_header(struct archive_write *a,
* Pax-restricted does not store data for hardlinks, in order
* to improve compatibility with ustar.
*/
- if (a->archive_format != ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE &&
+ if (a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE &&
hardlink != NULL)
archive_entry_set_size(entry_main, 0);
diff --git a/lib/libarchive/archive_write_set_format_shar.c b/lib/libarchive/archive_write_set_format_shar.c
index f832ec2a8b4f..a7f2d8f468bf 100644
--- a/lib/libarchive/archive_write_set_format_shar.c
+++ b/lib/libarchive/archive_write_set_format_shar.c
@@ -113,8 +113,8 @@ archive_write_set_format_shar(struct archive *_a)
a->format_destroy = archive_write_shar_destroy;
a->format_write_data = archive_write_shar_data_sed;
a->format_finish_entry = archive_write_shar_finish_entry;
- a->archive_format = ARCHIVE_FORMAT_SHAR_BASE;
- a->archive_format_name = "shar";
+ a->archive.archive_format = ARCHIVE_FORMAT_SHAR_BASE;
+ a->archive.archive_format_name = "shar";
return (ARCHIVE_OK);
}
@@ -134,8 +134,8 @@ archive_write_set_format_shar_dump(struct archive *_a)
shar = (struct shar *)a->format_data;
shar->dump = 1;
a->format_write_data = archive_write_shar_data_uuencode;
- a->archive_format = ARCHIVE_FORMAT_SHAR_DUMP;
- a->archive_format_name = "shar dump";
+ a->archive.archive_format = ARCHIVE_FORMAT_SHAR_DUMP;
+ a->archive.archive_format_name = "shar dump";
return (ARCHIVE_OK);
}
diff --git a/lib/libarchive/archive_write_set_format_ustar.c b/lib/libarchive/archive_write_set_format_ustar.c
index 43b654345305..2693f147b02f 100644
--- a/lib/libarchive/archive_write_set_format_ustar.c
+++ b/lib/libarchive/archive_write_set_format_ustar.c
@@ -186,8 +186,8 @@ archive_write_set_format_ustar(struct archive *_a)
a->format_finish = archive_write_ustar_finish;
a->format_destroy = archive_write_ustar_destroy;
a->format_finish_entry = archive_write_ustar_finish_entry;
- a->archive_format = ARCHIVE_FORMAT_TAR_USTAR;
- a->archive_format_name = "POSIX ustar";
+ a->archive.archive_format = ARCHIVE_FORMAT_TAR_USTAR;
+ a->archive.archive_format_name = "POSIX ustar";
return (ARCHIVE_OK);
}