2025-01-10 00:16:06 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2025-01-16 07:46:27 +03:00
|
|
|
typedef struct {
|
|
|
|
#define OPT_NAME_MAX 20
|
|
|
|
char name[20]; // option name
|
|
|
|
char *value; // option value
|
|
|
|
bool required; // is the option required (does it need to have a value)
|
2025-01-10 00:16:06 +03:00
|
|
|
} option_t;
|
|
|
|
|
|
|
|
typedef struct config {
|
|
|
|
option_t *options;
|
|
|
|
int32_t count;
|
|
|
|
} config_t;
|
|
|
|
|
2025-01-16 07:46:27 +03:00
|
|
|
bool config_load(config_t *conf);
|
|
|
|
char *config_get(config_t *conf, const char *name);
|