aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2004-08-08 07:39:19 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2004-08-08 07:39:19 +0000
commit7acae2155e4465929338b41204c560b5f3702578 (patch)
treeaff548a1bc6eb49b2a5cb73c805c915d065ed4af
parente232f70a75a2dd1f8d9110bc6d0325d880aa9341 (diff)
Add archive_entry_set_mtime()
Notes
Notes: svn path=/head/; revision=133317
-rw-r--r--lib/libarchive/archive_entry.33
-rw-r--r--lib/libarchive/archive_entry.c7
-rw-r--r--lib/libarchive/archive_entry.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/lib/libarchive/archive_entry.3 b/lib/libarchive/archive_entry.3
index 026444ee8a12..2f82f89d033a 100644
--- a/lib/libarchive/archive_entry.3
+++ b/lib/libarchive/archive_entry.3
@@ -71,6 +71,7 @@
.Nm archive_entry_set_hardlink ,
.Nm archive_entry_set_link ,
.Nm archive_entry_set_mode ,
+.Nm archive_entry_set_mtime ,
.Nm archive_entry_set_pathname ,
.Nm archive_entry_set_rdevmajor ,
.Nm archive_entry_set_rdevminor ,
@@ -171,6 +172,8 @@
.Ft void
.Fn archive_entry_set_mode "struct archive_entry *" "mode_t"
.Ft void
+.Fn archive_entry_set_mtime "struct archive_entry *" "time_t" "long nanos"
+.Ft void
.Fn archive_entry_set_pathname "struct archive_entry *" "const char *"
.Ft void
.Fn archive_entry_set_rdevmajor "struct archive_entry *" "dev_t"
diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c
index f6694309600c..db92789bacda 100644
--- a/lib/libarchive/archive_entry.c
+++ b/lib/libarchive/archive_entry.c
@@ -585,6 +585,13 @@ archive_entry_set_mode(struct archive_entry *entry, mode_t m)
}
void
+archive_entry_set_mtime(struct archive_entry *entry, time_t m, long ns)
+{
+ entry->ae_stat.st_mtime = m;
+ ARCHIVE_STAT_SET_MTIME_NANOS(&entry->ae_stat, ns);
+}
+
+void
archive_entry_set_pathname(struct archive_entry *entry, const char *name)
{
aes_set_mbs(&entry->ae_pathname, name);
diff --git a/lib/libarchive/archive_entry.h b/lib/libarchive/archive_entry.h
index 96d40f9c552b..e5bdaf645a3c 100644
--- a/lib/libarchive/archive_entry.h
+++ b/lib/libarchive/archive_entry.h
@@ -110,6 +110,7 @@ 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_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_pathname(struct archive_entry *, const char *);
void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *);
void archive_entry_set_rdevmajor(struct archive_entry *, dev_t);