canfigger v0.3.x
Lightweight config file parser library
|
Header file for the Canfigger configuration parser. More...
Go to the source code of this file.
Data Structures | |
struct | attributes |
Structure to hold attribute details of a configuration key. More... | |
struct | Canfigger |
Structure to represent a key-value pair with attributes in the configuration. More... | |
Functions | |
struct Canfigger * | canfigger_parse_file (const char *file, const int delimiter) |
Parses a configuration file and creates a linked list of key-value pairs. | |
void | canfigger_free_current_key_node_advance (struct Canfigger **list) |
Frees the current key node and advances to the next node in the list. | |
void | canfigger_free_current_attr_str_advance (struct attributes *attributes, char **attr) |
Frees the current attribute string and advances to the next attribute. | |
Header file for the Canfigger configuration parser.
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.
Part of canfigger (https://github.com/andy5995/canfigger).
Copyright (C) 2021-2024 Andy Alt (arch_.nosp@m.stan.nosp@m.ton59.nosp@m.95@p.nosp@m.roton.nosp@m..me)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file canfigger.h.
struct attributes |
Structure to hold attribute details of a configuration key.
Definition at line 43 of file canfigger.h.
Data Fields | ||
---|---|---|
char * | current | |
char * | iter_ptr | |
char * | str |
struct Canfigger |
Structure to represent a key-value pair with attributes in the configuration.
Definition at line 59 of file canfigger.h.
Data Fields | ||
---|---|---|
struct attributes * | attributes | |
char * | key | |
struct Canfigger * | next | |
char * | value |
void canfigger_free_current_attr_str_advance | ( | struct attributes * | attributes, |
char ** | attr ) |
Frees the current attribute string and advances to the next attribute.
attributes | Pointer to the attributes structure of the current node. |
attr | Current attribute that will get reassigned after the function call. |
Definition at line 75 of file canfigger.c.
void canfigger_free_current_key_node_advance | ( | struct Canfigger ** | list | ) |
Frees the current key node and advances to the next node in the list.
list | Double pointer to the current node in the linked list. |
Definition at line 114 of file canfigger.c.
struct Canfigger * canfigger_parse_file | ( | const char * | file, |
const int | delimiter ) |
Parses a configuration file and creates a linked list of key-value pairs.
file | Path to the configuration file to parse. |
delimiter | The character used to delimit the attributes following 'value'. |
Definition at line 330 of file canfigger.c.