X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=include%2Flibexfat.h;h=fecd7f23719bebd3d0db5650eed5cc533c70afc2;hb=504e0feaaefecccc8059f5ecb5d028a7f014f1d6;hp=6a3ecb8a93ce765f8054a9b72c8c4ebdd29749c0;hpb=77466d00ac72316d70c469b34dc8f5247520a31e;p=sven%2Fexfatprogs.git diff --git a/include/libexfat.h b/include/libexfat.h index 6a3ecb8..fecd7f2 100644 --- a/include/libexfat.h +++ b/include/libexfat.h @@ -37,6 +37,14 @@ /* Upcase tabel macro */ #define EXFAT_UPCASE_TABLE_SIZE (5836) +/* Flags for tune.exfat and exfatlabel */ +#define EXFAT_GET_VOLUME_LABEL 0x01 +#define EXFAT_SET_VOLUME_LABEL 0x02 +#define EXFAT_GET_VOLUME_SERIAL 0x03 +#define EXFAT_SET_VOLUME_SERIAL 0x04 + +#define EXFAT_MAX_SECTOR_SIZE 4096 + enum { BOOT_SEC_IDX = 0, EXBOOT_SEC_IDX, @@ -49,11 +57,13 @@ enum { struct exfat_blk_dev { int dev_fd; + unsigned long long offset; unsigned long long size; unsigned int sector_size; unsigned int sector_size_bits; unsigned long long num_sectors; unsigned int num_clusters; + unsigned int cluster_size; }; struct exfat_user_input { @@ -62,9 +72,11 @@ struct exfat_user_input { unsigned int cluster_size; unsigned int sec_per_clu; unsigned int boundary_align; + bool pack_bitmap; bool quick; __u16 volume_label[VOLUME_LABEL_MAX_LEN]; int volume_label_len; + unsigned int volume_serial; }; void show_version(void); @@ -86,6 +98,23 @@ 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); +off_t exfat_get_root_entry_offset(struct exfat_blk_dev *bd); +int exfat_show_volume_label(struct exfat_blk_dev *bd, off_t root_clu_off); +int exfat_set_volume_label(struct exfat_blk_dev *bd, + char *label_input, off_t root_clu_off); +int exfat_read_sector(struct exfat_blk_dev *bd, void *buf, + unsigned int sec_off); +int exfat_write_sector(struct exfat_blk_dev *bd, void *buf, + unsigned int sec_off); +int exfat_write_checksum_sector(struct exfat_blk_dev *bd, + unsigned int checksum, bool is_backup); +char *exfat_conv_volume_label(struct exfat_dentry *vol_entry); +int exfat_show_volume_serial(int fd); +int exfat_set_volume_serial(struct exfat_blk_dev *bd, + struct exfat_user_input *ui); +unsigned int exfat_clus_to_blk_dev_off(struct exfat_blk_dev *bd, + unsigned int clu_off, unsigned int clu); + /* * Exfat Print