canfigger v0.3.x
Lightweight config file parser library
|
![codeql-badge] ![actions-c-badge] ![cirrus-badge]
Canfigger is a lightweight C language library designed to parse configuration files. It provides functionality to read them and represent their contents as a linked list of key-value pairs, along with associated attributes for each pair.
The following config file example represents the format handled by canfigger:
You can change the attribute delimiter character by passing it as the second argument:
canfigger_parse_file(filename_ptr, ':');
None
meson setup _build cd _build ninja
For configuration options, use meson configure
(see the Meson docs for detailed usage).
meson test (-v)
An example program will be built when you run ninja
. It will read examplerc
in the source root directory. If you want to try it with a different config file, give example
the name of a config file as an argument.
If canfigger is not available for your operating system or distribution, you can copy the required sources (and the LICENSE file) into your project and add them to your build system. The line include <config.h>
from the top of the .c file will need to be removed, as it is normally generated during the Meson setup and only contains version information.
Alternatively, if your project uses Meson, you can add a wrap file for canfigger in your 'subprojects' directory.