Skip to content

tpathexp v1.1.0

Latest

Choose a tag to compare

@jerily jerily released this 02 Nov 15:54
096b3d1

Native routing and selectable shared/static builds.

  • Add a public C route-table API with compiled route definitions, method masks, named parameters, ordered matching, GET/HEAD handling, and 404/405 results.
  • Implement the Tcl router, dispatch, and Lambda event adapters in C using the same route table. Remove the TclOO implementation and its Tcl source file.
  • Honor BUILD_SHARED_LIBS: ON (default) builds only the loadable module; OFF builds only the static archive. The static package index loads a package registered by the embedding host.
  • Move response construction into the examples. Handlers return ordinary response dictionaries; tpathexp::response is no longer exported.

Migration: embedded hosts can call Tpathexp_Init directly or register Tpathexp with Tcl_StaticPackage and use the installed package index. No Tcl implementation file needs to be sourced. Use separate build/install directories when changing library type.

Validated on Tcl 8.6 and 9.1 in both modes: 48 Tcl tests, native C routing, static embedding and child interpreters, install contents, and the examples. ASan, UBSan, and LeakSanitizer passed. The standalone C route-table example links without Tcl.

Download tpathexp-1.1.0.tar.gz and verify it with SHA256SUMS. Build for your runtime's Tcl ABI, operating system, and architecture:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build --output-on-failure

Add -DBUILD_SHARED_LIBS=OFF to configure a static build. See the README and examples/router.c for the C API.