chiark / gitweb /
volume_id: add and export string encoding function
[elogind.git] / extras / volume_id / lib / util.h
index cd8dac557c1df727d889aa8f8cd3afa912a0e10e..6ed7b48b5061d543e9c01be4508ad9787ee6361b 100644 (file)
@@ -23,6 +23,8 @@
 #include <byteswap.h>
 #include <syslog.h>
 
+#define ALLOWED_CHARS                          "#+-.:=@_%"
+
 #ifndef PACKED
 #define PACKED                         __attribute__((packed))
 #endif
 #endif /* __BYTE_ORDER */
 
 enum uuid_format {
-       UUID_HEX_STRING,
        UUID_STRING,
+       UUID_HEX_STRING,
        UUID_DCE,
        UUID_DOS,
-       UUID_NTFS,
-       UUID_HFS,
+       UUID_64BIT_LE,
+       UUID_64BIT_BE,
        UUID_FOURINT,
 };
 
@@ -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);