PS2SDK
PS2 Homebrew Libraries
libhdd.h
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
16 #ifndef __LIBHDD_H__
17 #define __LIBHDD_H__
18 
19 #include <tamtypes.h>
20 #include <hdd-ioctl.h>
21 #include <libpwroff.h>
22 
23 #define PFS_MT_ROBUST 0x02
24 
25 #define FS_COMMON_PREFIX '+'
26 
27 #define FS_GROUP_SYSTEM 0x00
28 #define FS_GROUP_COMMON 0x01
29 #define FS_GROUP_APPLICATION 0x02
30 
31 #define FS_TYPE_EXT2_SWAP 0x0082
32 #define FS_TYPE_EXT2 0x0083
33 #define FS_TYPE_REISER 0x0088
34 #define FS_TYPE_PFS 0x0100
35 #define FS_TYPE_CFS 0x0101
36 #define FS_TYPE_EMPTY 0x0000
37 
38 #define ATTR_MAIN_PARTITION 0x0000
39 #define ATTR_SUB_PARTITION 0x0001
40 
41 typedef struct
42 {
44  char name[32];
46  char filename[40];
48  u32 size;
50  int formatted;
52  u32 freeSpace;
56 
57 typedef struct
58 {
60  u32 hddSize;
62  u32 hddFree;
65 } t_hddInfo;
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
71 extern int hddCheckPresent();
72 extern int hddCheckFormatted();
73 extern int hddFormat();
74 extern int hddGetFilesystemList(t_hddFilesystem hddFs[], int maxEntries);
75 extern void hddGetInfo(t_hddInfo *info);
76 extern int hddMakeFilesystem(int fsSizeMB, char *name, int type);
77 extern int hddRemoveFilesystem(t_hddFilesystem *fs);
78 extern int hddExpandFilesystem(t_hddFilesystem *fs, int extraMB);
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 // These hdd* functions are deprecated
85 // Use the poweroff* version instead
86 
87 #define hddPreparePoweroff poweroffInit
88 #define hddSetUserPoweroffCallback poweroffSetCallback
89 #define hddPowerOff poweroffShutdown
90 
91 #endif /* __LIBHDD_H__ */
t_hddFilesystem
Definition: libhdd.h:41
t_hddInfo::hddFree
u32 hddFree
Definition: libhdd.h:62
s_info
Definition: xprintf.c:78
t_hddFilesystem::size
u32 size
Definition: libhdd.h:48
t_hddInfo::hddSize
u32 hddSize
Definition: libhdd.h:60
t_hddFilesystem::fileSystemGroup
int fileSystemGroup
Definition: libhdd.h:54
hdd-ioctl.h
t_hddFilesystem::formatted
int formatted
Definition: libhdd.h:50
tamtypes.h
t_hddInfo::hddMaxPartitionSize
u32 hddMaxPartitionSize
Definition: libhdd.h:64
libpwroff.h
Power-off library.
t_hddInfo
Definition: libhdd.h:57
t_hddFilesystem::freeSpace
u32 freeSpace
Definition: libhdd.h:52