|
1 | 1 | # libtinyfseq |
2 | 2 |
|
3 | | -A tiny library (~125 LOC) for decoding FSEQ (.fseq) v2.0+ sequence files developed and popularized by |
| 3 | +A single-file library (~150 LOC) for decoding FSEQ (.fseq) v2.0+ sequence files developed and popularized by |
4 | 4 | the [fpp](https://github.com/FalconChristmas/fpp) and [xLights](https://github.com/smeighan/xLights) programs. |
5 | 5 | Additional documentation for the file format is available |
6 | 6 | at [Cryptkeeper/fseq-file-format](https://github.com/Cryptkeeper/fseq-file-format). |
7 | 7 |
|
8 | | -## Installation |
| 8 | +A short example of including libtinyfseq and decoding a file header is available in [`example.c`](example.c). |
9 | 9 |
|
10 | | -You may either install the library, or use `tinyfseq.h` & `tinyfseq.c` directly as a single-file library. libtinyfseq uses [CMake](https://cmake.org/) for building and packaging the library. |
| 10 | +## Installation |
11 | 11 |
|
12 | | -- Generate Makefiles using `cmake .` |
13 | | -- Compile the library using `make` |
14 | | -- Optionally install the headers and compiled archive using `make install` |
15 | | -- Include in your project using `#include <tinyfseq/tinyfseq.h>` |
| 12 | +- Download and copy `tinyfseq.h` into your project locally, or to your toolchain's include paths |
| 13 | +- `#include "tinyfseq.h"` as expected (you may need to modify the path). |
| 14 | +- Define `TINYFSEQ_IMPLEMENTATION` in a SINGLE C/C++ source code |
| 15 | + file ([more information on using single-file libraries](https://github.com/nothings/stb#how-do-i-use-these-libraries)) |
16 | 16 |
|
17 | | -If optionally installed, `install_manifest.txt` will be created, containing the installed file paths for easy removal. |
| 17 | +## Library Configuration |
18 | 18 |
|
19 | | -## Build Configuration |
| 19 | +Prior to including `tinyfseq.h`, two definition based options are available: |
20 | 20 |
|
21 | | -For devices with limited memory, a `TF_INCLUDE_ERR_STRINGS` setting is included in [CMakeLists.txt](CMakeLists.txt) |
22 | | -to disable the inclusion of error strings in the build. Calls to `tf_err_str` will instead return `"NULL"` (as a string). You may also `#define TF_STRIP_ERR_STRINGS` prior to including `tinyfseq.h` to disable error strings without using CMake. |
| 21 | +1. `TINYFSEQ_MEMCPY` allows you to override the selected `memcpy` function with whatever is best for your platform ( |
| 22 | + currently a basic freestanding implementation, `tf_memcpy_impl`) |
| 23 | +2. `TINYFSEQ_STRIP_ERR_STRINGS` replaces all literal strings returned by `tf_err_str` with `"NULL"` (as a string) to |
| 24 | + reduce the compiled binary size |
23 | 25 |
|
24 | 26 | ## Compatibility |
25 | 27 |
|
| 28 | +- libtinyfseq uses `stdint.h` for fixed-size int types |
26 | 29 | - libtinyfseq only supports FSEQ versions v2.x versions, with the schema initially released in 2018. Older v1.x files |
27 | 30 | can be upgraded using the [xLights](https://github.com/smeighan/xLights) program. |
28 | | -- To minimize dependencies, libtinyfseq does not support compressed FSEQ files as they may use both |
29 | | - [zstd](https://github.com/facebook/zstd) and [zlib](https://www.zlib.net) |
30 | | - compression. Compressed FSEQ files can be pre-decompressed using the [xLights](https://github.com/smeighan/xLights) |
31 | | - program, or you may decompress the data buffer yourself using an additional library before passing it to |
32 | | - libtinyfseq. |
33 | | -- libtinyfseq assumes data buffers are in little endian byte order. |
34 | 31 |
|
35 | 32 | ## Usage |
36 | 33 |
|
|
0 commit comments