https://github.com/slayers-git/slconfig
Unix configuration file parser
https://github.com/slayers-git/slconfig
c89 config configuration-files parser
Last synced: about 1 year ago
JSON representation
Unix configuration file parser
- Host: GitHub
- URL: https://github.com/slayers-git/slconfig
- Owner: slayers-git
- License: gpl-2.0
- Created: 2021-07-12T10:51:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-13T16:39:56.000Z (over 4 years ago)
- Last Synced: 2025-02-12T01:41:25.220Z (about 1 year ago)
- Topics: c89, config, configuration-files, parser
- Language: C
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SLConfig
SLConfig is a simple config parser library written in C89, it can be used to parse standart UNIX configuration files with some additional functionality added (optionally).
## Features
- Optionally enviromental variables can be obtained and set to a key
- Optional variables inside of the configuration files
## Example configuration file syntax
```
# standart UNIX configuration syntax:
# comment
key1 = value
key2 = "value within quotes"
# optional functionality:
shell_of_choice = ${SHELL} # example usage of enviromental variables
# example usage of variables
$prefix = "[myprefix]"
error = $(prefix)" error: "
warn = $(prefix)" warning: "
```
Example C implementation can be found in `example.c` file
## Building
To build and install SLConfig library on a \*nix system, in your shell type
```bash
mkdir build && cd build\
cmake && make && sudo make install
```
If you also want to compile example.c, add `-DSLC_EXAMPLES=1` to the cmake command.