From 86a3f4de2278ef3f25397490e4a5dea86309de9e Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Date: Mon, 26 May 2008 15:43:55 +0200 Subject: [PATCH] Added iso_special_get_dev() API to retrieve devide id for device files. --- libisofs/libisofs.h | 10 ++++++++++ libisofs/node.c | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 6c827c0..a7ab0f9 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -2493,6 +2493,16 @@ int iso_file_get_sort_weight(IsoFile *file); */ off_t iso_file_get_size(IsoFile *file); +/** + * Get the device id (major/minor numbers) of the given block or + * character device file. The result is undefined for other kind + * of special files, of first be sure iso_node_get_mode() returns either + * S_IFBLK or S_IFCHR. + * + * @since 0.6.6 + */ +dev_t iso_special_get_dev(IsoSpecial *special); + /** * Get the IsoStream that represents the contents of the given IsoFile. * diff --git a/libisofs/node.c b/libisofs/node.c index 9c8dee9..f1b26f9 100644 --- a/libisofs/node.c +++ b/libisofs/node.c @@ -906,6 +906,19 @@ IsoStream *iso_file_get_stream(IsoFile *file) return file->stream; } +/** + * Get the device id (major/minor numbers) of the given block or + * character device file. The result is undefined for other kind + * of special files, of first be sure iso_node_get_mode() returns either + * S_IFBLK or S_IFCHR. + * + * @since 0.6.6 + */ +dev_t iso_special_get_dev(IsoSpecial *special) +{ + return special->dev; +} + /** * Get the block lba of a file node, if it was imported from an old image. *