aboutsummaryrefslogtreecommitdiff
path: root/libs/usvfs/src/usvfs_dll/sharedparameters.cpp
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-12 02:40:16 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-12 02:40:16 -0500
commitbf7a57fc55493247a624ecfd65e4d73964e7d8d2 (patch)
tree0a4b2d6123672768187a5ab863e63cd3f21bb319 /libs/usvfs/src/usvfs_dll/sharedparameters.cpp
parente0fb66428a9b78b4c326df8d7e30429a5b271d74 (diff)
Remove vendored usvfs and Windows-only usvfs code paths
The Linux port uses its own in-process FUSE VFS (FuseConnector), so usvfs was dead weight: libs/usvfs/ was never built, usvfsconnector.cpp was explicitly REMOVE_ITEM'd from the source list, and every call site was already guarded by #ifdef _WIN32 with a working Linux branch (the Windows build is also broken on this branch, since FUSE3 is a hard find_package dependency). - Drop libs/usvfs/ and src/src/usvfsconnector.{cpp,h} - Collapse #ifdef _WIN32 / usvfs include branches in organizercore, mainwindow, settings, util, spawn - Remove getUsvfsVersionString() and the "usvfs: ..." log field - Remove vfs32/64DLLName APPPARAMs (nothing reads them) - Relabel About dialog "usvfs:" row to "VFS: FUSE 3"
Diffstat (limited to 'libs/usvfs/src/usvfs_dll/sharedparameters.cpp')
-rw-r--r--libs/usvfs/src/usvfs_dll/sharedparameters.cpp264
1 files changed, 0 insertions, 264 deletions
diff --git a/libs/usvfs/src/usvfs_dll/sharedparameters.cpp b/libs/usvfs/src/usvfs_dll/sharedparameters.cpp
deleted file mode 100644
index 95cd0b2..0000000
--- a/libs/usvfs/src/usvfs_dll/sharedparameters.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-#include <logging.h>
-#include <sharedparameters.h>
-#include <usvfsparametersprivate.h>
-
-namespace usvfs
-{
-
-ForcedLibrary::ForcedLibrary(const std::string& process, const std::string& path,
- const shared::VoidAllocatorT& alloc)
- : m_processName(process.begin(), process.end(), alloc),
- m_libraryPath(path.begin(), path.end(), alloc)
-{}
-
-std::string ForcedLibrary::processName() const
-{
- return {m_processName.begin(), m_processName.end()};
-}
-
-std::string ForcedLibrary::libraryPath() const
-{
- return {m_libraryPath.begin(), m_libraryPath.end()};
-}
-
-SharedParameters::SharedParameters(const usvfsParameters& reference,
- const shared::VoidAllocatorT& allocator)
- : m_instanceName(reference.instanceName, allocator),
- m_currentSHMName(reference.currentSHMName, allocator),
- m_currentInverseSHMName(reference.currentInverseSHMName, allocator),
- m_debugMode(reference.debugMode), m_logLevel(reference.logLevel),
- m_crashDumpsType(reference.crashDumpsType),
- m_crashDumpsPath(reference.crashDumpsPath, allocator),
- m_delayProcess(reference.delayProcessMs), m_userCount(1),
- m_processBlacklist(allocator), m_processList(allocator),
- m_fileSuffixSkipList(allocator), m_directorySkipList(allocator),
- m_forcedLibraries(allocator)
-{}
-
-usvfsParameters SharedParameters::makeLocal() const
-{
- bi::scoped_lock lock(m_mutex);
-
- return usvfsParameters(m_instanceName.c_str(), m_currentSHMName.c_str(),
- m_currentInverseSHMName.c_str(), m_debugMode, m_logLevel,
- m_crashDumpsType, m_crashDumpsPath.c_str(),
- m_delayProcess.count());
-}
-
-std::string SharedParameters::instanceName() const
-{
- bi::scoped_lock lock(m_mutex);
- return {m_instanceName.begin(), m_instanceName.end()};
-}
-
-std::string SharedParameters::currentSHMName() const
-{
- bi::scoped_lock lock(m_mutex);
- return {m_currentSHMName.begin(), m_currentSHMName.end()};
-}
-
-std::string SharedParameters::currentInverseSHMName() const
-{
- bi::scoped_lock lock(m_mutex);
- return {m_currentInverseSHMName.begin(), m_currentInverseSHMName.end()};
-}
-
-void SharedParameters::setSHMNames(const std::string& current,
- const std::string& inverse)
-{
- bi::scoped_lock lock(m_mutex);
-
- m_currentSHMName.assign(current.begin(), current.end());
- m_currentInverseSHMName.assign(inverse.begin(), inverse.end());
-}
-
-void SharedParameters::setDebugParameters(LogLevel level, CrashDumpsType dumpType,
- const std::string& dumpPath,
- std::chrono::milliseconds delayProcess)
-{
- bi::scoped_lock lock(m_mutex);
-
- m_logLevel = level;
- m_crashDumpsType = dumpType;
- m_crashDumpsPath.assign(dumpPath.begin(), dumpPath.end());
- m_delayProcess = delayProcess;
-}
-
-std::size_t SharedParameters::userConnected()
-{
- bi::scoped_lock lock(m_mutex);
- return ++m_userCount;
-}
-
-std::size_t SharedParameters::userDisconnected()
-{
- bi::scoped_lock lock(m_mutex);
- return --m_userCount;
-}
-
-std::size_t SharedParameters::userCount()
-{
- bi::scoped_lock lock(m_mutex);
- return m_userCount;
-}
-
-std::size_t SharedParameters::registeredProcessCount() const
-{
- bi::scoped_lock lock(m_mutex);
- return m_processList.size();
-}
-
-std::vector<DWORD> SharedParameters::registeredProcesses() const
-{
- bi::scoped_lock lock(m_mutex);
- return {m_processList.begin(), m_processList.end()};
-}
-
-void SharedParameters::registerProcess(DWORD pid)
-{
- bi::scoped_lock lock(m_mutex);
- m_processList.insert(pid);
-}
-
-void SharedParameters::unregisterProcess(DWORD pid)
-{
- {
- bi::scoped_lock lock(m_mutex);
-
- auto itor = m_processList.find(pid);
-
- if (itor != m_processList.end()) {
- m_processList.erase(itor);
- return;
- }
- }
-
- spdlog::get("usvfs")->error("cannot unregister process {}, not in list", pid);
-}
-
-void SharedParameters::blacklistExecutable(const std::string& name)
-{
- bi::scoped_lock lock(m_mutex);
-
- m_processBlacklist.insert(
- shared::StringT(name.begin(), name.end(), m_processBlacklist.get_allocator()));
-}
-
-void SharedParameters::clearExecutableBlacklist()
-{
- bi::scoped_lock lock(m_mutex);
- m_processBlacklist.clear();
-}
-
-bool SharedParameters::executableBlacklisted(const std::string& appName,
- const std::string& cmdLine) const
-{
- bool blacklisted = false;
- std::string log;
-
- {
- bi::scoped_lock lock(m_mutex);
-
- for (const shared::StringT& sitem : m_processBlacklist) {
- const auto item = "\\" + std::string(sitem.begin(), sitem.end());
-
- if (!appName.empty()) {
- if (boost::algorithm::iends_with(appName, item)) {
- blacklisted = true;
- log = std::format("application {} is blacklisted", appName);
- break;
- }
- }
-
- if (!cmdLine.empty()) {
- if (boost::algorithm::icontains(cmdLine, item)) {
- blacklisted = true;
- log = std::format("command line {} is blacklisted", cmdLine);
- break;
- }
- }
- }
- }
-
- if (blacklisted) {
- spdlog::get("usvfs")->info(log);
- return true;
- }
-
- return false;
-}
-
-void SharedParameters::addSkipFileSuffix(const std::string& fileSuffix)
-{
- bi::scoped_lock lock(m_mutex);
-
- m_fileSuffixSkipList.insert(shared::StringT(fileSuffix.begin(), fileSuffix.end(),
- m_fileSuffixSkipList.get_allocator()));
-}
-
-void SharedParameters::clearSkipFileSuffixes()
-{
- bi::scoped_lock lock(m_mutex);
- m_fileSuffixSkipList.clear();
-}
-
-std::vector<std::string> SharedParameters::skipFileSuffixes() const
-{
- bi::scoped_lock lock(m_mutex);
- return {m_fileSuffixSkipList.begin(), m_fileSuffixSkipList.end()};
-}
-
-void SharedParameters::addSkipDirectory(const std::string& directory)
-{
- bi::scoped_lock lock(m_mutex);
-
- m_directorySkipList.insert(shared::StringT(directory.begin(), directory.end(),
- m_directorySkipList.get_allocator()));
-}
-
-void SharedParameters::clearSkipDirectories()
-{
- bi::scoped_lock lock(m_mutex);
- m_directorySkipList.clear();
-}
-
-std::vector<std::string> SharedParameters::skipDirectories() const
-{
- bi::scoped_lock lock(m_mutex);
- return {m_directorySkipList.begin(), m_directorySkipList.end()};
-}
-
-void SharedParameters::addForcedLibrary(const std::string& processName,
- const std::string& libraryPath)
-{
- bi::scoped_lock lock(m_mutex);
-
- m_forcedLibraries.push_front(
- ForcedLibrary(processName, libraryPath, m_forcedLibraries.get_allocator()));
-}
-
-std::vector<std::string>
-SharedParameters::forcedLibraries(const std::string& processName)
-{
- std::vector<std::string> v;
-
- {
- bi::scoped_lock lock(m_mutex);
-
- for (const auto& lib : m_forcedLibraries) {
- if (boost::algorithm::iequals(processName, lib.processName())) {
- v.push_back(lib.libraryPath());
- }
- }
- }
-
- return v;
-}
-
-void SharedParameters::clearForcedLibraries()
-{
- bi::scoped_lock lock(m_mutex);
- m_forcedLibraries.clear();
-}
-
-} // namespace usvfs