|
- #ifndef NESE_INI_H_
- #define NESE_INI_H_
-
-
- typedef enum {
- ini_invalid = -1,
- ini_none = 0,
- ini_comment,
- ini_section,
- ini_string,
- ini_integer,
- ini_flag,
- } ini_data_type;
-
- typedef struct ini_datum {
- ini_data_type type;
- int offset; // offset into associated struct
- char* name; // key, section, or comment
- union {
- char* string; // string, comment
- struct {
- int32_t value; // int, flag
- uint32_t shift; // flag
- };
- struct {
- int count;
- struct ini_datum* data; // section
- };
- };
- } ini_datum;
-
-
- int write_ini_file(FILE* file, const ini_datum* schema,
- const void* data);
-
- int read_ini_file(FILE* file, const ini_datum* schema,
- void* data);
-
-
- #endif // NESE_INI_H_
|