diff options
author | Tim Kientzle <kientzle@FreeBSD.org> | 2004-04-26 23:37:54 +0000 |
---|---|---|
committer | Tim Kientzle <kientzle@FreeBSD.org> | 2004-04-26 23:37:54 +0000 |
commit | 61fac2242c77a75b588a0a6f71b0f75c5d4d1fdc (patch) | |
tree | f0f5a81c35118c56a6a3ac1a5d72fd50e2cdf842 /lib/libarchive/archive_entry.h | |
parent | e99eef3d4f1f4ae5d70a648d96c922d47dd98907 (diff) |
Update file flag handling.
The new fflags support in archive_entry supports Linux and FreeBSD
file flags and is a bit more gracious about unrecognized flag names
than strtofflags(3). This involves some minor API breakage.
The default tar format ("restricted pax") now enables pax extensions
when archiving files that have flags. In particular, copying dir
heirarchies with 'bsdtar cf - -C src . | bsdtar xpf - -C dest' now
preserves file flags. (Note the "p" on extract!)
While I'm here, fill in some additional explanation in the
archive_entry.3 manpage, fill in some missing MLINKS, mark some
overlooked internal functions 'static', and make a few minor style
fixes.
Notes
Notes:
svn path=/head/; revision=128669
Diffstat (limited to 'lib/libarchive/archive_entry.h')
-rw-r--r-- | lib/libarchive/archive_entry.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/libarchive/archive_entry.h b/lib/libarchive/archive_entry.h index 733a60dd5470..42c1fcae9df1 100644 --- a/lib/libarchive/archive_entry.h +++ b/lib/libarchive/archive_entry.h @@ -68,7 +68,9 @@ struct archive_entry *archive_entry_new(void); dev_t archive_entry_devmajor(struct archive_entry *); dev_t archive_entry_devminor(struct archive_entry *); -const char *archive_entry_fflags(struct archive_entry *); +const char *archive_entry_fflags_text(struct archive_entry *); +void archive_entry_fflags(struct archive_entry *, + unsigned long *set, unsigned long *clear); const char *archive_entry_gname(struct archive_entry *); const char *archive_entry_hardlink(struct archive_entry *); mode_t archive_entry_mode(struct archive_entry *); @@ -85,14 +87,18 @@ const char *archive_entry_uname(struct archive_entry *); * Set fields in an archive_entry. * * Note that string 'set' functions do not copy the string, only the pointer. - * In contrast, 'copy_stat' does copy the full structure. + * 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_fflags(struct archive_entry *, const char *); -void archive_entry_copy_fflags_w(struct archive_entry *, const wchar_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_fflags(struct archive_entry *, + unsigned long set, unsigned long clear); +/* Returns pointer to start of first invalid token, or NULL if none. */ +/* Note that all recognized tokens are processed, regardless. */ +const wchar_t *archive_entry_copy_fflags_text_w(struct archive_entry *, + const wchar_t *); void archive_entry_set_gid(struct archive_entry *, gid_t); void archive_entry_set_gname(struct archive_entry *, const char *); void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *); |