X-Git-Url: https://git.sven.stormbind.net/?p=sven%2Fexfatprogs.git;a=blobdiff_plain;f=include%2Flibexfat.h;h=0357d770bdd5835684e40745b524a5f69aae6579;hp=6a3ecb8a93ce765f8054a9b72c8c4ebdd29749c0;hb=refs%2Ftags%2Fupstream%2F1.1.1;hpb=ca9b0f7353eba0cfbee98236d3487bbb6a8ec26f diff --git a/include/libexfat.h b/include/libexfat.h index 6a3ecb8..0357d77 100644 --- a/include/libexfat.h +++ b/include/libexfat.h @@ -37,6 +37,12 @@ /* 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 + enum { BOOT_SEC_IDX = 0, EXBOOT_SEC_IDX, @@ -49,11 +55,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 +70,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 +96,24 @@ 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(struct exfat_blk_dev *bd, + struct exfat_user_input *ui); +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