From 63f2cfd673d5916334d49fbe5d948eb2bb64b1b6 Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Lopes Date: Mon, 22 Oct 2007 08:39:22 +0000 Subject: [PATCH] Add get_size() method to tree_node. --- libisofs/libisofs.h | 3 +++ libisofs/tree.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index e31ab0b..6e4d16e 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -894,6 +894,9 @@ void iso_tree_node_set_permissions(struct iso_tree_node *node, mode_t mode); /** Get the permissions for the node */ mode_t iso_tree_node_get_permissions(struct iso_tree_node *node); +/** Get the size of the node, in bytes */ +off_t iso_tree_node_get_size(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 7159dbf..6c3723e 100644 --- a/libisofs/tree.c +++ b/libisofs/tree.c @@ -223,6 +223,12 @@ iso_tree_node_get_permissions(struct iso_tree_node *node) return node->attrib.st_mode & ~S_IFMT; } +off_t +iso_tree_node_get_size(struct iso_tree_node *node) +{ + return node->attrib.st_size; +} + void iso_tree_node_set_sort_weight(struct iso_tree_node *node, int w) {