PSPSDK 2025-04-22
Loading...
Searching...
No Matches
pspreg.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * pspreg.h - Prototypes for the sceReg library.
7 *
8 * Copyright (c) 2005 James F
9 *
10 */
11
12#ifndef __REG_H__
13#define __REG_H__
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#include <psptypes.h>
20
25#define SYSTEM_REGISTRY "/system"
26
28#define REG_KEYNAME_SIZE 27
29
42
44typedef unsigned int REGHANDLE;
45
48{
49 unsigned int regtype; /* 0x0, set to 1 only for system */
51 char name[256]; /* 0x4-0x104 */
53 unsigned int namelen; /* 0x104 */
55 unsigned int unk2; /* 0x108 */
57 unsigned int unk3; /* 0x10C */
58};
59
69int sceRegOpenRegistry(struct RegParam *reg, int mode, REGHANDLE *h);
70
79
88
99int sceRegOpenCategory(REGHANDLE h, const char *name, int mode, REGHANDLE *hd);
100
109int sceRegRemoveCategory(REGHANDLE h, const char *name);
110
119
128
140int sceRegGetKeyInfo(REGHANDLE hd, const char *name, REGHANDLE *hk, unsigned int *type, SceSize *size);
141
152int sceRegGetKeyInfoByName(REGHANDLE hd, const char *name, unsigned int *type, SceSize *size);
153
164int sceRegGetKeyValue(REGHANDLE hd, REGHANDLE hk, void *buf, SceSize size);
165
176int sceRegGetKeyValueByName(REGHANDLE hd, const char *name, void *buf, SceSize size);
177
188int sceRegSetKeyValue(REGHANDLE hd, const char *name, const void *buf, SceSize size);
189
198int sceRegGetKeysNum(REGHANDLE hd, int *num);
199
209int sceRegGetKeys(REGHANDLE hd, char *buf, int num);
210
221int sceRegCreateKey(REGHANDLE hd, const char *name, int type, SceSize size);
222
231
234#ifdef __cplusplus
235}
236#endif
237
238#endif
unsigned int REGHANDLE
Typedef for a registry handle.
Definition pspreg.h:44
int sceRegGetKeyInfoByName(REGHANDLE hd, const char *name, unsigned int *type, SceSize *size)
Get a key's information by name.
int sceRegGetKeyInfo(REGHANDLE hd, const char *name, REGHANDLE *hk, unsigned int *type, SceSize *size)
Get a key's information.
int sceRegFlushCategory(REGHANDLE hd)
Flush the registry directory to disk.
int sceRegGetKeyValue(REGHANDLE hd, REGHANDLE hk, void *buf, SceSize size)
Get a key's value.
int sceRegFlushRegistry(REGHANDLE h)
Flush the registry to disk.
int sceRegSetKeyValue(REGHANDLE hd, const char *name, const void *buf, SceSize size)
Set a key's value.
int sceRegCloseRegistry(REGHANDLE h)
Close the registry.
int sceRegGetKeysNum(REGHANDLE hd, int *num)
Get number of subkeys in the current dir.
int sceRegGetKeyValueByName(REGHANDLE hd, const char *name, void *buf, SceSize size)
Get a key's value by name.
int sceRegRemoveCategory(REGHANDLE h, const char *name)
Remove a registry dir.
int sceRegGetKeys(REGHANDLE hd, char *buf, int num)
Get the key names in the current directory.
int sceRegOpenRegistry(struct RegParam *reg, int mode, REGHANDLE *h)
Open the registry.
int sceRegCreateKey(REGHANDLE hd, const char *name, int type, SceSize size)
Create a key.
int sceRegRemoveRegistry(struct RegParam *reg)
Remove a registry (HONESTLY, DO NOT USE)
int sceRegOpenCategory(REGHANDLE h, const char *name, int mode, REGHANDLE *hd)
Open a registry directory.
RegKeyTypes
Key types.
Definition pspreg.h:32
int sceRegCloseCategory(REGHANDLE hd)
Close the registry directory.
@ REG_TYPE_INT
Key is an integer (4 bytes)
Definition pspreg.h:36
@ REG_TYPE_STR
Key is a string.
Definition pspreg.h:38
@ REG_TYPE_BIN
Key is a binary string.
Definition pspreg.h:40
@ REG_TYPE_DIR
Key is a directory.
Definition pspreg.h:34
unsigned int SceSize
Definition psptypes.h:103
Struct used to open a registry.
Definition pspreg.h:48
char name[256]
Seemingly never used, set to SYSTEM_REGISTRY.
Definition pspreg.h:51
unsigned int unk2
Unknown, set to 1.
Definition pspreg.h:55
unsigned int regtype
Definition pspreg.h:49
unsigned int unk3
Unknown, set to 1.
Definition pspreg.h:57
unsigned int namelen
Length of the name.
Definition pspreg.h:53