summaryrefslogtreecommitdiff
path: root/include/user/registrymgr.h
blob: f2944226cffa98f3e59f2cb8bdc26f2bd403f224 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#ifndef _PSP2_REGISTRYMGR_H_
#define _PSP2_REGISTRYMGR_H_

#include <scetypes.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Get a key's information by category and name
 *
 * @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM)
 * @param name - Name of the key
 * @param buf - Pointer to a buffer to hold the value
 * @param size - The size of the buffer
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrGetKeyBin(const char *category, const char *name, void *buf, int size);

/**
 * Get a key's information by category and name
 *
 * @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM)
 * @param name - Name of the key
 * @param buf - Pointer to a int buffer to hold the value
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrGetKeyInt(const char* category, const char* name, int* buf);

/**
 * Get a key's information by category and name
 *
 * @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM)
 * @param name - Name of the key
 * @param buf - Pointer to a char buffer to hold the value
 * @param size - The size of the buffer
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrGetKeyStr(const char* category, const char* name, char* buf, const int size);

/**
 * Set a key's information by category and name
 *
 * @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM)
 * @param name - Name of the key
 * @param buf - Pointer to a buffer to hold the value
 * @param size - The size of the buffer
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrSetKeyBin(const char *category, const char *name, void *buf, int size);

/**
 * Set a key's information by category and name
 *
 * @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM)
 * @param name - Name of the key
 * @param value - Value to set to
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrSetKeyInt(const char* category, const char* name, int value);

/**
 * Set a key's information by category and name
 *
 * @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM)
 * @param name - Name of the key
 * @param buf - Pointer to a char buffer to hold the value
 * @param size - The size of the buffer
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrSetKeyStr(const char* category, const char* name, char* buf, const int size);

/**
 * Get all keys' initial information by category (from os0:kd/registry.db0)
 *
 * @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM)
 * @param buf[out] - Pointer to a char buffer to hold the values
 * @param elements_number - The number of elements of the buffer
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrGetInitVals(const char* category, char* buf, const int elements_number);

/**
 * Get all keys' information by category
 *
 * @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM)
 * @param buf[out] - Pointer to a char buffer to hold the values
 * @param elements_number - The number of elements of the buffer
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrGetKeys(const char* category, char* buf, const int elements_number);

/**
 * Set all keys' information by category
 *
 * @param category - The path to the directory to be opened (e.g. /CONFIG/SYSTEM)
 * @param buf[out] - Pointer to a char buffer that holds the values
 * @param elements_number - The number of elements of the buffer
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrSetKeys(const char* category, char* buf, const int elements_number);

/**
 * Get a system param key's information by id
 *
 * @param id - The id of the key
 * @param buf[out] - Pointer to an int to hold the value
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrSystemParamGetInt(const int id, int* buf);

/**
 * Get a system param key's information by id
 *
 * @param id - The id of the key
 * @param buf[out] - Pointer to a char buffer to hold the value
 * @param size - The size of the buffer
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrSystemParamGetStr(const int id, char* buf, const int size);

/**
 * Get the registry version
 *
 * @param id - The id of the key
 * @param buf[out] - Pointer to a char buffer to hold the value
 *
 * @return 0 on success, < 0 on error
 */
int sceRegMgrGetRegVersion(int version, char* buf);

/**
 * Get binary registry key by id
 *
 * @param id - The id of the key
 * @param buf[out] - Pointer to a buffer
 * @param size - The size of the buffer
 *
 * @return 0 on success, < 0 on error
 */
SceInt32 sceRegMgrUtilityGetBin(SceUInt32 id, void *buf, SceSize size);

/**
 * Get integer registry key by id
 *
 * @param id - The id of the key
 * @param buf[out] - Pointer to a buffer
 *
 * @return 0 on success, < 0 on error
 */
SceInt32 sceRegMgrUtilityGetInt(SceUInt32 id, SceInt32 *buf);

/**
 * Get char array registry key by id
 *
 * @param id - The id of the key
 * @param buf[out] - Pointer to a buffer
 * @param size - The size of the buffer
 *
 * @return 0 on success, < 0 on error
 */
SceInt32 sceRegMgrUtilityGetStr(SceUInt32 id, char *buf, SceSize size);

/**
 * Set binary registry key by id
 *
 * @param id - The id of the key
 * @param buf - Pointer to a buffer
 * @param size - The size of the buffer
 *
 * @return 0 on success, < 0 on error
 */
SceInt32 sceRegMgrUtilitySetBin(SceUInt32 id, const void *buf, SceSize size);


/**
 * Set integer registry key by id
 *
 * @param id - The id of the key
 * @param val - Value to set
 *
 * @return 0 on success, < 0 on error
 */
SceInt32 sceRegMgrUtilitySetInt(SceUInt32 id, SceInt32 val);

/**
 * Set char array registry key by id
 *
 * @param id - The id of the key
 * @param buf - Pointer to a buffer
 * @param size - The size of the buffer
 *
 * @return 0 on success, < 0 on error
 */
SceInt32 sceRegMgrUtilitySetStr(SceUInt32 id, const char *buf, SceSize size);

#ifdef __cplusplus
}
#endif

#endif /* _PSP2_REGISTRYMGR_H_ */