From 3028015ab88f43a468424e37f584263542acb3cd Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Lopes Date: Mon, 22 Oct 2007 09:30:43 +0000 Subject: [PATCH] Add setter and getters for atime and ctime on tree_node. --- libisofs/libisofs.h | 12 ++++++++++++ libisofs/tree.c | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 7dc933f..332db07 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -903,6 +903,18 @@ void iso_tree_node_set_mtime(struct iso_tree_node *node, time_t time); /** Get the time of last modification of the file */ time_t iso_tree_node_get_mtime(struct iso_tree_node *node); +/** Set the time of last access to the file */ +void iso_tree_node_set_atime(struct iso_tree_node *node, time_t time); + +/** Get the time of last access to the file */ +time_t iso_tree_node_get_atime(struct iso_tree_node *node); + +/** Set the time of last status change of the file */ +void iso_tree_node_set_ctime(struct iso_tree_node *node, time_t time); + +/** Get the time of last status change of the file */ +time_t iso_tree_node_get_ctime(struct iso_tree_node *node); + /** * Sets the order in which a node will be written on image. High weihted files * will be written first, so in a disc them will be written near the center. diff --git a/libisofs/tree.c b/libisofs/tree.c index 13d47fd..53f45ee 100644 --- a/libisofs/tree.c +++ b/libisofs/tree.c @@ -241,6 +241,30 @@ iso_tree_node_get_mtime(struct iso_tree_node *node) return node->attrib.st_mtime; } +void +iso_tree_node_set_atime(struct iso_tree_node *node, time_t time) +{ + node->attrib.st_atime = time; +} + +time_t +iso_tree_node_get_atime(struct iso_tree_node *node) +{ + return node->attrib.st_atime; +} + +void +iso_tree_node_set_ctime(struct iso_tree_node *node, time_t time) +{ + node->attrib.st_ctime = time; +} + +time_t +iso_tree_node_get_ctime(struct iso_tree_node *node) +{ + return node->attrib.st_ctime; +} + void iso_tree_node_set_sort_weight(struct iso_tree_node *node, int w) {