]> err.no Git - util-linux/commitdiff
libblkid: add partitions filter routines
authorKarel Zak <kzak@redhat.com>
Wed, 16 Sep 2009 13:49:44 +0000 (15:49 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 16 Sep 2009 13:49:44 +0000 (15:49 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/blkid.h
shlibs/blkid/src/blkid.sym
shlibs/blkid/src/partitions/partitions.c

index 45e03b5b309bf5b425f06084c2cb4aa7010a7b8f..c0cda634d69fe06329796d588e5329af653eb190 100644 (file)
@@ -213,6 +213,11 @@ extern unsigned long blkid_topology_get_optimal_io_size(blkid_topology tp);
 extern int blkid_known_pttype(const char *pttype);
 extern int blkid_probe_enable_partitions(blkid_probe pr, int enable);
 
+extern int blkid_probe_reset_partitions_filter(blkid_probe pr);
+extern int blkid_probe_invert_partitions_filter(blkid_probe pr);
+extern int blkid_probe_filter_partitions_type(blkid_probe pr, int flag, char *names[]);
+
+
 /* partitions probing flags */
 #define BLKID_PARTS_FORCE_GPT  (1 << 1)
 extern int blkid_probe_set_partitions_flags(blkid_probe pr, int flags);
index ac1b159f2fe610651ee59bdbbffd7b4fe3b62299..89baf4832e49027bfb5327390c920286f18f7b17 100644 (file)
@@ -92,6 +92,7 @@ global:
        blkid_probe_enable_partitions;
        blkid_probe_enable_superblocks;
        blkid_probe_enable_topology;
+       blkid_probe_filter_partitions_type;
        blkid_probe_filter_superblocks_type;
        blkid_probe_filter_superblocks_usage;
        blkid_probe_get_devno;
@@ -99,7 +100,9 @@ global:
        blkid_probe_get_sectorsize;
        blkid_probe_get_size;
        blkid_probe_get_topology;
+       blkid_probe_invert_partitions_filter;
        blkid_probe_invert_superblocks_filter;
+       blkid_probe_reset_partitions_filter;
        blkid_probe_reset_superblocks_filter;
        blkid_probe_set_partitions_flags;
        blkid_probe_set_superblocks_flags;
index 365e0f1fbc161e6eb7bb2a598cd7e119ad106af6..16be7ed7d8e3a0993fcd80a8cdc04c6a295b7af5 100644 (file)
@@ -198,6 +198,48 @@ int blkid_probe_set_partitions_flags(blkid_probe pr, int flags)
        return 0;
 }
 
+/**
+ * blkid_probe_reset_partitions_filter:
+ * @pr: prober
+ *
+ * Resets partitions probing filter
+ *
+ * Returns: 0 on success, or -1 in case of error.
+ */
+int blkid_probe_reset_partitions_filter(blkid_probe pr)
+{
+       return __blkid_probe_reset_filter(pr, BLKID_CHAIN_PARTS);
+}
+
+/**
+ * blkid_probe_invert_partitions_filter:
+ * @pr: prober
+ *
+ * Inverts partitions probing filter
+ *
+ * Returns: 0 on success, or -1 in case of error.
+ */
+int blkid_probe_invert_partitions_filter(blkid_probe pr)
+{
+       return __blkid_probe_invert_filter(pr, BLKID_CHAIN_PARTS);
+}
+
+/**
+ * blkid_probe_filter_partitions_type:
+ * @pr: prober
+ * @flag: filter BLKID_FLTR_{NOTIN,ONLYIN} flag
+ * @names: NULL terminated array of probing function names (e.g. "vfat").
+ *
+ *  BLKID_FLTR_NOTIN  - probe for all items which are NOT IN @names
+ *  BLKID_FLTR_ONLYIN - probe for items which are IN @names
+ *
+ * Returns: 0 on success, or -1 in case of error.
+ */
+int blkid_probe_filter_partitions_type(blkid_probe pr, int flag, char *names[])
+{
+       return __blkid_probe_filter_types(pr, BLKID_CHAIN_PARTS, flag, names);
+}
+
 /**
  * blkid_probe_get_partitions:
  * @pr: probe