add basic example for compiling upkr to a c library

This commit is contained in:
2023-03-12 13:45:23 +01:00
parent 080db40d00
commit 795e6c3090
8 changed files with 331 additions and 0 deletions

11
c_library/Readme.md Normal file
View File

@@ -0,0 +1,11 @@
This is a simple example of compiling upkr to a library that can be linked in a
c program. It consists of a small rust crate which implements the c api and
compiles to a static library and a matching c header file. As is, the rust
crate offers two simple functions to compress/uncompress data with the default
upkr config.
The provided makefile will only work on linux. Building the example upkr.c on
other platforms is left as an exercise for the reader ;)
On Windows you might have to make sure to install and use the correct rust
toolchain version (mingw vs. msvc) to match your c compiler.