mirror of
https://github.com/D-Modem/gui.git
synced 2026-11-28 22:30:49 -08:00
ZMODEM with zstd as docs/zmodem-zstd.md of D-Modem specifies, on top of the crash recovery of #22: - core/src/zstd_codec.c: a Zstandard (RFC 8878) encoder and decoder for whole frames, and XXH64, in plain C (a port of the app's Zstd.kt; no libzstd). - xfer_z.c: CANZSTD in ZRINIT ZF1, ZTZSTD in ZFILE ZF2. Each chunk of the file goes as one frame (64 KB, halved after a ZRPOS to 1 KB, doubled after an ACK); the receiver writes only whole frames, so positions stay file offsets and ZRPOS and crash recovery work as before. Files of 0 bytes, with a compressed extension, or whose first 64 KB don't get 5% smaller go as they are. A ZTZSTD file is skipped when we did not set CANZSTD. - dmc_xfer_options.no_zstd stops it, and dmc_xfer_zstd() tells if the file now goes with zstd (the status struct is not changed). - Windows: Transfer > ZMODEM Compression (zstd), on by default, and "(zstd)" after the file name in the progress dialog. - Tests: the specification's vector, XXH64, round trips, against the reference zstd CLI when installed; ZMODEM with zstd in memory (smaller on the line, a noisy line, off on either side, a .zip, resume). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRR1WNeCEtXUcjE8RgY
51 lines
1.2 KiB
CMake
51 lines
1.2 KiB
CMake
# libdmodemctl: what the desktop apps share, in plain C with no
|
|
# dependencies. Static for the Linux app; a DLL for the Windows app's
|
|
# P/Invoke (-DDMODEMCTL_SHARED=ON).
|
|
option(DMODEMCTL_SHARED "Build libdmodemctl as a shared library" OFF)
|
|
|
|
set(DMODEMCTL_SOURCES
|
|
src/session.c
|
|
src/model.c
|
|
src/diag.c
|
|
src/path.c
|
|
src/vt.c
|
|
src/vt_charsets.c
|
|
src/vt_data.c
|
|
src/vt_dec.c
|
|
src/vt_fonts.c
|
|
src/vt_gfx.c
|
|
src/vt_keys.c
|
|
src/vt_machine.c
|
|
src/vt_profiles.c
|
|
src/vt_regis.c
|
|
src/vt_rip.c
|
|
src/vt_vt52.c
|
|
src/daemon.c
|
|
src/voice.c
|
|
src/net.c
|
|
src/util.c
|
|
src/xfer.c
|
|
src/xfer_hex.c
|
|
src/xfer_kermit.c
|
|
src/xfer_xy.c
|
|
src/xfer_z.c
|
|
src/zstd_codec.c)
|
|
|
|
if(DMODEMCTL_SHARED)
|
|
add_library(dmodemctl SHARED ${DMODEMCTL_SOURCES})
|
|
target_compile_definitions(dmodemctl PRIVATE DMC_BUILD_DLL)
|
|
set_target_properties(dmodemctl PROPERTIES C_VISIBILITY_PRESET hidden)
|
|
else()
|
|
add_library(dmodemctl STATIC ${DMODEMCTL_SOURCES})
|
|
endif()
|
|
target_include_directories(dmodemctl PUBLIC include)
|
|
if(MSVC)
|
|
target_compile_options(dmodemctl PRIVATE /W4 /wd4996)
|
|
else()
|
|
target_compile_options(dmodemctl PRIVATE -Wall -Wextra -Wshadow)
|
|
endif()
|
|
if(UNIX)
|
|
find_package(Threads REQUIRED)
|
|
target_link_libraries(dmodemctl PRIVATE m Threads::Threads)
|
|
endif()
|