GEX core repository.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gex-core/framework/system_settings.h

64 lines
1.4 KiB

7 years ago
//
// Created by MightyPork on 2017/12/02.
//
// SYSTEM.INI system settings
//
7 years ago
#ifndef GEX_SYSTEM_SETTINGS_H
#define GEX_SYSTEM_SETTINGS_H
#include "platform.h"
#include "utils/ini_writer.h"
#include "utils/payload_parser.h"
#include "utils/payload_builder.h"
/**
* Struct of the global system settings storage
*/
7 years ago
struct system_settings {
bool visible_vcom;
bool ini_comments;
7 years ago
// Support flags put here for scoping, but not atcually part of the persistent settings
volatile bool editable; //!< True if we booted with the LOCK jumper removed
volatile bool modified; //!< True if user did any change to the settings (checked when the LOCK jumper is replaced)
volatile char loading_inifile; // S-system, U-units
7 years ago
};
/** Global system settings storage */
7 years ago
extern struct system_settings SystemSettings;
/**
* Init the store
7 years ago
*/
void systemsettings_init(void);
/**
* Load defaults
*/
void systemsettings_loadDefaults(void);
7 years ago
/**
* Write system settings to the pack context
*/
void systemsettings_save(PayloadBuilder *pb);
/**
* Load system settings from the unpack context
*/
bool systemsettings_load(PayloadParser *pp);
/**
* Write system settings to INI
*/
void systemsettings_build_ini(IniWriter *iw);
7 years ago
/**
* Load system settings from INI kv pair
*
* @return true on success
*/
bool systemsettings_load_ini(const char *restrict key, const char *restrict value);
7 years ago
#endif //GEX_SYSTEM_SETTINGS_H