TNT/include
m1ngsama 7897d8820e refactor: extract client module (PR2-M6)
Move client_t I/O and lifecycle out of ssh_server.c into a dedicated
module.  ssh_server.c is now down to the listening socket, host key
setup, ssh_server_init / ssh_server_start, and the accept loop.

Migrated to client.{c,h}:
- client_send, client_printf
- client_addref, client_release (and the ssh_session / ssh_channel /
  channel_cb teardown that fires on the final release)
- client_install_channel_callbacks
- client_channel_window_change / _eof / _close (the post-bootstrap
  callbacks that target the client_t)

The client_t struct definition stays in ssh_server.h so we don't have
to revisit every existing #include chain.  bootstrap, commands, exec,
input, and tui pick up the new client.h alongside their existing
ssh_server.h include.

ssh_server.c shrinks from 402 to 249 lines (-153).

Final per-module size after PR2:
  ssh_server.c   249  accept loop + ssh_server_init/start + host key
  bootstrap.c    493  per-connection SSH handshake / auth / channel
  client.c       162  client_t I/O + lifecycle + channel callbacks
  input.c        637  username read + handle_key + main loop +
                      notify_mentions + idle timeout
  commands.c     269  vim ':' command dispatcher
  exec.c         453  SSH exec subcommand dispatcher
  ratelimit.c    197  IP rate limit + connection counters
  tui.c          614  screen rendering
  chat_room.c    151  room + client list
  message.c      350  message log load/save/search
  utf8.c         250  UTF-8 width / validation
  common.c       133  buffer_*, env_int, is_valid_username,
                      sanitize_terminal_size, tnt_state_*
  main.c         109  process entry

Total: ~4 000 lines of C across 13 files, no file over 650 lines, every
file is single-purpose.  Behaviour is preserved: the migrated code is
byte-for-byte identical.
2026-05-17 10:16:27 +08:00
..
.gitkeep Initial commit 2025-07-01 09:00:00 +08:00
bootstrap.h refactor: extract input module (PR2-M5) 2026-05-17 10:01:48 +08:00
chat_room.h feat: consolidated improvements, manpage, and deployment prep 2026-04-19 17:49:06 +08:00
client.h refactor: extract client module (PR2-M6) 2026-05-17 10:16:27 +08:00
commands.h refactor: extract commands module (PR2-M3) 2026-05-17 09:26:48 +08:00
common.h refactor: extract bootstrap module (PR2-M4) 2026-05-17 09:47:28 +08:00
exec.h refactor: extract exec module (PR2-M2) 2026-05-17 08:49:58 +08:00
input.h refactor: extract input module (PR2-M5) 2026-05-17 10:01:48 +08:00
message.h feat: add :last, :search, :mute-joins commands and MOTD support 2026-04-23 12:03:27 +08:00
ratelimit.h refactor: extract ratelimit module (PR2-M1) 2026-05-16 23:06:56 +08:00
ssh_server.h refactor: extract client module (PR2-M6) 2026-05-17 10:16:27 +08:00
tui.h Replace telnet with SSH and fix full-screen display 2025-11-24 16:48:14 +08:00
utf8.h refactor: stabilize SSH runtime and add exec interface 2026-03-10 18:52:20 +08:00