TCL bindings for snappy, a fast compressor/decompressor. Use them in TCL or NaviServer as loadable modules.
Download latest stable version on Linux:
wget https://github.com/google/snappy/archive/refs/tags/1.1.10.tar.gz
tar -xzf 1.1.10.tar.gz
cd snappy-1.1.10
Download latest version from git on MacOS:
git clone https://github.com/google/snappy.git
cd snappy
Build and install:
mkdir build
cd build
cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DSNAPPY_BUILD_TESTS=OFF \
-DSNAPPY_BUILD_BENCHMARKS=OFF
make
make install
wget https://github.com/jerily/snappy-tcl/archive/refs/tags/v1.0.4.tar.gz
tar -xzf v1.0.4.tar.gz
export TCL_SNAPPY_DIR=$(pwd)/snappy-tcl-1.0.4
cd ${TCL_SNAPPY_DIR}
mkdir build
cd build
cmake .. \
-DTCL_LIBRARY_DIR=/usr/local/lib \
-DTCL_INCLUDE_DIR=/usr/local/include \
-DSNAPPY_DIR=/usr/local
make
make install
cd ${TCL_SNAPPY_DIR}/
make
make install
- ::snappy::compress bytes
- returns a compressed byte array
- ::snappy::uncompress bytes
- returns an uncompressed byte array
- ::snappy::is_valid_compressed bytes
- returns 1 if the byte array is a valid compressed byte array, 0 otherwise
- ::snappy::max_compressed_length uncompressed_bytes
- returns the maximum length of a compressed byte array
- ::snappy::get_uncompressed_length compressed_bytes
- returns the length of the uncompressed byte array