* Minor GUI changes (deferred error message display, small optim for main loop)
[open-ps2-loader.git] / include / config.h
blob4584060a0e92a94595648630de22cfdcfe5a4541
1 #ifndef __CONFIG_H
2 #define __CONFIG_H
4 #define CONFIG_ALL 0xFF
6 #define CONFIG_OPL 0x01
7 #define CONFIG_LAST 0x02
8 #define CONFIG_APPS 0x04
9 #define CONFIG_VMODE 0x08
11 #define CONFIG_FILE_NUM 4
13 #define CONFIG_ITEM_NAME "#Name"
14 #define CONFIG_ITEM_LONGNAME "#LongName"
15 #define CONFIG_ITEM_SIZE "#Size"
16 #define CONFIG_ITEM_FORMAT "#Format"
17 #define CONFIG_ITEM_MEDIA "#Media"
18 #define CONFIG_ITEM_STARTUP "#Startup"
19 #define CONFIG_ITEM_ALTSTARTUP "$AltStartup"
20 #define CONFIG_ITEM_VMC "$VMC"
21 #define CONFIG_ITEM_COMPAT "$Compatibility"
22 #define CONFIG_ITEM_DMA "$DMA"
23 #define CONFIG_ITEM_DNAS "$DNAS"
25 struct config_value_t {
26 char key[32];
27 char val[255];
29 struct config_value_t *next;
32 typedef struct {
33 int type;
34 struct config_value_t *head;
35 struct config_value_t *tail;
36 char *filename;
37 int modified;
38 } config_set_t;
40 void configInit(char *prefix);
41 void configEnd();
42 config_set_t *configAlloc(int type, config_set_t *configSet, char *fileName);
43 void configFree(config_set_t *configSet);
44 config_set_t *configGetByType(int type);
45 int configSetStr(config_set_t* configSet, const char* key, const char* value);
46 int configGetStr(config_set_t* configSet, const char* key, char** value);
47 void configGetStrCopy(config_set_t* configSet, const char* key, char* value);
48 int configSetInt(config_set_t* configSet, const char* key, const int value);
49 int configGetInt(config_set_t* configSet, const char* key, int* value);
50 int configSetColor(config_set_t* configSet, const char* key, unsigned char* color);
51 int configGetColor(config_set_t* configSet, const char* key, unsigned char* color);
52 int configRemoveKey(config_set_t* configSet, const char* key);
54 void configReadIP();
55 void configWriteIP();
56 void configGetDiscIDBinary(config_set_t* configSet, void* dst);
58 int configRead(config_set_t* configSet);
59 int configReadMulti(int types);
60 int configWrite(config_set_t* configSet);
61 int configWriteMulti(int types);
62 void configClear(config_set_t* configSet);
64 #ifdef VMC
65 void configGetVMC(config_set_t* configSet, char* vmc, int slot);
66 void configSetVMC(config_set_t* configSet, const char* vmc, int slot);
67 void configRemoveVMC(config_set_t* configSet, int slot);
68 #endif
70 #endif