2020-01-22 07:13:19 +01:00
|
|
|
#ifndef __LIB__CONFIG_H__
|
|
|
|
#define __LIB__CONFIG_H__
|
|
|
|
|
|
|
|
#include <stddef.h>
|
2020-10-17 05:37:39 +02:00
|
|
|
#include <stdbool.h>
|
2020-11-02 10:17:20 +01:00
|
|
|
#include <lib/part.h>
|
2020-01-22 07:13:19 +01:00
|
|
|
|
2020-10-20 02:38:44 +02:00
|
|
|
extern bool config_ready;
|
2021-12-12 18:48:36 +01:00
|
|
|
extern bool bad_config;
|
2020-10-20 02:38:44 +02:00
|
|
|
|
2020-11-16 23:31:03 +01:00
|
|
|
struct menu_entry {
|
|
|
|
char name[64];
|
2021-07-08 16:57:40 +02:00
|
|
|
char *comment;
|
2020-11-16 23:31:03 +01:00
|
|
|
struct menu_entry *parent;
|
|
|
|
struct menu_entry *sub;
|
|
|
|
bool expanded;
|
|
|
|
char *body;
|
|
|
|
struct menu_entry *next;
|
|
|
|
};
|
|
|
|
|
2021-11-09 12:01:53 +01:00
|
|
|
struct conf_tuple {
|
|
|
|
char *value1;
|
|
|
|
char *value2;
|
|
|
|
};
|
|
|
|
|
2020-11-16 23:31:03 +01:00
|
|
|
extern struct menu_entry *menu_tree;
|
|
|
|
|
2021-02-06 14:40:55 +01:00
|
|
|
int init_config_disk(struct volume *part);
|
2020-11-05 01:37:45 +01:00
|
|
|
int init_config(size_t config_size);
|
2021-11-09 12:01:53 +01:00
|
|
|
|
2020-11-27 19:33:34 +01:00
|
|
|
char *config_get_value(const char *config, size_t index, const char *key);
|
2021-11-09 12:01:53 +01:00
|
|
|
struct conf_tuple config_get_tuple(const char *config, size_t index,
|
|
|
|
const char *key1, const char *key2);
|
2020-01-22 07:13:19 +01:00
|
|
|
|
|
|
|
#endif
|