GNU Guile bindings to the zstd compression library.

Timothy Sample d9ec4aa028 Test all compressor levels. vor 3 Jahren
build-aux f853c8eb81 Add missing 'test-driver.scm' file. vor 3 Jahren
tests d9ec4aa028 Test all compressor levels. vor 3 Jahren
zstd 7fa9af373c config.scm.in: check for darwin shared library vor 3 Jahren
.dir-locals.el 505002fa2d Add tests. vor 3 Jahren
.gitignore 505002fa2d Add tests. vor 3 Jahren
.guix-authorizations afe022f7a1 Initial commit. vor 3 Jahren
AUTHORS e3e7304772 Add build infrastructure. vor 3 Jahren
COPYING d9e6af2d25 Add README and COPYING. vor 3 Jahren
ChangeLog e3e7304772 Add build infrastructure. vor 3 Jahren
Makefile.am c8d804f389 maint: Add Guix package definition. vor 3 Jahren
NEWS e3e7304772 Add build infrastructure. vor 3 Jahren
README 0d830f53e2 README: Tweak. vor 3 Jahren
configure.ac 9b197a1304 maint: Set version to 0.1.0. vor 3 Jahren
guix.scm c8d804f389 maint: Add Guix package definition. vor 3 Jahren
pre-inst-env.in e3e7304772 Add build infrastructure. vor 3 Jahren
zstd.scm 8bd44c1db7 Properly handle truncated input during decompression. vor 3 Jahren

README

#+TITLE: Guile-zstd: GNU Guile bindings to the zstd compression library

This directory contains bindings to the zstd compression library for
GNU Guile 3.0, 2.2, and 2.0:

https://facebook.github.io/zstd

Zstd (or “zstandard”) offers relatively high compression ratios
(typically better than gzip, not as good as lzip or xz) and a high
decompression throughput (noticeably higher than lzip or gzip).

These bindings provide a high-level port interface for in-process
compression and decompression. Here’s how you would compress a file and
store its result on disk:

#+begin_src scheme
(use-modules (zstd)
(rnrs io ports))

;; Create a compressed archive.
(call-with-output-file "compressed.zst"
(lambda (port)
(call-with-zstd-output-port port
(lambda (port)
(define data
;; Read the input file in memory.
(call-with-input-file "input-file.txt"
get-bytevector-all))

;; Write data to PORT.
(put-bytevector port data)))))
#+end_src

Decompression works similarly:

#+begin_src scheme
(call-with-input-file "compressed.zst"
(lambda (port)
(call-with-zstd-input-port port
(lambda (port)
;; Read decompressed data from PORT.
...))))
#+end_src

* Installing

With GNU Guix, you can install Guile-zstd straight of this source tree
by running:

#+begin_src sh
guix package -f guix.scm
#+end_src

See the =INSTALL= file for instructions on how to build from source
manually.

* Hacking

Using GNU Guix, you can enter a development environment by running:

#+begin_src sh
guix environment -CP -l guix.scm
#+end_src

You can authenticate the code in this repository by running:

#+begin_src sh
guix git authenticate \
afe022f7a1de5517dfeae66705dc21d94f4d2b0a \
3CE464558A84FDC69DB40CFB090B11993D9AEBB5
#+end_src

The command silently exits with zero on success, and errors out
otherwise. We recommend invoking it from ‘.git/hooks/pre-push’.

* Reporting Bugs

Please report bugs to .


Local Variables:
mode: org
ispell-local-dictionary: "american"
End: