2023-04-01 19:49:29 +08:00
|
|
|
/*
|
2023-04-05 13:36:05 +08:00
|
|
|
* Controller Config Save and Load
|
2023-04-01 19:49:29 +08:00
|
|
|
* WHowe <github.com/whowechina>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONFIG_H
|
|
|
|
#define CONFIG_H
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2023-04-05 13:36:05 +08:00
|
|
|
/* It's safer to lock other I/O ops during saving, so we need a locker */
|
|
|
|
typedef void (*io_locker_func)(bool pause);
|
|
|
|
void config_init(io_locker_func locker);
|
2023-04-01 19:49:29 +08:00
|
|
|
|
|
|
|
void config_loop();
|
|
|
|
|
|
|
|
void *config_alloc(size_t size, void *def, void (*after_load)());
|
|
|
|
void config_request_save();
|
|
|
|
|
|
|
|
#endif
|