A header only library that is very similar to C++17 std::string_view, but written in C.
mkdir build
cd build
cmake ..
make
Building from previous step will generate two directories, tests and examples. This is where the binaries are stored. Running the examples is as simple as running each outputted binary from the command line. You can easily run the tests with ctest
command like so:
ctest --output-on-failure
The tests can be found in the tests directory and the examples can be found in the examples directory.
The library is header only, so you can easily add it to your project. Copy and paste sv.h into your project. You must also do:
// Do this:
#define SV_IMPLEMENTATION
// before you include this file in *one* C or C++ file to create the implementation.
// i.e. it should look like this:
#include ...
#include ...
#include ...
#define SV_IMPLEMENTATION
#include "sv.h"