diff options
author | kientzle <kientzle@FreeBSD.org> | 2006-11-15 05:33:38 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2006-11-15 05:33:38 +0000 |
commit | 62b3d9e35c851e5bc9c48c2ac5c0bd49a6e7c362 (patch) | |
tree | 7a34e7de615a290b3784a7e22f8ba27b20ce0888 | |
parent | 8f03f2f27b2a8b3a0fee0018d878be4918bf193c (diff) | |
download | FreeBSD-src-62b3d9e35c851e5bc9c48c2ac5c0bd49a6e7c362.zip FreeBSD-src-62b3d9e35c851e5bc9c48c2ac5c0bd49a6e7c362.tar.gz |
Add archive_write_open_filename()/archive_read_open_filename() as
synonyms for archive_write_open_file()/archive_read_open_file().
The new names are much clearer.
-rw-r--r-- | lib/libarchive/archive.h.in | 21 | ||||
-rw-r--r-- | lib/libarchive/archive_read_open_file.c | 7 | ||||
-rw-r--r-- | lib/libarchive/archive_read_open_filename.c | 7 | ||||
-rw-r--r-- | lib/libarchive/archive_write_open_file.c | 6 | ||||
-rw-r--r-- | lib/libarchive/archive_write_open_filename.c | 6 |
5 files changed, 40 insertions, 7 deletions
diff --git a/lib/libarchive/archive.h.in b/lib/libarchive/archive.h.in index 4603f44..1deced1 100644 --- a/lib/libarchive/archive.h.in +++ b/lib/libarchive/archive.h.in @@ -46,8 +46,8 @@ extern "C" { /* * If ARCHIVE_API_VERSION != archive_api_version(), then the library you - * were linked with is using an incompatible API. This is almost - * certainly a fatal problem. + * were linked with is using an incompatible API to the one you were + * compiled with. This is almost certainly a fatal problem. * * ARCHIVE_API_FEATURE is incremented with each significant feature * addition, so you can test (at compile or run time) if a particular @@ -196,12 +196,17 @@ int archive_read_open2(struct archive *, void *_client_data, archive_skip_callback *, archive_close_callback *); /* - * The archive_read_open_file function is a convenience function built - * on archive_read_open that uses a canned callback suitable for - * common situations. Note that a NULL filename indicates stdin. + * A variety of shortcuts that invoke archive_read_open() with + * canned callbacks suitable for common situations. The ones that + * accept a block size handle tape blocking correctly. */ -int archive_read_open_file(struct archive *, const char *_file, - size_t _block_size); +/* Use this if you know the filename. Note: NULL indicates stdin. */ +int archive_read_open_filename(struct archive *, + const char *_filename, size_t _block_size); +/* archive_read_open_file() is a deprecated synonym for ..._open_filename(). */ +int archive_read_open_file(struct archive *, + const char *_filename, size_t _block_size); +/* Read an archive that's already open, using the file descriptor. */ int archive_read_open_fd(struct archive *, int _fd, size_t _block_size); @@ -325,6 +330,8 @@ int archive_write_open(struct archive *, void *, archive_open_callback *, archive_write_callback *, archive_close_callback *); int archive_write_open_fd(struct archive *, int _fd); +int archive_write_open_filename(struct archive *, const char *_file); +/* A deprecated synonym for archive_write_open_filename() */ int archive_write_open_file(struct archive *, const char *_file); /* diff --git a/lib/libarchive/archive_read_open_file.c b/lib/libarchive/archive_read_open_file.c index 8d0ea2c..cefc286 100644 --- a/lib/libarchive/archive_read_open_file.c +++ b/lib/libarchive/archive_read_open_file.c @@ -65,6 +65,13 @@ int archive_read_open_file(struct archive *a, const char *filename, size_t block_size) { + return (archive_read_open_filename(a, filename, block_size)); +} + +int +archive_read_open_filename(struct archive *a, const char *filename, + size_t block_size) +{ struct read_file_data *mine; if (filename == NULL || filename[0] == '\0') { diff --git a/lib/libarchive/archive_read_open_filename.c b/lib/libarchive/archive_read_open_filename.c index 8d0ea2c..cefc286 100644 --- a/lib/libarchive/archive_read_open_filename.c +++ b/lib/libarchive/archive_read_open_filename.c @@ -65,6 +65,13 @@ int archive_read_open_file(struct archive *a, const char *filename, size_t block_size) { + return (archive_read_open_filename(a, filename, block_size)); +} + +int +archive_read_open_filename(struct archive *a, const char *filename, + size_t block_size) +{ struct read_file_data *mine; if (filename == NULL || filename[0] == '\0') { diff --git a/lib/libarchive/archive_write_open_file.c b/lib/libarchive/archive_write_open_file.c index c51bd77..c37caeb 100644 --- a/lib/libarchive/archive_write_open_file.c +++ b/lib/libarchive/archive_write_open_file.c @@ -60,6 +60,12 @@ static ssize_t file_write(struct archive *, void *, void *buff, size_t); int archive_write_open_file(struct archive *a, const char *filename) { + return (archive_write_open_filename(a, filename)); +} + +int +archive_write_open_filename(struct archive *a, const char *filename) +{ struct write_file_data *mine; if (filename == NULL || filename[0] == '\0') { diff --git a/lib/libarchive/archive_write_open_filename.c b/lib/libarchive/archive_write_open_filename.c index c51bd77..c37caeb 100644 --- a/lib/libarchive/archive_write_open_filename.c +++ b/lib/libarchive/archive_write_open_filename.c @@ -60,6 +60,12 @@ static ssize_t file_write(struct archive *, void *, void *buff, size_t); int archive_write_open_file(struct archive *a, const char *filename) { + return (archive_write_open_filename(a, filename)); +} + +int +archive_write_open_filename(struct archive *a, const char *filename) +{ struct write_file_data *mine; if (filename == NULL || filename[0] == '\0') { |