ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_fs_fat_exfat_dir_internal.h
Go to the documentation of this file.
1
30
31#pragma once
32
33#include "ra8_attributes.h"
35
36/* ===========================================================================
37 * Where a directory is: locations and cursors.
38 * ===========================================================================
39 */
40
64
90void priv_exfat_dir_from_set(const ra8_fs_mount_t* m, const uint8_t* strm, exfat_dir_t* out);
91
115
159 uint32_t cluster,
160 uint32_t contig_end,
161 uint32_t* out_next);
162
163/* ===========================================================================
164 * Which directory a path names.
165 * ===========================================================================
166 */
167
204 const char* path,
205 exfat_dir_t* out_parent,
206 const char** out_leaf);
207
235ra8_err_t priv_exfat_resolve_dir(const ra8_fs_mount_t* m, const char* path, exfat_dir_t* out);
236
267priv_exfat_lookup(const ra8_fs_mount_t* m, const char* path, uint8_t* out_strm, uint8_t* out_attr);
268
269/* ===========================================================================
270 * Making and unmaking a directory.
271 * ===========================================================================
272 */
273
306ra8_err_t priv_exfat_mkdir(const ra8_fs_mount_t* m, const char* path);
307
338ra8_err_t priv_exfat_rmdir(const ra8_fs_mount_t* m, const char* path);
339
340/* ===========================================================================
341 * Finding room for a set, and giving space back.
342 * ===========================================================================
343 */
344
372priv_exfat_bitmap_clear(const ra8_fs_mount_t* m, uint64_t bmp_lba, uint32_t clus, uint32_t count);
373
400ra8_err_t priv_exfat_zero_cluster(const ra8_fs_mount_t* m, uint32_t clus);
401
438ra8_err_t priv_exfat_seal_cluster(const ra8_fs_mount_t* m, uint32_t clus);
439
476 const exfat_dir_t* dir,
477 uint32_t need,
478 uint32_t* out_clus,
479 uint32_t* out_idx);
480
481/* ===========================================================================
482 * Retiring an entry set.
483 * ===========================================================================
484 */
485
512ra8_err_t priv_exfat_drop_set(const ra8_fs_mount_t* m, const exfat_setpos_t* pos, uint32_t count);
513
543ra8_err_t priv_exfat_unlink_at(const ra8_fs_mount_t* m, const exfat_dir_t* dir, const char* name);
544
545/* ===========================================================================
546 * Volume label (the exFAT half of ra8_fs_{get,set}_label).
547 * ===========================================================================
548 */
549
577ra8_err_t priv_exfat_get_label(const ra8_fs_mount_t* m, char* out, uint32_t out_len);
578
606ra8_err_t priv_exfat_set_label(const ra8_fs_mount_t* m, const char* label);
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_err_t priv_exfat_mkdir(const ra8_fs_mount_t *m, const char *path)
Create one exFAT directory at path.
ra8_err_t priv_exfat_seal_cluster(const ra8_fs_mount_t *m, uint32_t clus)
Replace every end-of-directory marker in a cluster with an unused one.
ra8_err_t priv_exfat_get_label(const ra8_fs_mount_t *m, char *out, uint32_t out_len)
Read an exFAT volume's label into an ASCII buffer.
ra8_err_t priv_exfat_rmdir(const ra8_fs_mount_t *m, const char *path)
Remove one EMPTY exFAT directory at path.
ra8_err_t priv_exfat_set_label(const ra8_fs_mount_t *m, const char *label)
Set (or clear) an exFAT volume's label in place.
ra8_err_t priv_exfat_zero_cluster(const ra8_fs_mount_t *m, uint32_t clus)
Zero every sector of one cluster.
ra8_err_t priv_exfat_drop_set(const ra8_fs_mount_t *m, const exfat_setpos_t *pos, uint32_t count)
Retire an entry set by clearing the in-use bit on every entry.
ra8_err_t priv_exfat_find_dir_space(const ra8_fs_mount_t *m, const exfat_dir_t *dir, uint32_t need, uint32_t *out_clus, uint32_t *out_idx)
Find need consecutive free entry slots inside one directory cluster.
ra8_err_t priv_exfat_unlink_at(const ra8_fs_mount_t *m, const exfat_dir_t *dir, const char *name)
Delete a FILE named name from dir.
void priv_exfat_dir_root(const ra8_fs_mount_t *m, exfat_dir_t *out)
Fill out with the volume root's directory location.
ra8_err_t priv_exfat_resolve_dir(const ra8_fs_mount_t *m, const char *path, exfat_dir_t *out)
Resolve a whole path to the directory it names.
ra8_err_t priv_exfat_step_cluster(const ra8_fs_mount_t *m, uint32_t cluster, uint32_t contig_end, uint32_t *out_next)
Compute the cluster that follows cluster in a directory.
void priv_exfat_cursor_init(const exfat_dir_t *dir, exfat_cursor_t *out)
Aim a fresh cursor at the start of dir.
ra8_err_t priv_exfat_lookup(const ra8_fs_mount_t *m, const char *path, uint8_t *out_strm, uint8_t *out_attr)
Resolve a path and return the leaf entry set's location fields.
ra8_err_t priv_exfat_resolve_parent(const ra8_fs_mount_t *m, const char *path, exfat_dir_t *out_parent, const char **out_leaf)
Resolve every component of path but the last.
ra8_err_t priv_exfat_bitmap_clear(const ra8_fs_mount_t *m, uint64_t bmp_lba, uint32_t clus, uint32_t count)
Clear a contiguous cluster run in the allocation bitmap.
void priv_exfat_dir_from_set(const ra8_fs_mount_t *m, const uint8_t *strm, exfat_dir_t *out)
Build a directory location from a Stream entry's allocation fields.
Cross-TU on-disk-layout enums and typedefs for the FAT/exFAT adapter.
Linear cursor over a directory's 32-byte entries.
Identifies the exFAT directory a lookup, scan or link operates in.
Directory position (cluster + entry index) of one 32-byte entry.
Cached parse of one mounted FAT volume.