11#ifndef __MUTEKI_FS_PATH_H__
12#define __MUTEKI_FS_PATH_H__
25#define BXC_FS_PATH_MAX_CU 256u
30#define BXC_FIND_TS_YEAR(ts) ((ts >> 25) + 1980)
34#define BXC_FIND_TS_MONTH(ts) ((ts >> 21) & 0xf)
38#define BXC_FIND_TS_DAY(ts) ((ts >> 16) & 0x1f)
43#define BXC_FIND_TS_HOUR(ts) ((ts >> 11) & 0x1f)
47#define BXC_FIND_TS_MINUTE(ts) ((ts >> 5) & 0x3f)
51#define BXC_FIND_TS_SECOND(ts) ((ts & 0xf) * 4)
54#define BXC_FNSPLIT_LFN_PATHNAME_MAX 261u
56#define BXC_FNSPLIT_LFN_DRIVE_MAX 4u
58#define BXC_FNSPLIT_LFN_DIRNAME_MAX 257u
60#define BXC_FNSPLIT_LFN_BASENAME_MAX 257u
62#define BXC_FNSPLIT_LFN_SUFFIX_MAX 259u
65#define BXC_FNSPLIT_DOS_PATHNAME_MAX 81u
67#define BXC_FNSPLIT_DOS_DRIVE_MAX 4u
69#define BXC_FNSPLIT_DOS_DIRNAME_MAX 67u
71#define BXC_FNSPLIT_DOS_BASENAME_MAX 10u
73#define BXC_FNSPLIT_DOS_SUFFIX_MAX 9u
91 BXC_FS_ATTR_DEVICE = 0x40,
429extern short _arename(
const char *old_path,
const char *new_path);
466extern int _afnsplit(
const char *pathname,
char *drive,
char *dirname,
char *basename,
char *suffix);
481extern int _afnmerge(
char *pathname,
const char *drive,
const char *dirname,
const char *basename,
const char *suffix);
Common include file for all muteki-shims headers.
#define UTF16
"Portable" Besta UTF-16 type used by other headers.
Definition common.h:54
#define SYS_DWORD
Attribute for structure fields that are DWORD (64-bit), that are used by system calls.
Definition common.h:80
int _wfnsplit(const UTF16 *pathname, UTF16 *drive, UTF16 *dirname, UTF16 *basename, UTF16 *suffix)
Split an LFN pathname into parts.
short _wfsetattr(UTF16 *path, short attrs)
Set attributes of specific path.
short _wfgetattr(UTF16 *path)
Get attributes of specific path.
int _wrmdir(UTF16 *path)
Remove a directory.
#define BXC_FNSPLIT_LFN_BASENAME_MAX
Definition path.h:60
bool _aremove(const char *pathname)
Delete a file.
short _wgetcurdir(void *unk, UTF16 *buf)
Get system CWD value.
short _wfindnext(bxc_find_context_t *ctx)
Continue a previously started file/directory search.
#define BXC_FNSPLIT_DOS_DIRNAME_MAX
Definition path.h:69
#define BXC_FNSPLIT_DOS_PATHNAME_MAX
Definition path.h:65
int _amkdir(char *path)
Create a new directory.
#define BXC_FNSPLIT_DOS_SUFFIX_MAX
Definition path.h:73
int FSGetDiskRoomState(int fsid, bxc_fs_stat_t *fs_stat)
Get filesystem usage stats.
#define BXC_FNSPLIT_LFN_PATHNAME_MAX
Definition path.h:54
struct bxc_fs_parts_lfn_s bxc_fs_parts_lfn_t
All-in-one struct that contain all parts used in _wfnsplit() and _wfnmerge().
int _afnsplit(const char *pathname, char *drive, char *dirname, char *basename, char *suffix)
Split a DOS 8.3 pathname into parts.
#define BXC_FNSPLIT_LFN_DRIVE_MAX
Definition path.h:56
int _afnmerge(char *pathname, const char *drive, const char *dirname, const char *basename, const char *suffix)
Build an DOS 8.3 pathname from parts.
bool __wremove(const UTF16 *pathname)
Delete a file.
short _afindfirst(const char *fnmatch, bxc_find_context_t *ctx, int attrib_mask)
Begin a file/directory search.
short _afsetattr(char *path, short attrs)
Set attributes of specific path.
short _afgetattr(char *path)
Get attributes of specific path.
int _wfnmerge(UTF16 *pathname, const UTF16 *drive, const UTF16 *dirname, const UTF16 *basename, const UTF16 *suffix)
Build an LFN pathname from parts.
short _wchdir(const UTF16 *path)
Change system working directory to a new path.
short _wrename(const UTF16 *old_path, const UTF16 *new_path)
Rename/move a file.
#define BXC_FNSPLIT_DOS_DRIVE_MAX
Definition path.h:67
short _afindnext(bxc_find_context_t *ctx)
Continue a previously started file/directory search.
short _wfindfirst(const UTF16 *fnmatch, bxc_find_context_t *ctx, int attrib_mask)
Begin a file/directory search (LFN support).
short _achdir(const char *path)
Change system working directory to a new path.
short _agetcurdir(void *unk, char *buf)
Get system CWD value.
fs_attribute_e
File/directory attributes.
Definition path.h:80
@ BXC_FS_ATTR_HIDDEN
Definition path.h:84
@ BXC_FS_ATTR_READONLY
Definition path.h:82
@ BXC_FS_ATTR_SYSTEM
Definition path.h:86
@ BXC_FS_ATTR_ARCHIVE
Definition path.h:90
@ BXC_FS_ATTR_DIR
Definition path.h:88
@ BXC_FS_ATTR_NONE
Definition path.h:93
struct bxc_fs_parts_dos_s bxc_fs_parts_dos_t
All-in-one struct that contain all parts used in _afnsplit() and _afnmerge().
#define BXC_FNSPLIT_LFN_SUFFIX_MAX
Definition path.h:62
short _arename(const char *old_path, const char *new_path)
Rename/move a file.
#define BXC_FNSPLIT_LFN_DIRNAME_MAX
Definition path.h:58
int _findclose(bxc_find_context_t *ctx)
Terminate a file/directory search.
int _armdir(char *path)
Remove a directory.
#define BXC_FNSPLIT_DOS_BASENAME_MAX
Definition path.h:71
int _wmkdir(UTF16 *path)
Create a new directory.
Structure for find context.
Definition path.h:99
char * filename
Definition path.h:111
char * filename2_alt
Seems to be a mirror of filename.
Definition path.h:116
UTF16 * filename_lfn
Definition path.h:109
void * unk0
Current file descriptor.
Definition path.h:103
unsigned char attrib_mask
Definition path.h:141
size_t size
Definition path.h:118
unsigned int atime
Access timestamp.
Definition path.h:139
unsigned char attrib
Definition path.h:143
void * unk4
Next file descriptor.
Definition path.h:107
unsigned int btime
Create/birth timestamp.
Definition path.h:134
unsigned int mtime
Modify timestamp.
Definition path.h:128
All-in-one struct that contain all parts used in _afnsplit() and _afnmerge().
Definition path.h:201
char pathname[BXC_FNSPLIT_DOS_PATHNAME_MAX]
Pathname.
Definition path.h:205
char basename[BXC_FNSPLIT_DOS_BASENAME_MAX]
Base name without suffix.
Definition path.h:217
char drive[BXC_FNSPLIT_DOS_DRIVE_MAX]
Drive.
Definition path.h:209
char suffix[BXC_FNSPLIT_DOS_SUFFIX_MAX]
Suffix.
Definition path.h:221
char dirname[BXC_FNSPLIT_DOS_DIRNAME_MAX]
Directory name.
Definition path.h:213
All-in-one struct that contain all parts used in _wfnsplit() and _wfnmerge().
Definition path.h:175
UTF16 suffix[BXC_FNSPLIT_LFN_SUFFIX_MAX]
Suffix.
Definition path.h:195
UTF16 basename[BXC_FNSPLIT_LFN_BASENAME_MAX]
Base name without suffix.
Definition path.h:191
UTF16 drive[BXC_FNSPLIT_LFN_DRIVE_MAX]
Drive.
Definition path.h:183
UTF16 dirname[BXC_FNSPLIT_LFN_DIRNAME_MAX]
Directory name.
Definition path.h:187
UTF16 pathname[BXC_FNSPLIT_LFN_PATHNAME_MAX]
Pathname.
Definition path.h:179
Filesystem usage statistics.
Definition path.h:149
size_t size3_kb
Definition path.h:155
unsigned long long free
Definition path.h:169
unsigned long long size2
Definition path.h:163
unsigned long long size3
Definition path.h:165
size_t size2_kb
Definition path.h:153
size_t size_kb
Definition path.h:151
unsigned long long used
Definition path.h:167
unsigned long long size
Definition path.h:161
size_t free_kb
Definition path.h:159
size_t used_kb
Definition path.h:157