canfigger icon indicating copy to clipboard operation
canfigger copied to clipboard

Simple configuration file parser library

canfigger v0.2.0999

Simple configuration file parser library

codeql-badge actions-c-badge

website: https://github.com/andy5995/canfigger

This library contains a function that parses simple configuration files that use a key/value pair with optional attributes.

foo = bar
blue = color, shiny
statement = hello world, obvious

# An option with no value or attributes
FeatureFooEnabled

# key, value with 2 attributes
dhcp-range = 192.168.0.50, 192.168.0.150, 12

# key, value with 9 attributes
solar_system = sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Neptune, Uranus, Pluto

API documentation

See the annotated declarations in /canfigger.h

Examples

Building

meson _build
cd _build
ninja

By default, only the shared library will get built. To build both:

meson configure -Ddefault_library=both

or to only build the static library:

meson configure -Ddefault_libary=static

And then run ninja.

Run the tests

ninja test
meson test --setup=valgrind (requires valgrind to be installed)

Install/Uninstall

ninja install

Or if you want to install without superuser privileges, first run

meson -Dprefix=$HOME/.local _build
ninja uninstall

Projects using canfigger