mirror of
https://github.com/libretro/parallel-ps2.git
synced 2026-11-09 11:31:34 -10:00
FileSystem::FindFiles filled a std::vector of entries holding
std::string names, walking the tree with std::string paths; HostFS.h
pulled <string> and <vector> into the sixteen files that include it,
most of them for the path separator alone.
HostFS.cpp is now HostFS.c, C89, with the same walk and filters:
FileSystem_FindFiles fills a FILESYSTEM_FIND_RESULTS array whose names
it mallocs, FileSystem_FreeFindResults frees them, and KEEP_ARRAY keeps
what is there as before. The header is C with extern "C" for its C++
includers. The IOP host directory listing owns its results and walks
them by index; the BIOS search and the BIOS core option free theirs
when done. An unused path-append template went with the .cpp.
A tree built before this has HostFS.o made from the .cpp and a depfile
naming it, which stops the build ("No rule to make target") or, with
the depfile gone, links the C++ object. The Makefile now drops, before
reading the depfiles, the depfile and object of any C source whose
depfile still names a .cpp, so a rename from C++ to C rebuilds.
tests/hostfs builds HostFS.c as C89 and walks a real folder through
libretro-common: files and folders as the flags select, hidden entries
only when asked, a wildcard, an exact name, full and relative paths,
the recursive walk not entering a hidden folder unless asked, KEEP_ARRAY,
a broken link left out, a missing folder, and the results freed and
reused. The same checks pass against the C++ version it replaces.