mirror of
https://github.com/devkitPro/wut.git
synced 2026-09-11 04:36:02 -05:00
wutdevoptab: Rename all files to *fsa*.cpp
This commit is contained in:
36
libraries/wutdevoptab/devoptab_fsa_diropen.cpp
Normal file
36
libraries/wutdevoptab/devoptab_fsa_diropen.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "devoptab_fsa.h"
|
||||
|
||||
DIR_ITER *
|
||||
__wut_fs_diropen(struct _reent *r,
|
||||
DIR_ITER *dirState,
|
||||
const char *path)
|
||||
{
|
||||
FSDirectoryHandle fd;
|
||||
FSStatus status;
|
||||
FSCmdBlock cmd;
|
||||
__wut_fs_dir_t *dir;
|
||||
|
||||
if (!dirState || !path) {
|
||||
r->_errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *fixedPath = __wut_fs_fixpath(r, path);
|
||||
if (!fixedPath) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FSInitCmdBlock(&cmd);
|
||||
dir = (__wut_fs_dir_t *)(dirState->dirStruct);
|
||||
status = FSOpenDir(__wut_devoptab_fs_client, &cmd, fixedPath, &fd, FS_ERROR_FLAG_ALL);
|
||||
free(fixedPath);
|
||||
if (status < 0) {
|
||||
r->_errno = __wut_fs_translate_error(status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dir->magic = FS_DIRITER_MAGIC;
|
||||
dir->fd = fd;
|
||||
memset(&dir->entry_data, 0, sizeof(dir->entry_data));
|
||||
return dirState;
|
||||
}
|
||||
Reference in New Issue
Block a user