BBS:      TELESC.NET.BR
Assunto:  src/syncterm/wren_bind_conn.c wren_bind_conn.h wren_bind_fs.c wren_bin
De:       Deuc¨
Data:     Tue, 28 Apr 2026 19:25:56 -0700
-----------------------------------------------------------
https://gitlab.synchro.net/main/sbbs/-/commit/3da58365d10c2a83c8c4bfb8
Added Files:
	src/syncterm/wren_bind_conn.c wren_bind_conn.h wren_bind_fs.c wren_bind_fs.h wren_bind_hook.c wren_bind_hook.h wren_bind_internal.h wren_bind_screen.c wren_bind_screen.h wren_bind_sftp.c wren_bind_sftp.h
Modified Files:
	src/syncterm/CMakeLists.txt GNUmakefile wren_bind.c
Log Message:
SyncTERM: split wren_bind.c into per-class-group modules

wren_bind.c grew past 5500 lines as Wren foreigns accumulated; split
it into per-class-group .c files so each class group can be read,
edited, and grep'd in isolation.

Layout after split:
  wren_bind.c          1052  BBS + FlowControl, REPL, Clipboard, Timer,
                              Platform, BINDINGS table, lookup_class
  wren_bind_screen.c   1678  Screen, Input, KeyEvent, MouseEvent, Cell,
                              Cells, Font, Hyperlinks, Color, Palette,
                              CustomCursor, VideoFlags
  wren_bind_fs.c       1109  Directory, File, Host (with the live-foreign
                              registry that invalidates open Directory /
                              File foreigns on rename / remove)
  wren_bind_sftp.c      920  SFTP, SFTPEntry, SFTPStat, SFTPHandle,
                              SFTPError + the zero-copy pending  deliver
                              handoff
  wren_bind_hook.c      411  Console (log buffer), Hook (registration
                              entry points + RE1 setjmp catcher),
                              HookHandle (GC-safe entry wrapper)
  wren_bind_conn.c      390  Conn, CTerm, ExtAttr, LastColumnFlag

Stays in wren_bind.c because they touch each other or the VM
internals: BBS owns FlowControl (BBS.flowControl returns a
FlowControl); REPL.compile_ uses wrenCompileSource which isn't
part of wren.h; Timer/Platform/Clipboard are too small to warrant
their own modules.

wren_bind_internal.h holds the shared SWF_* foreign-type tag enum,
the wren_foreign_header that every foreign struct starts with, and
the static inline slot_foreign_type / load_class_into_slot /
wren_throw helpers  pulled into every module so foreigns can
type-check each other across module boundaries.

The single BINDINGS[] table stays in wren_bind.c, walked linearly
by wren_bind_lookup_method (~250 entries  bsearch isn't worth the
maintenance cost of keeping the table sorted).

Co-Authored-By: Claude Opus 4.7 (1M context) 
n
---
  mSynchronetn  hgVertrauen n hHome of Synchronet n gh[vert/cvs/bbs].synchro.net

-----------------------------------------------------------
[Voltar]