implementation.
Free exFAT implementation.
- Copyright (C) 2010-2017 Andrew Nayenko
+ Copyright (C) 2010-2018 Andrew Nayenko
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#ifndef EXFAT_H_INCLUDED
#define EXFAT_H_INCLUDED
+#ifndef ANDROID
+/* Android.bp is used instead of autotools when targeting Android */
#include "config.h"
+#endif
#include "compiler.h"
#include "exfatfs.h"
#include <stdio.h>
#define BMAP_CLR(bitmap, index) \
((bitmap)[BMAP_BLOCK(index)] &= ~BMAP_MASK(index))
+#define EXFAT_REPAIR(hook, ef, ...) \
+ (exfat_ask_to_fix(ef) && exfat_fix_ ## hook(ef, __VA_ARGS__))
+
/* The size of off_t type must be 64 bits. File systems larger than 2 GB will
be corrupted with 32-bit off_t. */
STATIC_ASSERT(sizeof(off_t) == 8);
gid_t gid;
int ro;
bool noatime;
+ enum { EXFAT_REPAIR_NO, EXFAT_REPAIR_ASK, EXFAT_REPAIR_YES } repair;
};
/* in-core nodes iterator */
};
extern int exfat_errors;
+extern int exfat_errors_fixed;
void exfat_bug(const char* format, ...) PRINTF NORETURN;
void exfat_error(const char* format, ...) PRINTF;
uint8_t* centisec);
void exfat_tzset(void);
+bool exfat_ask_to_fix(const struct exfat* ef);
+bool exfat_fix_invalid_vbr_checksum(const struct exfat* ef, void* sector,
+ uint32_t vbr_checksum);
+bool exfat_fix_invalid_node_checksum(const struct exfat* ef,
+ struct exfat_node* node);
+bool exfat_fix_unknown_entry(struct exfat* ef, struct exfat_node* dir,
+ const struct exfat_entry* entry, off_t offset);
+
#endif /* ifndef EXFAT_H_INCLUDED */