diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-03-12 04:58:32 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-03-12 04:58:32 +0000 |
commit | 84e4492c0b7972744b0b215a731c3cf8da95cc20 (patch) | |
tree | 9b5b86e2775b7558fbef9fa66ea4ca36a3cf61df /lib | |
parent | 9f91e7f3cf1ce14deeef1879546880d239c89fb9 (diff) | |
download | FreeBSD-src-84e4492c0b7972744b0b215a731c3cf8da95cc20.zip FreeBSD-src-84e4492c0b7972744b0b215a731c3cf8da95cc20.tar.gz |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libarchive/archive_read.c | 15 | ||||
-rw-r--r-- | lib/libarchive/archive_read_private.h | 37 |
2 files changed, 0 insertions, 52 deletions
diff --git a/lib/libarchive/archive_read.c b/lib/libarchive/archive_read.c index 1028c5d..259fd7c 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 da9cfb5..41b62e1 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; |