aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/libghostty-vt/src/simd/base64.cpp
diff options
context:
space:
mode:
authorsl0p <sl0p@sl0p.foo>2026-08-13 22:00:03 +0200
committersl0p <sl0p@sl0p.foo>2026-08-13 22:00:03 +0200
commit2c1b855c3cf8cf8841bf25cd939e478a7f0bfac8 (patch)
tree7cd6274303ba1da1f8bd57371aec336dd687fb58 /vendor/libghostty-vt/src/simd/base64.cpp
downloadslosh-2c1b855c3cf8cf8841bf25cd939e478a7f0bfac8.tar.gz
slosh-2c1b855c3cf8cf8841bf25cd939e478a7f0bfac8.tar.xz
slosh-2c1b855c3cf8cf8841bf25cd939e478a7f0bfac8.zip
sl0ptty: M0 — libghostty-vt vendored, one pane, compositor, diff renderer
Design contract in DESIGN.md. libghostty-vt vendored fresh from ghostty main@bedb6f2 (zig 0.16), built to a 14MB static lib. M0: pty spawn (no libutil), a lib-vt terminal per pane, a screen cell buffer, a diff emitter that repaints only what changed, raw mode, SIGWINCH, and a ~120Hz frame cap that coalesces pty reads. Also the seed of the headless harness: --headless dumps the composited screen without a tty, so composition is testable in milliseconds. tests/live_m0.py covers what headless cannot: raw mode, the diff emitter, resize propagation, and the quit path. 6/6 green.
Diffstat (limited to 'vendor/libghostty-vt/src/simd/base64.cpp')
-rw-r--r--vendor/libghostty-vt/src/simd/base64.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/simd/base64.cpp b/vendor/libghostty-vt/src/simd/base64.cpp
new file mode 100644
index 0000000..63f26b5
--- /dev/null
+++ b/vendor/libghostty-vt/src/simd/base64.cpp
@@ -0,0 +1,20 @@
+#include <simdutf.h>
+
+extern "C" {
+
+size_t ghostty_simd_base64_max_length(const char* input, size_t length) {
+ return simdutf::maximal_binary_length_from_base64(input, length);
+}
+
+size_t ghostty_simd_base64_decode(const char* input,
+ size_t length,
+ char* output) {
+ simdutf::result r = simdutf::base64_to_binary(input, length, output);
+ if (r.error) {
+ return -1;
+ }
+
+ return r.count;
+}
+
+} // extern "C"