fixed the alternate device mode.
[open-ps2-loader.git] / include / config.h
bloba2b65ecc1755d4fbd3fb26588ddea113070896b6
1 #ifndef __CONFIG_H
2 #define __CONFIG_H
4 #define CONFIG_ALL 0xFF
6 #define CONFIG_OPL 0x01
7 #define CONFIG_COMPAT 0x02
8 #define CONFIG_DNAS 0x04
9 #define CONFIG_VMC 0x08
10 #define CONFIG_LAST 0x10
11 #define CONFIG_APPS 0x20
12 #define CONFIG_VMODE 0x40
14 #define CONFIG_FILE_NUM 7
16 struct config_value_t {
17 char key[32];
18 char val[255];
20 struct config_value_t *next;
23 typedef struct {
24 int type;
25 struct config_value_t *head;
26 struct config_value_t *tail;
27 char *filename;
28 int modified;
29 } config_set_t;
31 void configInit(char *prefix);
32 void configEnd();
33 config_set_t *configAlloc(int type, config_set_t *configSet, char *fileName);
34 void configFree(config_set_t *configSet);
35 config_set_t *configGetByType(int type);
36 int configSetStr(config_set_t* configSet, const char* key, const char* value);
37 int configGetStr(config_set_t* configSet, const char* key, char** value);
38 int configSetInt(config_set_t* configSet, const char* key, const int value);
39 int configGetInt(config_set_t* configSet, char* key, int* value);
40 int configSetColor(config_set_t* configSet, const char* key, unsigned char* color);
41 int configGetColor(config_set_t* configSet, const char* key, unsigned char* color);
42 int configRemoveKey(config_set_t* configSet, const char* key);
44 void configReadIP();
45 void configWriteIP();
47 void configGetDiscID(char* startup, char* discID);
48 void configSetDiscID(char* startup, const char *discID);
49 void configRemoveDiscID(char* startup);
50 void configGetDiscIDBinary(char* startup, void* dst);
52 int configGetCompatibility(char* startup, int mode, int *dmaMode);
53 void configSetCompatibility(char* startup, int mode, int compatMode, int dmaMode);
55 int configRead(config_set_t* configSet);
56 int configReadMulti(int types);
57 int configWrite(config_set_t* configSet);
58 int configWriteMulti(int types);
59 void configClear(config_set_t* configSet);
61 #ifdef VMC
62 void configGetVMC(char* startup, char* vmc, int mode, int slot);
63 void configSetVMC(char* startup, const char* vmc, int mode, int slot);
64 void configRemoveVMC(char *startup, int mode, int slot);
65 #endif
67 #endif