summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-07-05 18:11:44 +0000
committerkientzle <kientzle@FreeBSD.org>2004-07-05 18:11:44 +0000
commit7acdd18fdc6198e002cf2ce35c236a5825f9d3c2 (patch)
tree898442ea20e803fdf4ac341967c52c7acecebe44 /lib
parent1cf580eda7d22faa4622707f1d9bc30b8cb773fa (diff)
downloadFreeBSD-src-7acdd18fdc6198e002cf2ce35c236a5825f9d3c2.zip
FreeBSD-src-7acdd18fdc6198e002cf2ce35c236a5825f9d3c2.tar.gz
Add convenience functions to retrieve the atime fields directly,
without having to first pull the stat structure.
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_entry.36
-rw-r--r--lib/libarchive/archive_entry.c12
-rw-r--r--lib/libarchive/archive_entry.h2
3 files changed, 20 insertions, 0 deletions
diff --git a/lib/libarchive/archive_entry.3 b/lib/libarchive/archive_entry.3
index 929456c..026444e 100644
--- a/lib/libarchive/archive_entry.3
+++ b/lib/libarchive/archive_entry.3
@@ -36,6 +36,8 @@
.Nm archive_entry_acl_next_w ,
.Nm archive_entry_acl_reset ,
.Nm archive_entry_acl_text_w ,
+.Nm archive_entry_atime ,
+.Nm archive_entry_atime_nsec ,
.Nm archive_entry_clear ,
.Nm archive_entry_clone ,
.Nm archive_entry_copy_fflags_text_w ,
@@ -100,6 +102,10 @@
.Fn archive_entry_acl_reset "struct archive_entry *"
.Ft const wchar_t *
.Fn archive_entry_acl_text_w "struct archive_entry *" "int flags"
+.Ft time_t
+.Fn archive_entry_atime "struct archive_entry *"
+.Ft long
+.Fn archive_entry_atime_nsec "struct archive_entry *"
.Ft void
.Fn archive_entry_clear "struct archive_entry *"
.Ft struct archive_entry *
diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c
index 0a76114..f04fee8 100644
--- a/lib/libarchive/archive_entry.c
+++ b/lib/libarchive/archive_entry.c
@@ -338,6 +338,18 @@ archive_entry_new(void)
* Functions for reading fields from an archive_entry.
*/
+time_t
+archive_entry_atime(struct archive_entry *entry)
+{
+ return (entry->ae_stat.st_atime);
+}
+
+long
+archive_entry_atime_nsec(struct archive_entry *entry)
+{
+ return (ARCHIVE_STAT_ATIME_NANOS(&entry->ae_stat));
+}
+
dev_t
archive_entry_dev(struct archive_entry *entry)
{
diff --git a/lib/libarchive/archive_entry.h b/lib/libarchive/archive_entry.h
index 9feb6d4..96d40f9 100644
--- a/lib/libarchive/archive_entry.h
+++ b/lib/libarchive/archive_entry.h
@@ -64,6 +64,8 @@ struct archive_entry *archive_entry_new(void);
* Retrieve fields from an archive_entry.
*/
+time_t archive_entry_atime(struct archive_entry *);
+long archive_entry_atime_nsec(struct archive_entry *);
dev_t archive_entry_dev(struct archive_entry *);
void archive_entry_fflags(struct archive_entry *,
unsigned long *set, unsigned long *clear);
OpenPOWER on IntegriCloud