]> err.no Git - util-linux/commitdiff
libblkid: add blkid_probe_get_{offset,fd} functions
authorKarel Zak <kzak@redhat.com>
Wed, 10 Mar 2010 14:50:45 +0000 (15:50 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 10 Mar 2010 14:50:45 +0000 (15:50 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/blkid.h.in
shlibs/blkid/src/blkid.sym
shlibs/blkid/src/probe.c

index edeb8b571765dc1f7b97a7b014e218ef8e04289f..07001a3a5888f1ad5643509c77ca432df9d2060c 100644 (file)
@@ -198,8 +198,11 @@ extern int blkid_probe_set_device(blkid_probe pr, int fd,
 
 extern dev_t blkid_probe_get_devno(blkid_probe pr);
 extern blkid_loff_t blkid_probe_get_size(blkid_probe pr);
+extern blkid_loff_t blkid_probe_get_offset(blkid_probe pr);
 extern unsigned int blkid_probe_get_sectorsize(blkid_probe pr);
 
+extern int blkid_probe_get_fd(blkid_probe pr);
+
 /*
  * superblocks probing
  */
index dfde68913e6e2e315e6f30441fb145300b4036aa..a80e87399c0a1ebc70617b78acfc729ed00533de 100644 (file)
@@ -120,7 +120,9 @@ global:
  */
 BLKID_2.18 {
 global:
-       blkid_probe_all_removable;
-       blkid_partlist_devno_to_partition;
        blkid_partition_get_flags;
+       blkid_partlist_devno_to_partition;
+       blkid_probe_all_removable;
+       blkid_probe_get_fd;
+       blkid_probe_get_offset;
 } BLKID_2.17;
index 4ca215b083783dedc64d755e37b56742231ef221..6d61386c1e718d7f1d293324ea0eab1214603484 100644 (file)
@@ -990,6 +990,30 @@ blkid_loff_t blkid_probe_get_size(blkid_probe pr)
        return pr ? pr->size : -1;
 }
 
+/**
+ * blkid_probe_get_offset:
+ * @pr: probe
+ *
+ * This function returns offset of probing area as defined by blkid_probe_set_device().
+ *
+ * Returns: offset in bytes or -1 in case of error.
+ */
+blkid_loff_t blkid_probe_get_offset(blkid_probe pr)
+{
+       return pr ? pr->off : -1;
+}
+
+/**
+ * blkid_probe_get_fd:
+ * @pr: probe
+ *
+ * Returns: file descriptor for assigned device/file.
+ */
+int blkid_probe_get_fd(blkid_probe pr)
+{
+       return pr ? pr->fd : -1;
+}
+
 /**
  * blkid_probe_get_sectorsize:
  * @pr: probe