summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/label.c
diff options
context:
space:
mode:
authorKarel Zak2014-08-15 10:49:51 +0200
committerKarel Zak2014-08-15 10:49:51 +0200
commit4af064f3fca711c009467fbc9b415c4cc077f993 (patch)
tree06f4270f2e82b14048edf4e578cf2c3b0e0ab28c /libfdisk/src/label.c
parentlibfdisk: more docs (diff)
downloadkernel-qcow2-util-linux-4af064f3fca711c009467fbc9b415c4cc077f993.tar.gz
kernel-qcow2-util-linux-4af064f3fca711c009467fbc9b415c4cc077f993.tar.xz
kernel-qcow2-util-linux-4af064f3fca711c009467fbc9b415c4cc077f993.zip
libfdisk: fdisk_label_is_labeltype()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/label.c')
-rw-r--r--libfdisk/src/label.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libfdisk/src/label.c b/libfdisk/src/label.c
index 4e37f74f9..a2fa93bc6 100644
--- a/libfdisk/src/label.c
+++ b/libfdisk/src/label.c
@@ -71,6 +71,18 @@ const char *fdisk_label_get_name(struct fdisk_label *lb)
}
/**
+ * fdisk_label_is_labeltype:
+ * @lb: label
+ * @id: FDISK_DISKLABEL_*
+ *
+ * Returns: 1 if the label type matches with id.
+ */
+int fdisk_label_is_labeltype(struct fdisk_label *lb, enum fdisk_labeltype id)
+{
+ return lb && lb->id == id;
+}
+
+/**
* fdisk_label_require_geometry:
* @lb: label
*