diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/exfat_ondisk.h | 18 | ||||
-rw-r--r-- | include/libexfat.h | 3 | ||||
-rw-r--r-- | include/version.h | 2 |
3 files changed, 15 insertions, 8 deletions
diff --git a/include/exfat_ondisk.h b/include/exfat_ondisk.h index 2137226..636f5ea 100644 --- a/include/exfat_ondisk.h +++ b/include/exfat_ondisk.h @@ -7,23 +7,29 @@ #define _EXFAT_H #include <stdint.h> +#include <byteswap.h> #include <linux/fs.h> #ifdef HAVE_CONFIG_H #include <config.h> #endif +#define UTF16_NULL 0x0000 + #ifdef WORDS_BIGENDIAN -#define cpu_to_le16(x) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8)) -#define cpu_to_le32(x) \ - ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \ - (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) -#define cpu_to_le64(x) (cpu_to_le32((uint64_t)(x)) << 32 | \ - cpu_to_le32((uint64_t)(x) >> 32)) +#define cpu_to_le16(x) bswap_16(x) +#define cpu_to_le32(x) bswap_32(x) +#define cpu_to_le64(x) bswap_64(x) + +#define UTF16_DOT 0x2E00 /* . */ +#define UTF16_SLASH 0x2F00 /* / */ #else #define cpu_to_le16(x) (x) #define cpu_to_le32(x) (x) #define cpu_to_le64(x) (x) + +#define UTF16_DOT 0x002E /* . */ +#define UTF16_SLASH 0x002F /* / */ #endif #define le64_to_cpu(x) ((uint64_t)cpu_to_le64(x)) diff --git a/include/libexfat.h b/include/libexfat.h index 2ed9aa7..bcab23a 100644 --- a/include/libexfat.h +++ b/include/libexfat.h @@ -78,7 +78,7 @@ struct exfat_blk_dev { }; struct exfat_user_input { - char dev_name[255]; + const char *dev_name; bool writeable; unsigned int sector_size; unsigned int cluster_size; @@ -190,6 +190,7 @@ bool exfat_heap_clus(struct exfat *exfat, clus_t clus); int exfat_root_clus_count(struct exfat *exfat); int read_boot_sect(struct exfat_blk_dev *bdev, struct pbr **bs); int exfat_parse_ulong(const char *s, unsigned long *out); +int exfat_check_name(__le16 *utf16_name, int len); /* * Exfat Print diff --git a/include/version.h b/include/version.h index 31f150e..e324363 100644 --- a/include/version.h +++ b/include/version.h @@ -5,6 +5,6 @@ #ifndef _VERSION_H -#define EXFAT_PROGS_VERSION "1.2.4" +#define EXFAT_PROGS_VERSION "1.2.5" #endif /* !_VERSION_H */ |