summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive.h
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2009-03-06 04:35:31 +0000
committerkientzle <kientzle@FreeBSD.org>2009-03-06 04:35:31 +0000
commit559aad6489401705ac2b4f98ca4fbe15b69908e4 (patch)
treec9abbe9ea68430b84ff0e6251236b3beecbdd56a /lib/libarchive/archive.h
parentfd6ac6664361e245c8710149513f9af43754e513 (diff)
downloadFreeBSD-src-559aad6489401705ac2b4f98ca4fbe15b69908e4.zip
FreeBSD-src-559aad6489401705ac2b4f98ca4fbe15b69908e4.tar.gz
Merge r399,401,402,405,415,430,440,452,453,458,506,533,536,538,544,590
from libarchive.googlecode.com: Add a new "archive_read_disk" API that provides the important service of reading metadata from the disk. In particular, this will make it possible to remove all knowledge of extended attributes, ACLs, etc, from clients such as bsdtar and bsdcpio. Closely related, this API also provides pluggable uid->uname and gid->gname lookup and caching services similar to the uname->uid and gname->gid services provided by archive_write_disk. Remember this is also required for correct ACL management. Documentation is still pending...
Diffstat (limited to 'lib/libarchive/archive.h')
-rw-r--r--lib/libarchive/archive.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/libarchive/archive.h b/lib/libarchive/archive.h
index 09e0c4a..72bd8a0 100644
--- a/lib/libarchive/archive.h
+++ b/lib/libarchive/archive.h
@@ -36,6 +36,7 @@
* platform macros.
*/
+#include <sys/stat.h>
#include <sys/types.h> /* Linux requires this for off_t */
#if !defined(__WATCOMC__) && !defined(_MSC_VER)
/* Header unavailable on Watcom C or MS Visual C++. */
@@ -605,6 +606,40 @@ __LA_DECL int archive_write_disk_set_user_lookup(struct archive *,
void (* /* cleanup */)(void *));
/*
+ * ARCHIVE_READ_DISK API
+ *
+ * This is still evolving and somewhat experimental.
+ */
+__LA_DECL struct archive *archive_read_disk_new(void);
+/* The names for symlink modes here correspond to an old BSD
+ * command-line argument convention: -L, -P, -H */
+/* Follow all symlinks. */
+__LA_DECL int archive_read_disk_set_symlink_logical(struct archive *);
+/* Follow no symlinks. */
+__LA_DECL int archive_read_disk_set_symlink_physical(struct archive *);
+/* Follow symlink initially, then not. */
+__LA_DECL int archive_read_disk_set_symlink_hybrid(struct archive *);
+/* TODO: Handle Linux stat32/stat64 ugliness. <sigh> */
+__LA_DECL int archive_read_disk_entry_from_file(struct archive *,
+ struct archive_entry *, int /* fd */, const struct stat *);
+/* Look up gname for gid or uname for uid. */
+/* Default implementations are very, very stupid. */
+__LA_DECL const char *archive_read_disk_gname(struct archive *, __LA_GID_T);
+__LA_DECL const char *archive_read_disk_uname(struct archive *, __LA_UID_T);
+/* "Standard" implementation uses getpwuid_r, getgrgid_r and caches the
+ * results for performance. */
+__LA_DECL int archive_read_disk_set_standard_lookup(struct archive *);
+/* You can install your own lookups if you like. */
+__LA_DECL int archive_read_disk_set_gname_lookup(struct archive *,
+ void * /* private_data */,
+ const char *(* /* lookup_fn */)(void *, __LA_GID_T),
+ void (* /* cleanup_fn */)(void *));
+__LA_DECL int archive_read_disk_set_uname_lookup(struct archive *,
+ void * /* private_data */,
+ const char *(* /* lookup_fn */)(void *, __LA_UID_T),
+ void (* /* cleanup_fn */)(void *));
+
+/*
* Accessor functions to read/set various information in
* the struct archive object:
*/
OpenPOWER on IntegriCloud