PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
mcserv.h
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright (c) 2009 jimmikaelkael
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
11#ifndef __MCSERV_H__
12#define __MCSERV_H__
13
14#include <loadcore.h>
15#include <intrman.h>
16#include <sysclib.h>
17#include <sifman.h>
18#include <sifcmd.h>
19#include <thbase.h>
20#include <stdio.h>
21#include <mcman.h>
22
23//#define DEBUG
24
25#define MODNAME "mcserv"
26#define MODVER 0x208
27
28#ifdef SIO_DEBUG
29 #include <sior.h>
30 #define DEBUG
31 #define DPRINTF(format, args...) \
32 sio_printf(MODNAME ": " format, ##args)
33#else
34 #ifdef DEBUG
35 #define DPRINTF(format, args...) \
36 printf(MODNAME ": " format, ##args)
37 #else
38 #define DPRINTF(format, args...)
39 #endif
40#endif
41
42
43// internal function prototypes
44extern void *cb_rpc_S_0400(u32 fno, void *buf, int size);
45extern void thread_rpc_S_0400(void* param);
46extern int sceMcInit(void);
47extern int sceMcOpen(void);
48extern int sceMcClose(void);
49extern int sceMcRead(void);
50extern int sceMcWrite(void);
51extern int sceMcSeek(void);
52extern int sceMcGetDir(void);
53extern int sceMcFormat(void);
54extern int sceMcGetInfo(void);
55extern int sceMcDelete(void);
56extern int sceMcFlush(void);
57extern int sceMcChDir(void);
58extern int sceMcSetFileInfo(void);
59extern int sceMcEraseBlock(void);
60extern int sceMcReadPage(void);
61extern int sceMcWritePage(void);
62extern int sceMcUnformat(void);
63extern int sceMcRead2(void);
64extern int sceMcGetInfo2(void);
65extern int sceMcGetEntSpace(void);
66extern int sceMcCheckBlock(void);
67
68extern int _McInit(void *rpc_buf);
69extern int _McOpen(void *rpc_buf);
70extern int _McClose(void *rpc_buf);
71extern int _McRead(void *rpc_buf);
72extern int _McWrite(void *rpc_buf);
73extern int _McSeek(void *rpc_buf);
74extern int _McGetDir(void *rpc_buf);
75extern int _McFormat(void *rpc_buf);
76extern int _McGetInfo(void *rpc_buf);
77extern int _McDelete(void *rpc_buf);
78extern int _McFlush(void *rpc_buf);
79extern int _McChDir(void *rpc_buf);
80extern int _McSetFileInfo(void *rpc_buf);
81extern int _McEraseBlock(void *rpc_buf);
82extern int _McReadPage(void *rpc_buf);
83extern int _McWritePage(void *rpc_buf);
84extern int _McUnformat(void *rpc_buf);
85extern int _McRead2(void *rpc_buf);
86extern int _McGetInfo2(void *rpc_buf);
87extern int _McGetEntSpace(void *rpc_buf);
88extern int _McCheckBlock(void *rpc_buf);
89
90// filename related mc command
91// used by: mcOpen, mcGetDir, mcChdir, mcDelete, mcSetFileInfo, mcRename, mcGetEntSpace
92typedef struct { // size = 1044
93 int port; // 0
94 int slot; // 4
95 int flags; // 8
96 int maxent; // 12
97 union {
98 sceMcTblGetDir *mcT; // 16
99 char *curdir;
100 };
101 char name[1024]; // 20
103
104#endif