clean up and standardize types across the codebase, unify atomic operations, improve UTF-8 handling throughout the system, remove obsolete input and named queue interfaces, redesign process preparation and creation, tighten IPC and service boundaries, improve error handling and reliability, minor documentation cleanup, fix doom surfaces, fix panic in ini parsing.

This commit is contained in:
maksw committed 2026-10-12 18:17:43 +02:00
1 parent 899225f551
commit c0ad63c27f
226 files changed
+6562 -4147

No files matched your search

+18 -14
View File
@@ -25,6 +25,10 @@ static void readLine(char* buf, int len) {
while (true) {
char c; if (read(hIn, &c, 1) <= 0) break;
if (c == '\r' || c == '\n') { print("\n"); break; }
if (c == '\x1B') {
while (pos > 0) { --pos; print("\b \b"); }
continue;
}
if ((c == '\b' || c == 127) && pos > 0) { pos--; print("\b \b"); continue; }
if (c < 0x20 || c == 127) continue;
if (pos < len - 1) { buf[pos++] = c; char echo[2] = {c, '\0'}; print(echo); }
@@ -190,18 +194,18 @@ static void cmd_type(const char* filename) {
}
// Runs command.
static int runCommand(const char* cmd) {
if (!cmd || *cmd == '\0') return 0;
if (strcmp(cmd, "exit") == 0) return 1;
if (strcmp(cmd, "help") == 0) { cmd_help(); return 0; }
if (strcmp(cmd, "clear") == 0) { clearscreen(); return 0; }
if (strcmp(cmd, "crash") == 0) { *(volatile int*)0 = 42; return 0; }
if (strcmp(cmd, "dir") == 0) { cmd_dir("."); return 0; }
if (strncmp(cmd, "dir ", 4) == 0) { cmd_dir(cmd + 4); return 0; }
if (strncmp(cmd, "cd ", 3) == 0) { if (chdir(cmd + 3) != 0) print("cd: failed\n"); return 0; }
if (strncmp(cmd, "del ", 4) == 0) { unlink(cmd + 4); return 0; }
if (strncmp(cmd, "type ", 5) == 0) { cmd_type(cmd + 5); return 0; }
if (strncmp(cmd, "write ", 6) == 0) { cmd_write(cmd + 6); return 0; }
static bool runCommand(const char* cmd) {
if (!cmd || *cmd == '\0') return false;
if (strcmp(cmd, "exit") == 0) return true;
if (strcmp(cmd, "help") == 0) { cmd_help(); return false; }
if (strcmp(cmd, "clear") == 0) { clearscreen(); return false; }
if (strcmp(cmd, "crash") == 0) { *(volatile int*)0 = 42; return false; }
if (strcmp(cmd, "dir") == 0) { cmd_dir("."); return false; }
if (strncmp(cmd, "dir ", 4) == 0) { cmd_dir(cmd + 4); return false; }
if (strncmp(cmd, "cd ", 3) == 0) { if (chdir(cmd + 3) != 0) print("cd: failed\n"); return false; }
if (strncmp(cmd, "del ", 4) == 0) { unlink(cmd + 4); return false; }
if (strncmp(cmd, "type ", 5) == 0) { cmd_type(cmd + 5); return false; }
if (strncmp(cmd, "write ", 6) == 0) { cmd_write(cmd + 6); return false; }
char cmdBuf[MAX_CMD];
strncpy(cmdBuf, cmd, MAX_CMD - 1);
@@ -209,14 +213,14 @@ static int runCommand(const char* cmd) {
char* argv[32];
int argc = splitCommandLine(cmdBuf, argv, 32);
if (argc == 0) return 0;
if (argc == 0) return false;
int pid;
if (posix_spawn(&pid, argv[0], NULL, NULL, argv, NULL) == 0) {
int status; waitpid(pid, &status, 0);
clearkeyboard();
} else { print("shell: launch failed\n"); }
return 0;
return false;
}
// Runs the requested operation.