[loader] Add nxlink log server mode

This commit is contained in:
xbzk
2026-08-01 12:35:45 -03:00
parent b468602ffa
commit 44c0815dcd
6 changed files with 236 additions and 9 deletions
+10 -3
View File
@@ -8,16 +8,23 @@
#include <string>
#include <string_view>
#include "common/settings_enums.h"
namespace Loader::HomebrewNxlink {
constexpr size_t ArgvMarkerSize = 16;
constexpr std::string_view ArgvMarkerSuffix = "_NXLINK_";
constexpr std::string_view LoopbackArgvMarker = "0100007F_NXLINK_";
// This module handles only the libnx argv marker. Client stream handling should be an
// explicit byte-sink API; the marker alone must not imply logging.
bool IsArgvMarker(std::string_view token);
bool IsLoopbackArgvMarker(std::string_view token);
std::optional<std::string> GetArgvMarker(std::string_view argv_string);
std::optional<std::string> PrepareArgv(std::string& argv_string,
std::string_view inherited_marker);
std::string_view inherited_marker,
bool append_loopback_marker = false);
void ApplyServerMode(Settings::HomebrewNxlinkServerMode mode,
const std::optional<std::string>& active_marker);
void StopServer();
} // namespace Loader::HomebrewNxlink