{
FS_PathType type; ///< FS path type.
u32 size; ///< FS path size.
- const u8* data; ///< Pointer to FS path data.
+ const void* data; ///< Pointer to FS path data.
} FS_Path;
/// FS archive.
/// Exits FS.
void fsExit(void);
+/**
+ * Creates an FS_Path instance.
+ * @param type Type of path.
+ * @param path Path to use.
+ * @return The created FS_Path instance.
+ */
+FS_Path fsMakePath(FS_PathType type, const void* path);
+
/**
* @brief Gets the current FS session handle.
* @return The current FS session handle.
svcCloseHandle(fsuHandle);
}
+FS_Path fsMakePath(FS_PathType type, const void* path)
+{
+ FS_Path p = { type, 0, path };
+ switch (type)
+ {
+ case PATH_ASCII:
+ p.size = strlen((const char*)path)+1;
+ break;
+ case PATH_UTF16:
+ {
+ const u16* str = (const u16*)path;
+ while (*str++) p.size++;
+ p.size++;
+ break;
+ }
+ case PATH_EMPTY:
+ p.size = 1;
+ p.data = "";
+ default:
+ break;
+ }
+ return p;
+}
+
Handle* fsGetSessionHandle(void)
{
return &fsuHandle;