X-Git-Url: https://git.sven.stormbind.net/?p=sven%2Fexfatprogs.git;a=blobdiff_plain;f=include%2Flibexfat.h;h=6a3ecb8a93ce765f8054a9b72c8c4ebdd29749c0;hp=56053b465ccc15810483cd2f681f20cb60c31f05;hb=ca9b0f7353eba0cfbee98236d3487bbb6a8ec26f;hpb=f7feb8f190bd23ec253bf9fe705738049d9cedd7 diff --git a/include/libexfat.h b/include/libexfat.h index 56053b4..6a3ecb8 100644 --- a/include/libexfat.h +++ b/include/libexfat.h @@ -28,6 +28,8 @@ #define EXFAT_MAX_NUM_CLUSTER (0xFFFFFFF5) +#define DEFAULT_BOUNDARY_ALIGNMENT (1024*1024) + #define DEFAULT_SECTOR_SIZE (512) #define VOLUME_LABEL_BUFFER_SIZE (VOLUME_LABEL_MAX_LEN*MB_LEN_MAX+1) @@ -59,6 +61,7 @@ struct exfat_user_input { bool writeable; unsigned int cluster_size; unsigned int sec_per_clu; + unsigned int boundary_align; bool quick; __u16 volume_label[VOLUME_LABEL_MAX_LEN]; int volume_label_len; @@ -79,6 +82,7 @@ int exfat_get_blk_dev_info(struct exfat_user_input *ui, ssize_t exfat_read(int fd, void *buf, size_t size, off_t offset); ssize_t exfat_write(int fd, void *buf, size_t size, off_t offset); +size_t exfat_utf16_len(const __le16 *str, size_t max_size); ssize_t exfat_utf16_enc(const char *in_str, __u16 *out_str, size_t out_size); ssize_t exfat_utf16_dec(const __u16 *in_str, size_t in_len, char *out_str, size_t out_size); @@ -93,19 +97,19 @@ extern unsigned int print_level; #define EXFAT_INFO (2) #define EXFAT_DEBUG (3) -#define exfat_msg(level, fmt, ...) \ - do { \ - if (print_level >= level) { \ - if (print_level == EXFAT_INFO) \ - printf(fmt, ##__VA_ARGS__); \ - else \ - printf("[%s:%4d] " fmt, \ - __func__, __LINE__, ##__VA_ARGS__); \ - } \ - } while (0) \ - -#define exfat_err(fmt, ...) exfat_msg(EXFAT_ERROR, fmt, ##__VA_ARGS__) -#define exfat_info(fmt, ...) exfat_msg(EXFAT_INFO, fmt, ##__VA_ARGS__) -#define exfat_debug(fmt, ...) exfat_msg(EXFAT_DEBUG, fmt, ##__VA_ARGS__) +#define exfat_msg(level, dir, fmt, ...) \ + do { \ + if (print_level >= level) { \ + fprintf(dir, fmt, ##__VA_ARGS__); \ + } \ + } while (0) \ + +#define exfat_err(fmt, ...) exfat_msg(EXFAT_ERROR, stderr, \ + fmt, ##__VA_ARGS__) +#define exfat_info(fmt, ...) exfat_msg(EXFAT_INFO, stdout, \ + fmt, ##__VA_ARGS__) +#define exfat_debug(fmt, ...) exfat_msg(EXFAT_DEBUG, stdout, \ + "[%s:%4d] " fmt, __func__, \ + __LINE__, ##__VA_ARGS__) #endif /* !_LIBEXFAT_H */