fix for corrupted graphics when manipulating config files
[open-ps2-loader.git] / include / config.h
blob990c4a36e2c50dec08c195116cf6db79904b637b
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"
23 #define CONFIG_ITEM_CDVDMAN_TIMER "$CallbackTimer"
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 u32 uid;
39 } config_set_t;
41 void configInit(char *prefix);
42 void configEnd();
43 config_set_t *configAlloc(int type, config_set_t *configSet, char *fileName);
44 void configFree(config_set_t *configSet);
45 config_set_t *configGetByType(int type);
46 int configSetStr(config_set_t* configSet, const char* key, const char* value);
47 int configGetStr(config_set_t* configSet, const char* key, char** value);
48 void configGetStrCopy(config_set_t* configSet, const char* key, char* value);
49 int configSetInt(config_set_t* configSet, const char* key, const int value);
50 int configGetInt(config_set_t* configSet, const char* key, int* value);
51 int configSetColor(config_set_t* configSet, const char* key, unsigned char* color);
52 int configGetColor(config_set_t* configSet, const char* key, unsigned char* color);
53 int configRemoveKey(config_set_t* configSet, const char* key);
55 void configReadIP();
56 void configWriteIP();
57 void configGetDiscIDBinary(config_set_t* configSet, void* dst);
59 int configRead(config_set_t* configSet);
60 int configReadMulti(int types);
61 int configWrite(config_set_t* configSet);
62 int configWriteMulti(int types);
63 void configClear(config_set_t* configSet);
65 #ifdef VMC
66 void configGetVMC(config_set_t* configSet, char* vmc, int slot);
67 void configSetVMC(config_set_t* configSet, const char* vmc, int slot);
68 void configRemoveVMC(config_set_t* configSet, int slot);
69 #endif
71 #endif