blob: 27b3ca398488cee292e287ed3eb966ed9f103fcc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// MIT License, Copyright (c) 2021 Marvin Borner
#ifndef CFG_H
#define CFG_H
#include <def.h>
// Global config element index (can actually be anything but wth)
#define CFG_GLOBAL 0
enum cfg_key {
CFG_NONE,
CFG_NAME,
CFG_TIMEOUT,
CFG_PATH,
};
struct cfg_entry {
u8 exists : 1;
char name[64];
char path[64];
struct dev *dev;
};
struct cfg {
u32 timeout;
struct cfg_entry entry[16]; // Up to 16 different entries
};
void cfg_foreach(u8 (*cb)(struct cfg_entry *));
void cfg_read(void);
#endif
|