--- /dev/null
+include $(call all-subdir-makefiles)
--- /dev/null
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/bin/*.exfat)
--- /dev/null
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := fsck.exfat
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -D_FILE_OFFSET_BITS=64
+LOCAL_SRC_FILES := main.c
+LOCAL_SHARED_LIBRARIES := libexfat libfuse-lite
+include $(BUILD_EXECUTABLE)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libexfat_fsck_static
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -D_FILE_OFFSET_BITS=64 -Dmain=fsck_exfat_main
+LOCAL_SRC_FILES := main.c
+LOCAL_C_INCLUDES := external/fuse/include
+LOCAL_STATIC_LIBRARIES := libfuse_static libexfat_static
+include $(BUILD_STATIC_LIBRARY)
+
--- /dev/null
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := mount.exfat
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -D_FILE_OFFSET_BITS=64
+LOCAL_SRC_FILES := main.c
+LOCAL_SHARED_LIBRARIES := libexfat libfuse-lite
+include $(BUILD_EXECUTABLE)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libexfat_mount_static
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -D_FILE_OFFSET_BITS=64 -Dmain=mount_exfat_main
+LOCAL_SRC_FILES := main.c
+LOCAL_C_INCLUDES := external/fuse/include \
+ external/fuse/android
+LOCAL_STATIC_LIBRARIES := libfuse_static libexfat_static
+include $(BUILD_STATIC_LIBRARY)
--- /dev/null
+LOCAL_PATH := $(call my-dir)
+
+common_src_files := cluster.c io.c log.c lookup.c mount.c node.c time.c utils.c
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libexfat
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -D_FILE_OFFSET_BITS=64
+LOCAL_SRC_FILES := $(common_src_files)
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libexfat_static
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -D_FILE_OFFSET_BITS=64
+LOCAL_SRC_FILES := $(common_src_files)
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+LOCAL_STATIC_LIBRARIES := libfuse_static libexfat_static
+include $(BUILD_STATIC_LIBRARY)
--- /dev/null
+/* libexfat/config.h. Generated from config.h.in by configure. */
+/* libexfat/config.h.in. Generated from configure.ac by autoheader. */
+
+/* Name of package */
+#define PACKAGE "exfat"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "relan@users.noreply.github.com"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "Free exFAT implementation"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "Free exFAT implementation 1.2.4"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "exfat"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "https://github.com/relan/exfat"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.2.4"
+
+/* Version number of package */
+#define VERSION "1.2.4"
+
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
#ifndef COMPILER_H_INCLUDED
#define COMPILER_H_INCLUDED
-#if __STDC_VERSION__ < 199901L
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ < 199901L)
#error C99-compliant compiler is required
#endif
#ifndef EXFAT_H_INCLUDED
#define EXFAT_H_INCLUDED
+#if defined(__ANDROID__)
+#include "android_config.h"
+#else
#include "config.h"
+#endif
#include "compiler.h"
#include "exfatfs.h"
#include <stdio.h>
void exfat_print_info(const struct exfat_super_block* sb,
uint32_t free_clusters);
-int utf16_to_utf8(char* output, const le16_t* input, size_t outsize,
- size_t insize);
-int utf8_to_utf16(le16_t* output, const char* input, size_t outsize,
- size_t insize);
-size_t utf16_length(const le16_t* str);
-
struct exfat_node* exfat_get_node(struct exfat_node* node);
void exfat_put_node(struct exfat* ef, struct exfat_node* node);
int exfat_cleanup_node(struct exfat* ef, struct exfat_node* node);
off_t exfat_seek(struct exfat_dev* dev, off_t offset, int whence)
{
+#if defined(__ANDROID__)
+ return lseek64(dev->fd, offset, whence);
+#else
return lseek(dev->fd, offset, whence);
+#endif
}
ssize_t exfat_read(struct exfat_dev* dev, void* buffer, size_t size)
ssize_t exfat_pread(struct exfat_dev* dev, void* buffer, size_t size,
off_t offset)
{
+#if defined(__ANDROID__)
+ return pread64(dev->fd, buffer, size, offset);
+#else
return pread(dev->fd, buffer, size, offset);
+#endif
}
ssize_t exfat_pwrite(struct exfat_dev* dev, const void* buffer, size_t size,
off_t offset)
{
+#if defined(__ANDROID__)
+ return pwrite64(dev->fd, buffer, size, offset);
+#else
return pwrite(dev->fd, buffer, size, offset);
+#endif
}
ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node,
vsyslog(LOG_CRIT, format, aq);
va_end(aq);
+#if defined(__ANDROID__)
+ exit(-1);
+#else
abort();
+#endif
}
/*
*/
#include "exfat.h"
+#include "utf.h"
#include <string.h>
#include <errno.h>
#include <inttypes.h>
*/
#include "exfat.h"
+#include "utf.h"
#include <errno.h>
#include <string.h>
#include <inttypes.h>
#define EXFAT_LITTLE_ENDIAN LITTLE_ENDIAN
#define EXFAT_BIG_ENDIAN BIG_ENDIAN
-#elif defined(__FreeBSD__) || defined(__DragonFlyBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#elif defined(__ANDROID__) || defined(__FreeBSD__) || defined(__DragonFlyBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/endian.h>
#define exfat_bswap16(x) bswap16(x)
}
}
-int utf16_to_utf8(char* output, const le16_t* input, size_t outsize,
+static inline int utf16_to_utf8(char* output, const le16_t* input, size_t outsize,
size_t insize)
{
const le16_t* inp = input;
return output + 2;
}
-int utf8_to_utf16(le16_t* output, const char* input, size_t outsize,
+ static inline int utf8_to_utf16(le16_t* output, const char* input, size_t outsize,
size_t insize)
{
const char* inp = input;
return 0;
}
-size_t utf16_length(const le16_t* str)
+static inline size_t utf16_length(const le16_t* str)
{
size_t i = 0;
*/
#include "exfat.h"
+#include "utf.h"
#include <string.h>
#include <stdio.h>
#include <inttypes.h>
--- /dev/null
+LOCAL_PATH := $(call my-dir)
+
+common_src_files := cbm.c fat.c main.c mkexfat.c rootdir.c uct.c uctc.c vbr.c
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := mkfs.exfat
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -D_FILE_OFFSET_BITS=64
+LOCAL_SRC_FILES := $(common_src_files)
+LOCAL_SHARED_LIBRARIES := libexfat libfuse-lite
+include $(BUILD_EXECUTABLE)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libexfat_mkfs_static
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -D_FILE_OFFSET_BITS=64 -Dmain=mkfs_exfat_main
+LOCAL_SRC_FILES := $(common_src_files)
+LOCAL_C_INCLUDES := external/fuse/include
+LOCAL_STATIC_LIBRARIES := libfuse_static libexfat_static
+include $(BUILD_STATIC_LIBRARY)
#include "cbm.h"
#include "uct.h"
#include "rootdir.h"
+#include <utf.h>
#include <exfat.h>
#include <sys/types.h>
#include <sys/time.h>
#include "uct.h"
#include "cbm.h"
#include "uctc.h"
+#include <utf.h>
#include <string.h>
static off_t rootdir_alignment(void)