• src/syncterm/Wren.adoc src/syncterm/scripts/syncterm.wren wrentest.wre

    From Deucе@1:103/705 to Git commit to main/sbbs/master on Tue Apr 28 09:22:53 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/b743852183205e720d9cc8f1
    Modified Files:
    src/syncterm/Wren.adoc src/syncterm/scripts/syncterm.wren wrentest.wren src/syncterm/wren_bind.c
    Log Message:
    SyncTERM: File.readLine + File.writeLine

    readLine() reads from the current offset to the first LF (0x0A) or
    EOF and returns the bytes with any trailing LF removed. Offset
    advances past the LF on a hit, or to EOF if none found. Returns
    null when already at EOF so a typical loop terminates cleanly; a
    blank line is the empty string, distinct from EOF.

    writeLine(s) writes the bytes of s at the current offset, then
    appends an LF. Offset advances past the LF. No special-casing if
    s already ends in LF — writeBytes() is the way to opt out of the
    trailing-LF behavior.

    Implementation chunks reads through a 512-byte buffer with
    geometric growth on long lines, so a 100GB file with short lines
    doesn't allocate the whole remainder up front.

    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Tue Apr 28 17:47:40 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/9f1ed0221b7e8d4c67967ede
    Modified Files:
    src/syncterm/Wren.adoc src/syncterm/scripts/syncterm.wren wrentest.wren src/syncterm/wren_bind.c
    Log Message:
    SyncTERM: File.sha1 / File.md5 + missing docs and tests

    File.sha1 and File.md5 hash the file's full content via xpmap and
    the existing src/hash sha1.c / md5.c. Zero-length files are
    special-cased to an empty buffer because xpmap rejects 0-sized
    maps. Returned as raw digest bytes (Wren strings are byte-safe)
    so they compare directly against SFTPEntry.hash from the
    sha1s@syncterm.net / md5s@syncterm.net SFTP extensions; format hex
    yourself if you need it for display.

    Also catches Wren.adoc + wrentest.wren up to recent work that
    shipped without docs / tests:

    - New Wren.adoc sections for Platform, Timer (+ TimerElapsed), SFTP
    (+ FileFlag, SFTPEntry, SFTPStat, SFTPHandle, SFTPError, and the
    shared async-op pattern used by Timer / SFTP / Input.nextEvent).
    File doc gets the sha1 / md5 row added.

    - wrentest.wren coverage:
    Platform.name returns non-empty String.
    File.sha1 / File.md5 of an empty file (exercises the
    zero-length code path) and of "hello" (exercises xpmap).
    Timer.trigger(ms=0) parks a fiber, the doterm sweep marks it
    past-due, the drain resumes with a TimerElapsed.

    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)