Run all examples with:
make examples
./examples/01_hello_world- 01_hello_world.c - Smallest possible usage The "compress a string, decompress it back" tutorial.
- 02_compress_file.c - File operations Take any text file, compress it, and time it.
- 03_embedded_mode.c - Self-contained
.loxcfiles When you cannot ship a separate table. - 04_error_handling.c - Robust error handling What errors mean and how to react to them.
- 05_training_pipeline.c - Train your own module End-to-end from raw corpus to working compression.
- 06_compare_modes.c - External vs embedded trade-off See the size difference between modes.
- 07_streaming_chunks.c - Working with large files Current limitations and workarounds.
loxc_ctx_t *ctx = loxc_open("table.loxctab");
loxc_compress_file(ctx, "in.txt", "out.loxc", 0);
loxc_close(ctx);loxc_buffer_t compressed = loxc_compress_buffer(ctx, data, len, 0);
loxc_buffer_t restored =
loxc_decompress_buffer(ctx, compressed.data, compressed.size);
loxc_buffer_free(&compressed);
loxc_buffer_free(&restored);loxc_buffer_t out = loxc_compress_buffer(ctx, data, len, 1);
/* Write out.data to disk - it has everything needed to decompress */