aboutsummaryrefslogtreecommitdiff
path: root/lib/libarchive/archive_entry.h
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2007-12-30 04:58:22 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2007-12-30 04:58:22 +0000
commit9dd49f960f9b30644843e2f2b41bc1579d0aeba3 (patch)
tree743c28601a2502c30676ab2adfbbb665fa3f38b7 /lib/libarchive/archive_entry.h
parent79386ec7dbd8944a323eb6f31d6de310be74a09c (diff)
Update libarchive to 2.4.10. This includes a number of improvements
that I've been working on but put off committing until after the RELENG_7 branch, including: * New manpages: cpio.5 mtree.5 * New archive_entry_strmode() * New archive_entry_link_resolver() * New read support: mtree format * Internal API change: read format auction only runs once * Running the auction only once allowed simplifying a lot of bid logic. * Cpio robustness: search for next header after a sync error * Support device nodes on ISO9660 images * Eliminate a lot of unnecessary copies for uncompressed archives * Corrected handling of new GNU --sparse --posix formats * Correctly handle a zero-byte write to a compressed archive * Fixed memory leaks Many of these improvements were motivated by the upcoming bsdcpio front-end. There have also been extensive improvements to the libarchive_test test harness, which I'll commit separately.
Notes
Notes: svn path=/head/; revision=174991
Diffstat (limited to 'lib/libarchive/archive_entry.h')
-rw-r--r--lib/libarchive/archive_entry.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/lib/libarchive/archive_entry.h b/lib/libarchive/archive_entry.h
index 2f18d31cac47..173fbc30474e 100644
--- a/lib/libarchive/archive_entry.h
+++ b/lib/libarchive/archive_entry.h
@@ -62,6 +62,7 @@ struct archive_entry;
#define AE_IFMT 0170000
#define AE_IFREG 0100000
#define AE_IFLNK 0120000
+#define AE_IFSOCK 0140000
#define AE_IFCHR 0020000
#define AE_IFBLK 0060000
#define AE_IFDIR 0040000
@@ -108,6 +109,7 @@ dev_t archive_entry_rdev(struct archive_entry *);
dev_t archive_entry_rdevmajor(struct archive_entry *);
dev_t archive_entry_rdevminor(struct archive_entry *);
int64_t archive_entry_size(struct archive_entry *);
+const char *archive_entry_strmode(struct archive_entry *);
const char *archive_entry_symlink(struct archive_entry *);
const wchar_t *archive_entry_symlink_w(struct archive_entry *);
uid_t archive_entry_uid(struct archive_entry *);
@@ -148,6 +150,7 @@ void archive_entry_set_nlink(struct archive_entry *, unsigned int);
void archive_entry_set_pathname(struct archive_entry *, const char *);
void archive_entry_copy_pathname(struct archive_entry *, const char *);
void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *);
+void archive_entry_set_perm(struct archive_entry *, mode_t);
void archive_entry_set_rdev(struct archive_entry *, dev_t);
void archive_entry_set_rdevmajor(struct archive_entry *, dev_t);
void archive_entry_set_rdevminor(struct archive_entry *, dev_t);
@@ -260,11 +263,6 @@ int archive_entry_acl_count(struct archive_entry *, int want_type);
int __archive_entry_acl_parse_w(struct archive_entry *,
const wchar_t *, int type);
-
-#ifdef __cplusplus
-}
-#endif
-
/*
* extended attributes
*/
@@ -283,5 +281,32 @@ int archive_entry_xattr_reset(struct archive_entry *);
int archive_entry_xattr_next(struct archive_entry *,
const char **name, const void **value, size_t *);
+/*
+ * Utility to detect hardlinks.
+ *
+ * The 'struct archive_hardlink_lookup' is a cache of entry
+ * names and dev/ino numbers. Here's how to use it:
+ * 1. Create a lookup object with archive_hardlink_lookup_new()
+ * 2. Hand each archive_entry to archive_hardlink_lookup().
+ * That function will return NULL (this is not a hardlink to
+ * a previous entry) or the pathname of the first entry
+ * that matched this.
+ * 3. Use archive_hardlink_lookup_free() to release the cache.
+ *
+ * To make things more efficient, be sure that each entry has a valid
+ * nlinks value. The hardlink cache uses this to track when all links
+ * have been found. If the nlinks value is zero, it will keep every
+ * name in the cache indefinitely, which can use a lot of memory.
+ */
+struct archive_entry_linkresolver;
+
+struct archive_entry_linkresolver *archive_entry_linkresolver_new(void);
+void archive_entry_linkresolver_free(struct archive_entry_linkresolver *);
+const char *archive_entry_linkresolve(struct archive_entry_linkresolver *,
+ struct archive_entry *);
+
+#ifdef __cplusplus
+}
+#endif
#endif /* !ARCHIVE_ENTRY_H_INCLUDED */