* fix a refresh bug introduced lately
[open-ps2-loader.git] / include / config.h
blob005bea45c95fbf6721852bf1f6bc47856c8626bb
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
10 #define CONFIG_FILE_NUM 3
12 #define CONFIG_ITEM_NAME "#Name"
13 #define CONFIG_ITEM_LONGNAME "#LongName"
14 #define CONFIG_ITEM_SIZE "#Size"
15 #define CONFIG_ITEM_FORMAT "#Format"
16 #define CONFIG_ITEM_MEDIA "#Media"
17 #define CONFIG_ITEM_STARTUP "#Startup"
18 #define CONFIG_ITEM_ALTSTARTUP "$AltStartup"
19 #define CONFIG_ITEM_VMC "$VMC"
20 #define CONFIG_ITEM_COMPAT "$Compatibility"
21 #define CONFIG_ITEM_DMA "$DMA"
22 #define CONFIG_ITEM_DNAS "$DNAS"
24 struct config_value_t {
25 char key[32];
26 char val[255];
28 struct config_value_t *next;
31 typedef struct {
32 int type;
33 struct config_value_t *head;
34 struct config_value_t *tail;
35 char *filename;
36 int modified;
37 } config_set_t;
39 void configInit(char *prefix);
40 void configEnd();
41 config_set_t *configAlloc(int type, config_set_t *configSet, char *fileName);
42 void configFree(config_set_t *configSet);
43 config_set_t *configGetByType(int type);
44 int configSetStr(config_set_t* configSet, const char* key, const char* value);
45 int configGetStr(config_set_t* configSet, const char* key, char** value);
46 void configGetStrCopy(config_set_t* configSet, const char* key, char* value);
47 int configSetInt(config_set_t* configSet, const char* key, const int value);
48 int configGetInt(config_set_t* configSet, const char* key, int* value);
49 int configSetColor(config_set_t* configSet, const char* key, unsigned char* color);
50 int configGetColor(config_set_t* configSet, const char* key, unsigned char* color);
51 int configRemoveKey(config_set_t* configSet, const char* key);
53 void configReadIP();
54 void configWriteIP();
55 void configGetDiscIDBinary(config_set_t* configSet, void* dst);
57 int configRead(config_set_t* configSet);
58 int configReadMulti(int types);
59 int configWrite(config_set_t* configSet);
60 int configWriteMulti(int types);
61 void configClear(config_set_t* configSet);
63 #ifdef VMC
64 void configGetVMC(config_set_t* configSet, char* vmc, int slot);
65 void configSetVMC(config_set_t* configSet, const char* vmc, int slot);
66 void configRemoveVMC(config_set_t* configSet, int slot);
67 #endif
69 #endif