all repos — mgba @ 22245617f434049f4646916d1b2930d376503b0d

mGBA Game Boy Advance Emulator

src/util/configuration.h (view raw)

 1/* Copyright (c) 2013-2014 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef CONFIGURATION_H
 7#define CONFIGURATION_H
 8
 9#include "util/table.h"
10
11struct VFile;
12
13struct Configuration {
14	struct Table sections;
15	struct Table root;
16};
17
18void ConfigurationInit(struct Configuration*);
19void ConfigurationDeinit(struct Configuration*);
20
21void ConfigurationSetValue(struct Configuration*, const char* section, const char* key, const char* value);
22void ConfigurationSetIntValue(struct Configuration*, const char* section, const char* key, int value);
23void ConfigurationSetUIntValue(struct Configuration*, const char* section, const char* key, unsigned value);
24void ConfigurationSetFloatValue(struct Configuration*, const char* section, const char* key, float value);
25
26const char* ConfigurationGetValue(const struct Configuration*, const char* section, const char* key);
27
28void ConfigurationClearValue(struct Configuration*, const char* section, const char* key);
29
30bool ConfigurationRead(struct Configuration*, const char* path);
31bool ConfigurationWrite(const struct Configuration*, const char* path);
32bool ConfigurationWriteSection(const struct Configuration*, const char* path, const char* section);
33
34#endif