@@ -1,2 +1,3 @@ | |||||
.idea/ | .idea/ | ||||
cmake-build-*/ | cmake-build-*/ | ||||
build/ |
@@ -11,8 +11,8 @@ add_library( | |||||
ini_config STATIC | ini_config STATIC | ||||
ini-config.c | ini-config.c | ||||
ini-config.h | ini-config.h | ||||
ini-config/types/int.c | |||||
ini-config/types/int.h | |||||
ini-config/types/string.c | |||||
ini-config/types/string.h | |||||
types/int.c | |||||
types/int.h | |||||
types/string.c | |||||
types/string.h | |||||
) | ) |
@@ -1,10 +1,9 @@ | |||||
## Procedure | |||||
# `ini-config` | |||||
Subsystem calls its initialize method. | |||||
## Building | |||||
1. Subsystem copies hardcoded default values to its in-memory state container. | |||||
2. Subsystem defines the available config items it has, and how it is connected to various config sources (i.e. specify its section and key in the config file, as well as supplying command line options connected to this config item). | |||||
3. Subsystem binds the config items with their respective sections and keys in the config file (i.e. correctly point the values to the respective internal state container of the app). | |||||
4. Subsystem retrieves the config file values as well as command line arguments (higher priority) supplied to the app upon invocation. | |||||
5. Subsystem checks if there are some volatile state data to retrieve and syncs it with the state. | |||||
6. Subsystem saves the state to the config file. | |||||
```shell | |||||
mkdir build | |||||
cmake "-DCMAKE_MT=%CMAKE_MT%" -G Ninja -S . -B build | |||||
cmake --build build -t ini_config | |||||
``` |
@@ -1,7 +1,7 @@ | |||||
#ifndef INI_CONFIG_TYPES_INT_H | #ifndef INI_CONFIG_TYPES_INT_H | ||||
#define INI_CONFIG_TYPES_INT_H | #define INI_CONFIG_TYPES_INT_H | ||||
#include "ini-config.h" | |||||
#include "../ini-config.h" | |||||
INI_CONFIG_DECLARE_TYPE(U8); | INI_CONFIG_DECLARE_TYPE(U8); | ||||
#define INI_CONFIG_TYPE_U8 (INI_ConfigType) { \ | #define INI_CONFIG_TYPE_U8 (INI_ConfigType) { \ | ||||
@@ -1,7 +1,7 @@ | |||||
#ifndef INI_CONFIG_TYPES_STRING_H | #ifndef INI_CONFIG_TYPES_STRING_H | ||||
#define INI_CONFIG_TYPES_STRING_H | #define INI_CONFIG_TYPES_STRING_H | ||||
#include "ini-config.h" | |||||
#include "../ini-config.h" | |||||
INI_CONFIG_DECLARE_TYPE(String); | INI_CONFIG_DECLARE_TYPE(String); | ||||
#define INI_CONFIG_TYPE_STRING(X) (INI_ConfigType) { \ | #define INI_CONFIG_TYPE_STRING(X) (INI_ConfigType) { \ | ||||