summaryrefslogtreecommitdiff
path: root/extras/volume_id/lib/util.h
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-05-17 20:09:24 +0200
committerKay Sievers <kay.sievers@vrfy.org>2007-05-17 20:09:24 +0200
commitb10941c08db89f52038e19ee8a29f26d7808a448 (patch)
treea456c4e24d9ed0a79ad3f10afd29e353336c2b41 /extras/volume_id/lib/util.h
parent2f2c4fa442f33d7eaee02eda016d6149b9aa0be6 (diff)
volume_id: add and export string encoding function
Needed for mount(8) to lookup LABEL=* in /dev/disk/by-label/*. Characters not suited for a filename will be escaped and the encoded LABEL=* string is able to find the corresponding symlink.
Diffstat (limited to 'extras/volume_id/lib/util.h')
-rw-r--r--extras/volume_id/lib/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/extras/volume_id/lib/util.h b/extras/volume_id/lib/util.h
index 1206116ce2..6ed7b48b50 100644
--- a/extras/volume_id/lib/util.h
+++ b/extras/volume_id/lib/util.h
@@ -23,6 +23,8 @@
#include <byteswap.h>
#include <syslog.h>
+#define ALLOWED_CHARS "#+-.:=@_%"
+
#ifndef PACKED
#define PACKED __attribute__((packed))
#endif
@@ -77,6 +79,7 @@ enum endian {
BE = 1
};
+extern int volume_id_utf8_encoded_valid_unichar(const char *str);
extern void volume_id_set_unicode16(char *str, size_t len, const uint8_t *buf, enum endian endianess, size_t count);
extern void volume_id_set_usage(struct volume_id *id, enum volume_id_usage usage_id);
extern void volume_id_set_label_raw(struct volume_id *id, const uint8_t *buf, size_t count);