Getters and setters for time attributes on IsoNode.

This commit is contained in:
Vreixo Formoso 2007-12-06 22:52:01 +01:00
parent 7f9c5c9065
commit c93fa154d5
2 changed files with 78 additions and 0 deletions

View File

@ -253,6 +253,36 @@ void iso_node_set_gid(IsoNode *node, gid_t gid);
*/
gid_t iso_node_get_gid(const IsoNode *node);
/**
* Set the time of last modification of the file
*/
void iso_node_set_mtime(IsoNode *node, time_t time);
/**
* Get the time of last modification of the file
*/
time_t iso_node_get_mtime(const IsoNode *node);
/**
* Set the time of last access to the file
*/
void iso_node_set_atime(IsoNode *node, time_t time);
/**
* Get the time of last access to the file
*/
time_t iso_node_get_atime(const IsoNode *node);
/**
* Set the time of last status change of the file
*/
void iso_node_set_ctime(IsoNode *node, time_t time);
/**
* Get the time of last status change of the file
*/
time_t iso_node_get_ctime(const IsoNode *node);
/**
* Add a new node to a dir. Note that this function don't add a new ref to
* the node, so you don't need to free it, it will be automatically freed

View File

@ -173,6 +173,54 @@ gid_t iso_node_get_gid(const IsoNode *node)
return node->gid;
}
/**
* Set the time of last modification of the file
*/
void iso_node_set_mtime(IsoNode *node, time_t time)
{
node->mtime = time;
}
/**
* Get the time of last modification of the file
*/
time_t iso_node_get_mtime(const IsoNode *node)
{
return node->mtime;
}
/**
* Set the time of last access to the file
*/
void iso_node_set_atime(IsoNode *node, time_t time)
{
node->atime = time;
}
/**
* Get the time of last access to the file
*/
time_t iso_node_get_atime(const IsoNode *node)
{
return node->atime;
}
/**
* Set the time of last status change of the file
*/
void iso_node_set_ctime(IsoNode *node, time_t time)
{
node->ctime = time;
}
/**
* Get the time of last status change of the file
*/
time_t iso_node_get_ctime(const IsoNode *node)
{
return node->ctime;
}
/**
* Add a new node to a dir. Note that this function don't add a new ref to
* the node, so you don't need to free it, it will be automatically freed