aboutsummaryrefslogtreecommitdiff
path: root/lib/libarchive
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2008-03-12 04:58:32 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2008-03-12 04:58:32 +0000
commit0b4793efb7311d8a13354b710f7544d035fe537b (patch)
tree9b5b86e2775b7558fbef9fa66ea4ca36a3cf61df /lib/libarchive
parentc2247d3995ca8f3448c1e7fb1747f92055f1ff3d (diff)
downloadsrc-0b4793efb7311d8a13354b710f7544d035fe537b.tar.gz
src-0b4793efb7311d8a13354b710f7544d035fe537b.zip
Remove some unused fields from the private archive_read structure
(left over from when the unified read/write structure was copied to form separate read and write structures) and eliminate the pointless initialization of a couple of the unused fields.
Notes
Notes: svn path=/head/; revision=177082
Diffstat (limited to 'lib/libarchive')
-rw-r--r--lib/libarchive/archive_read.c15
-rw-r--r--lib/libarchive/archive_read_private.h37
2 files changed, 0 insertions, 52 deletions
diff --git a/lib/libarchive/archive_read.c b/lib/libarchive/archive_read.c
index 1028c5dc9b20..259fd7c8f2a8 100644
--- a/lib/libarchive/archive_read.c
+++ b/lib/libarchive/archive_read.c
@@ -64,25 +64,12 @@ struct archive *
archive_read_new(void)
{
struct archive_read *a;
- unsigned char *nulls;
a = (struct archive_read *)malloc(sizeof(*a));
if (a == NULL)
return (NULL);
memset(a, 0, sizeof(*a));
a->archive.magic = ARCHIVE_READ_MAGIC;
- a->bytes_per_block = ARCHIVE_DEFAULT_BYTES_PER_BLOCK;
-
- a->null_length = 1024;
- nulls = (unsigned char *)malloc(a->null_length);
- if (nulls == NULL) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate archive object 'nulls' element");
- free(a);
- return (NULL);
- }
- memset(nulls, 0, a->null_length);
- a->nulls = nulls;
a->archive.state = ARCHIVE_STATE_NEW;
a->entry = archive_entry_new();
@@ -660,8 +647,6 @@ archive_read_finish(struct archive *_a)
(a->formats[i].cleanup)(a);
}
- /* Casting a pointer to int allows us to remove 'const.' */
- free((void *)(uintptr_t)(const void *)a->nulls);
archive_string_free(&a->archive.error_string);
if (a->entry)
archive_entry_free(a->entry);
diff --git a/lib/libarchive/archive_read_private.h b/lib/libarchive/archive_read_private.h
index da9cfb544b64..41b62e1f8124 100644
--- a/lib/libarchive/archive_read_private.h
+++ b/lib/libarchive/archive_read_private.h
@@ -41,10 +41,6 @@ struct archive_read {
dev_t skip_file_dev;
ino_t skip_file_ino;
- /* Utility: Pointer to a block of nulls. */
- const unsigned char *nulls;
- size_t null_length;
-
/*
* Used by archive_read_data() to track blocks and copy
* data to client buffers, filling gaps with zero bytes.
@@ -58,30 +54,9 @@ struct archive_read {
archive_open_callback *client_opener;
archive_read_callback *client_reader;
archive_skip_callback *client_skipper;
- archive_write_callback *client_writer;
archive_close_callback *client_closer;
void *client_data;
- /*
- * Blocking information. Note that bytes_in_last_block is
- * misleadingly named; I should find a better name. These
- * control the final output from all compressors, including
- * compression_none.
- */
- int bytes_per_block;
- int bytes_in_last_block;
-
- /*
- * These control whether data within a gzip/bzip2 compressed
- * stream gets padded or not. If pad_uncompressed is set,
- * the data will be padded to a full block before being
- * compressed. The pad_uncompressed_byte determines the value
- * that will be used for padding. Note that these have no
- * effect on compression "none."
- */
- int pad_uncompressed;
- int pad_uncompressed_byte; /* TODO: Support this. */
-
/* File offset of beginning of most recently-read header. */
off_t header_position;
@@ -142,18 +117,6 @@ struct archive_read {
struct archive_format_descriptor *format; /* Active format. */
/*
- * Pointers to format-specific functions for writing. They're
- * initialized by archive_write_set_format_XXX() calls.
- */
- int (*format_init)(struct archive *); /* Only used on write. */
- int (*format_finish)(struct archive *);
- int (*format_finish_entry)(struct archive *);
- int (*format_write_header)(struct archive *,
- struct archive_entry *);
- ssize_t (*format_write_data)(struct archive *,
- const void *buff, size_t);
-
- /*
* Various information needed by archive_extract.
*/
struct extract *extract;