Signed-off-by: Karel Zak <kzak@redhat.com>
mnt_mangle
mnt_match_fstype
mnt_match_options
+mnt_tag_is_valid
mnt_unmangle
</SECTION>
extern char *mnt_unmangle(const char *str)
__ul_attribute__((warn_unused_result));
+extern int mnt_tag_is_valid(const char *tag);
extern int mnt_fstype_is_netfs(const char *type);
extern int mnt_fstype_is_pseudofs(const char *type);
mnt_unref_fs;
mnt_unref_table;
} MOUNT_2.23;
+
+MOUNT_2.25 {
+ mnt_tag_is_valid;
+} MOUNT_2.24;
#include <fcntl.h>
#include <pwd.h>
#include <grp.h>
+#include <blkid.h>
#include "strutils.h"
#include "pathnames.h"
return 0;
}
+/**
+ * mnt_tag_is_valid:
+ * @tag: NAME=value string
+ *
+ * Returns: 1 if the @tag is parsable and tag NAME= is supported by libmount, or 0.
+ */
+int mnt_tag_is_valid(const char *tag)
+{
+ char *t = NULL;
+ int rc = tag && blkid_parse_tag_string(tag, &t, NULL) == 0
+ && mnt_valid_tagname(t);
+
+ free(t);
+ return rc;
+}
+
int mnt_parse_offset(const char *str, size_t len, uintmax_t *res)
{
char *p;