summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive.h.in
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2006-11-24 02:00:48 +0000
committerkientzle <kientzle@FreeBSD.org>2006-11-24 02:00:48 +0000
commit7d9bedda5f3fc686498476685785118426cc9b5c (patch)
tree1718edba490b96d4478714d3358a3b2dfc19fda7 /lib/libarchive/archive.h.in
parentcceb584eb3c30510c29dc942777634c05bbd9434 (diff)
downloadFreeBSD-src-7d9bedda5f3fc686498476685785118426cc9b5c.zip
FreeBSD-src-7d9bedda5f3fc686498476685785118426cc9b5c.tar.gz
New hooks for reading/writing archives to/from a FILE * or
an in-memory buffer. PR: bin/86742
Diffstat (limited to 'lib/libarchive/archive.h.in')
-rw-r--r--lib/libarchive/archive.h.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/libarchive/archive.h.in b/lib/libarchive/archive.h.in
index 1deced1..4567de7 100644
--- a/lib/libarchive/archive.h.in
+++ b/lib/libarchive/archive.h.in
@@ -37,6 +37,7 @@
#include <sys/types.h> /* Linux requires this for off_t */
@ARCHIVE_H_INCLUDE_INTTYPES_H@
+#include <stdio.h> /* For FILE * */
#include <unistd.h> /* For ssize_t and size_t */
#ifdef __cplusplus
@@ -58,6 +59,7 @@ extern "C" {
*
* 1 - Version tests are available.
* 2 - archive_{read,write}_close available separately from _finish.
+ * 3 - open_memory, open_memory2, open_FILE, open_fd available
*/
#define ARCHIVE_API_VERSION @ARCHIVE_API_MAJOR@
int archive_api_version(void);
@@ -206,9 +208,18 @@ int archive_read_open_filename(struct archive *,
/* 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 stored in memory. */
+int archive_read_open_memory(struct archive *,
+ void * buff, size_t size);
+/* A more involved version that is only used for internal testing. */
+int archive_read_open_memory2(struct archive *a, void *buff,
+ size_t size, size_t read_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);
+/* Read an archive that's already open, using a FILE *. */
+/* Note: DO NOT use this with tape drives. */
+int archive_read_open_FILE(struct archive *, FILE *_file);
/* Parses and returns next entry header. */
int archive_read_next_header(struct archive *,
@@ -333,6 +344,11 @@ 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);
+int archive_write_open_FILE(struct archive *, FILE *);
+/* _buffSize is the size of the buffer, _used refers to a variable that
+ * will be updated after each write into the buffer. */
+int archive_write_open_memory(struct archive *,
+ void *_buffer, size_t _buffSize, size_t *_used);
/*
* Note that the library will truncate writes beyond the size provided
OpenPOWER on IntegriCloud