diff options
author | kientzle <kientzle@FreeBSD.org> | 2007-05-29 01:00:21 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2007-05-29 01:00:21 +0000 |
commit | 013be331bc10706807599a452a143f4744398e9f (patch) | |
tree | 793787ab8615d768ba51341dfd934a5fb3039728 /lib/libarchive/archive_entry.h | |
parent | c611006e893ac2bf962cabe02743954e3b3c3314 (diff) | |
download | FreeBSD-src-013be331bc10706807599a452a143f4744398e9f.zip FreeBSD-src-013be331bc10706807599a452a143f4744398e9f.tar.gz |
libarchive 2.2.3
* "compression_program" support uses an external program
* Portability: no longer uses "struct stat" as a primary
data interchange structure internally
* Part of the above: refactor archive_entry to separate
out copy_stat() and stat() functions
* More complete tests for archive_entry
* Finish archive_entry_clone()
* Isolate major()/minor()/makedev() in archive_entry; remove
these from everywhere else.
* Bug fix: properly handle decompression look-ahead at end-of-data
* Bug fixes to 'ar' support
* Fix memory leak in ZIP reader
* Portability: better timegm() emulation in iso9660 reader
* New write_disk flags to suppress auto dir creation and not
overwrite newer files (for future cpio front-end)
* Simplify trailing-'/' fixup when writing tar and pax
* Test enhancements: fix various compiler warnings, improve
portability, add lots of new tests.
* Documentation: document new functions, first draft of
libarchive_internals.3
MFC after: 14 days
Thanks to: Joerg Sonnenberger (compression_program)
Thanks to: Kai Wang (ar)
Thanks to: Colin Percival (many small fixes)
Thanks to: Many others who sent me various patches and problem reports.
Diffstat (limited to 'lib/libarchive/archive_entry.h')
-rw-r--r-- | lib/libarchive/archive_entry.h | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/lib/libarchive/archive_entry.h b/lib/libarchive/archive_entry.h index 2604f86..043ddcf 100644 --- a/lib/libarchive/archive_entry.h +++ b/lib/libarchive/archive_entry.h @@ -28,7 +28,9 @@ #ifndef ARCHIVE_ENTRY_H_INCLUDED #define ARCHIVE_ENTRY_H_INCLUDED +#include <sys/types.h> #include <stddef.h> /* for wchar_t */ +#include <time.h> #include <unistd.h> #ifdef __cplusplus @@ -55,6 +57,17 @@ extern "C" { struct archive_entry; /* + * File-type constants. These are returned from archive_entry_filetype(). + */ +#define AE_IFMT 0170000 +#define AE_IFREG 0100000 +#define AE_IFLNK 0120000 +#define AE_IFCHR 0020000 +#define AE_IFBLK 0060000 +#define AE_IFDIR 0040000 +#define AE_IFIFO 0010000 + +/* * Basic object manipulation */ @@ -73,6 +86,9 @@ long archive_entry_atime_nsec(struct archive_entry *); time_t archive_entry_ctime(struct archive_entry *); long archive_entry_ctime_nsec(struct archive_entry *); dev_t archive_entry_dev(struct archive_entry *); +dev_t archive_entry_devmajor(struct archive_entry *); +dev_t archive_entry_devminor(struct archive_entry *); +mode_t archive_entry_filetype(struct archive_entry *); void archive_entry_fflags(struct archive_entry *, unsigned long *set, unsigned long *clear); const char *archive_entry_fflags_text(struct archive_entry *); @@ -85,13 +101,13 @@ ino_t archive_entry_ino(struct archive_entry *); mode_t archive_entry_mode(struct archive_entry *); time_t archive_entry_mtime(struct archive_entry *); long archive_entry_mtime_nsec(struct archive_entry *); +unsigned int archive_entry_nlink(struct archive_entry *); const char *archive_entry_pathname(struct archive_entry *); const wchar_t *archive_entry_pathname_w(struct archive_entry *); 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 struct stat *archive_entry_stat(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 *); @@ -105,9 +121,12 @@ const wchar_t *archive_entry_uname_w(struct archive_entry *); * In contrast, 'copy' functions do copy the object pointed to. */ -void archive_entry_copy_stat(struct archive_entry *, const struct stat *); void archive_entry_set_atime(struct archive_entry *, time_t, long); void archive_entry_set_ctime(struct archive_entry *, time_t, long); +void archive_entry_set_dev(struct archive_entry *, dev_t); +void archive_entry_set_devmajor(struct archive_entry *, dev_t); +void archive_entry_set_devminor(struct archive_entry *, dev_t); +void archive_entry_set_filetype(struct archive_entry *, unsigned int); void archive_entry_set_fflags(struct archive_entry *, unsigned long set, unsigned long clear); /* Returns pointer to start of first invalid token, or NULL if none. */ @@ -120,12 +139,15 @@ void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *); void archive_entry_set_hardlink(struct archive_entry *, const char *); void archive_entry_copy_hardlink(struct archive_entry *, const char *); void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *); +void archive_entry_set_ino(struct archive_entry *, unsigned long); void archive_entry_set_link(struct archive_entry *, const char *); void archive_entry_set_mode(struct archive_entry *, mode_t); void archive_entry_set_mtime(struct archive_entry *, time_t, long); +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_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); void archive_entry_set_size(struct archive_entry *, int64_t); @@ -137,6 +159,18 @@ void archive_entry_set_uname(struct archive_entry *, const char *); void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *); /* + * Routines to bulk copy fields to/from a platform-native "struct + * stat." Libarchive used to just store a struct stat inside of each + * archive_entry object, but this created issues when trying to + * manipulate archives on systems different than the ones they were + * created on. + * + * TODO: On Linux, provide both stat32 and stat64 versions of these functions. + */ +const struct stat *archive_entry_stat(struct archive_entry *); +void archive_entry_copy_stat(struct archive_entry *, const struct stat *); + +/* * ACL routines. This used to simply store and return text-format ACL * strings, but that proved insufficient for a number of reasons: * = clients need control over uname/uid and gname/gid mappings |