chiark / gitweb /
[PATCH] udev_volume_id: fix endianess macros
[elogind.git] / extras / volume_id / volume_id / util.h
index 22fd1b94e240e6e017915334fd1dda83d9476808..e18efe2f213c563edaac0b0987c75d4e70608428 100644 (file)
@@ -29,6 +29,8 @@
 #  include <config.h>
 #endif
 
+#include <endian.h>
+
 /* size of superblock buffer, reiserfs block is at 64k */
 #define SB_BUFFER_SIZE                         0x11000
 /* size of seek buffer, FAT cluster is 32k max */
@@ -52,6 +54,7 @@
                           (((__u64)(x) & 0x000000000000ff00ull) << 40) | \
                           (((__u64)(x) & 0x00000000000000ffull) << 56))
 
+#ifdef __BYTE_ORDER
 #if (__BYTE_ORDER == __LITTLE_ENDIAN)
 #define le16_to_cpu(x) (x)
 #define le32_to_cpu(x) (x)
 #define cpu_to_le32(x) bswap32(x)
 #define cpu_to_be32(x) (x)
 #endif
+#endif /* __BYTE_ORDER */
 
 enum uuid_format {
+       UUID_DCE_STRING,
        UUID_DCE,
        UUID_DOS,
        UUID_NTFS,
@@ -82,6 +87,7 @@ enum endian {
        BE = 1
 };
 
+extern void volume_id_set_unicode16(char *str, unsigned int len, const __u8 *buf, enum endian endianess, unsigned int count);
 extern void volume_id_set_usage(struct volume_id *id, enum volume_id_usage usage_id);
 extern void volume_id_set_usage_part(struct volume_id_partition *part, enum volume_id_usage usage_id);
 extern void volume_id_set_label_raw(struct volume_id *id, const __u8 *buf, unsigned int count);