#include "config.h"
#include "partition.h"
#include "fat16.h"
#include "fat16_config.h"
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | fat16_header_struct |
struct | fat16_fs_struct |
struct | fat16_file_struct |
struct | fat16_dir_struct |
struct | fat16_read_dir_callback_arg |
struct | fat16_usage_count_callback_arg |
Defines | |
#define | FAT16_CLUSTER_FREE 0x0000 |
#define | FAT16_CLUSTER_RESERVED_MIN 0xfff0 |
#define | FAT16_CLUSTER_RESERVED_MAX 0xfff6 |
#define | FAT16_CLUSTER_BAD 0xfff7 |
#define | FAT16_CLUSTER_LAST_MIN 0xfff8 |
#define | FAT16_CLUSTER_LAST_MAX 0xffff |
#define | FAT16_DIRENTRY_DELETED 0xe5 |
#define | FAT16_DIRENTRY_LFNLAST (1 << 6) |
#define | FAT16_DIRENTRY_LFNSEQMASK ((1 << 6) - 1) |
Functions | |
static uint8_t | fat16_read_header (struct fat16_fs_struct *fs) |
static uint16_t | fat16_get_next_cluster (const struct fat16_fs_struct *fs, uint16_t cluster_num) |
static uint16_t | fat16_append_clusters (const struct fat16_fs_struct *fs, uint16_t cluster_num, uint16_t count) |
static uint8_t | fat16_free_clusters (const struct fat16_fs_struct *fs, uint16_t cluster_num) |
static uint8_t | fat16_terminate_clusters (const struct fat16_fs_struct *fs, uint16_t cluster_num) |
static uint8_t | fat16_clear_cluster (const struct fat16_fs_struct *fs, uint16_t cluster_num) |
static uint16_t | fat16_clear_cluster_callback (uint8_t *buffer, uint32_t offset, void *p) |
static uint32_t | fat16_cluster_offset (const struct fat16_fs_struct *fs, uint16_t cluster_num) |
static uint8_t | fat16_dir_entry_read_callback (uint8_t *buffer, uint32_t offset, void *p) |
static uint8_t | fat16_interpret_dir_entry (struct fat16_dir_entry_struct *dir_entry, const uint8_t *raw_entry) |
static uint32_t | fat16_find_offset_for_dir_entry (const struct fat16_fs_struct *fs, const struct fat16_dir_struct *parent, const struct fat16_dir_entry_struct *dir_entry) |
static uint8_t | fat16_write_dir_entry (const struct fat16_fs_struct *fs, struct fat16_dir_entry_struct *dir_entry) |
static uint8_t | fat16_get_fs_free_callback (uint8_t *buffer, uint32_t offset, void *p) |
static void | fat16_set_file_modification_date (struct fat16_dir_entry_struct *dir_entry, uint16_t year, uint8_t month, uint8_t day) |
static void | fat16_set_file_modification_time (struct fat16_dir_entry_struct *dir_entry, uint8_t hour, uint8_t min, uint8_t sec) |
struct fat16_fs_struct * | fat16_open (struct partition_struct *partition) |
void | fat16_close (struct fat16_fs_struct *fs) |
uint8_t | fat16_get_dir_entry_of_path (struct fat16_fs_struct *fs, const char *path, struct fat16_dir_entry_struct *dir_entry) |
struct fat16_file_struct * | fat16_open_file (struct fat16_fs_struct *fs, const struct fat16_dir_entry_struct *dir_entry) |
void | fat16_close_file (struct fat16_file_struct *fd) |
int16_t | fat16_read_file (struct fat16_file_struct *fd, uint8_t *buffer, uint16_t buffer_len) |
int16_t | fat16_write_file (struct fat16_file_struct *fd, const uint8_t *buffer, uint16_t buffer_len) |
uint8_t | fat16_seek_file (struct fat16_file_struct *fd, int32_t *offset, uint8_t whence) |
uint8_t | fat16_resize_file (struct fat16_file_struct *fd, uint32_t size) |
struct fat16_dir_struct * | fat16_open_dir (struct fat16_fs_struct *fs, const struct fat16_dir_entry_struct *dir_entry) |
void | fat16_close_dir (struct fat16_dir_struct *dd) |
uint8_t | fat16_read_dir (struct fat16_dir_struct *dd, struct fat16_dir_entry_struct *dir_entry) |
uint8_t | fat16_reset_dir (struct fat16_dir_struct *dd) |
uint8_t | fat16_create_file (struct fat16_dir_struct *parent, const char *file, struct fat16_dir_entry_struct *dir_entry) |
uint8_t | fat16_delete_file (struct fat16_fs_struct *fs, struct fat16_dir_entry_struct *dir_entry) |
uint8_t | fat16_create_dir (struct fat16_dir_struct *parent, const char *dir, struct fat16_dir_entry_struct *dir_entry) |
void | fat16_get_file_modification_date (const struct fat16_dir_entry_struct *dir_entry, uint16_t *year, uint8_t *month, uint8_t *day) |
void | fat16_get_file_modification_time (const struct fat16_dir_entry_struct *dir_entry, uint8_t *hour, uint8_t *min, uint8_t *sec) |
uint32_t | fat16_get_fs_size (const struct fat16_fs_struct *fs) |
uint32_t | fat16_get_fs_free (const struct fat16_fs_struct *fs) |
Variables | |
static struct fat16_fs_struct | fat16_fs_handles [FAT16_FS_COUNT] |
static struct fat16_file_struct | fat16_file_handles [FAT16_FILE_COUNT] |
static struct fat16_dir_struct | fat16_dir_handles [FAT16_DIR_COUNT] |
Definition in file fat16.c.
#define FAT16_CLUSTER_BAD 0xfff7 |
Definition at line 80 of file fat16.c.
Referenced by fat16_free_clusters(), and fat16_get_next_cluster().
#define FAT16_CLUSTER_FREE 0x0000 |
Definition at line 77 of file fat16.c.
Referenced by fat16_append_clusters(), fat16_free_clusters(), fat16_get_fs_free_callback(), and fat16_get_next_cluster().
#define FAT16_CLUSTER_LAST_MAX 0xffff |
Definition at line 82 of file fat16.c.
Referenced by fat16_append_clusters(), fat16_free_clusters(), fat16_get_next_cluster(), and fat16_terminate_clusters().
#define FAT16_CLUSTER_LAST_MIN 0xfff8 |
Definition at line 81 of file fat16.c.
Referenced by fat16_free_clusters(), and fat16_get_next_cluster().
#define FAT16_CLUSTER_RESERVED_MAX 0xfff6 |
Definition at line 79 of file fat16.c.
Referenced by fat16_free_clusters(), and fat16_get_next_cluster().
#define FAT16_CLUSTER_RESERVED_MIN 0xfff0 |
Definition at line 78 of file fat16.c.
Referenced by fat16_free_clusters(), and fat16_get_next_cluster().
#define FAT16_DIRENTRY_DELETED 0xe5 |
Definition at line 84 of file fat16.c.
Referenced by fat16_delete_file(), fat16_dir_entry_read_callback(), fat16_find_offset_for_dir_entry(), fat16_interpret_dir_entry(), and fat16_write_dir_entry().
#define FAT16_DIRENTRY_LFNLAST (1 << 6) |
struct fat16_dir_struct fat16_dir_handles[FAT16_DIR_COUNT] [static] |
struct fat16_file_struct fat16_file_handles[FAT16_FILE_COUNT] [static] |
struct fat16_fs_struct fat16_fs_handles[FAT16_FS_COUNT] [static] |