On server, channel dprint through the readline-device. Also some refactors and quality improvements.

This commit is contained in:
2026-01-09 14:28:58 -05:00
parent 1087d18a2e
commit 7fa3f39d72
15 changed files with 258 additions and 253 deletions

View File

@@ -1,7 +1,6 @@
#include "drvutil.hpp"
#include "osdrvutil.hpp"
#include "sslutil.hpp"
#include "readline.hpp"
#include "../core/enginewrapper.hpp"
@@ -220,21 +219,8 @@ static int socket_poll(struct pollfd *pollvec, int pollcount, int mstimeout, std
}
// Write unicode onto the console.
static void console_write(const std::u32string &cps) {
std::string utf8 = drvutil::utf32_to_utf8(cps);
write(1, utf8.c_str(), utf8.size());
}
static std::u32string console_read() {
std::u32string result;
char buffer[512];
int nread = read(0, buffer, 512);
if (nread > 0) {
std::string_view s(buffer, nread);
result = drvutil::utf8_to_utf32(s, nullptr);
}
return result;
}
static void call_init_engine_wrapper(const std::filesystem::path &luprexroot, EngineWrapper *w) {
using InitFn = void (*)(EngineWrapper *);