RetroArch
ipc.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------
2 
3 ipc.h -- Interprocess Communication with Starlet
4 
5 Copyright (C) 2008
6 Michael Wiedenbauer (shagkur)
7 Dave Murphy (WinterMute)
8 Hector Martin (marcan)
9 
10 This software is provided 'as-is', without any express or implied
11 warranty. In no event will the authors be held liable for any
12 damages arising from the use of this software.
13 
14 Permission is granted to anyone to use this software for any
15 purpose, including commercial applications, and to alter it and
16 redistribute it freely, subject to the following restrictions:
17 
18 1. The origin of this software must not be misrepresented; you
19 must not claim that you wrote the original software. If you use
20 this software in a product, an acknowledgment in the product
21 documentation would be appreciated but is not required.
22 
23 2. Altered source versions must be plainly marked as such, and
24 must not be misrepresented as being the original software.
25 
26 3. This notice may not be removed or altered from any source
27 distribution.
28 
29 -------------------------------------------------------------*/
30 
31 #ifndef __IPC_H__
32 #define __IPC_H__
33 
34 #include <gctypes.h>
35 
36 #define IPC_HEAP -1
37 
38 #define IPC_OPEN_NONE 0
39 #define IPC_OPEN_READ 1
40 #define IPC_OPEN_WRITE 2
41 #define IPC_OPEN_RW (IPC_OPEN_READ|IPC_OPEN_WRITE)
42 
43 #define IPC_MAXPATH_LEN 64
44 
45 #define IPC_OK 0
46 #define IPC_EINVAL -4
47 #define IPC_ENOHEAP -5
48 #define IPC_ENOENT -6
49 #define IPC_EQUEUEFULL -8
50 #define IPC_ENOMEM -22
51 
52 #ifdef __cplusplus
53  extern "C" {
54 #endif /* __cplusplus */
55 
56 typedef struct _ioctlv
57 {
58  void *data;
60 } ioctlv;
61 
62 void __IPC_Reinitialize(void);
63 
64 typedef s32 (*ipccallback)(s32 result,void *usrdata);
65 
67 void* iosAlloc(s32 hid,s32 size);
68 void iosFree(s32 hid,void *ptr);
69 
70 void* IPC_GetBufferLo();
71 void* IPC_GetBufferHi();
72 void IPC_SetBufferLo(void *bufferlo);
73 void IPC_SetBufferHi(void *bufferhi);
74 
75 s32 IOS_Open(const char *filepath,u32 mode);
76 s32 IOS_OpenAsync(const char *filepath,u32 mode,ipccallback ipc_cb,void *usrdata);
77 
78 s32 IOS_Close(s32 fd);
79 s32 IOS_CloseAsync(s32 fd,ipccallback ipc_cb,void *usrdata);
80 
81 s32 IOS_Seek(s32 fd,s32 where,s32 whence);
82 s32 IOS_SeekAsync(s32 fd,s32 where,s32 whence,ipccallback ipc_cb,void *usrdata);
83 s32 IOS_Read(s32 fd,void *buf,s32 len);
84 s32 IOS_ReadAsync(s32 fd,void *buf,s32 len,ipccallback ipc_cb,void *usrdata);
85 s32 IOS_Write(s32 fd,const void *buf,s32 len);
86 s32 IOS_WriteAsync(s32 fd,const void *buf,s32 len,ipccallback ipc_cb,void *usrdata);
87 
88 s32 IOS_Ioctl(s32 fd,s32 ioctl,void *buffer_in,s32 len_in,void *buffer_io,s32 len_io);
89 s32 IOS_IoctlAsync(s32 fd,s32 ioctl,void *buffer_in,s32 len_in,void *buffer_io,s32 len_io,ipccallback ipc_cb,void *usrdata);
90 s32 IOS_Ioctlv(s32 fd,s32 ioctl,s32 cnt_in,s32 cnt_io,ioctlv *argv);
91 s32 IOS_IoctlvAsync(s32 fd,s32 ioctl,s32 cnt_in,s32 cnt_io,ioctlv *argv,ipccallback ipc_cb,void *usrdata);
92 
93 s32 IOS_IoctlvFormat(s32 hId,s32 fd,s32 ioctl,const char *format,...);
94 s32 IOS_IoctlvFormatAsync(s32 hId,s32 fd,s32 ioctl,ipccallback usr_cb,void *usr_data,const char *format,...);
95 
96 s32 IOS_IoctlvReboot(s32 fd,s32 ioctl,s32 cnt_in,s32 cnt_io,ioctlv *argv);
97 s32 IOS_IoctlvRebootBackground(s32 fd,s32 ioctl,s32 cnt_in,s32 cnt_io,ioctlv *argv);
98 
99 #ifdef __cplusplus
100  }
101 #endif /* __cplusplus */
102 
103 #endif
s32 IOS_IoctlvReboot(s32 fd, s32 ioctl, s32 cnt_in, s32 cnt_io, ioctlv *argv)
const GLvoid * ptr
Definition: nx_glsym.h:242
int32_t s32
32bit signed integer
Definition: gctypes.h:24
GLenum mode
Definition: glext.h:6857
s32 IOS_Close(s32 fd)
s32 IOS_OpenAsync(const char *filepath, u32 mode, ipccallback ipc_cb, void *usrdata)
s32 IOS_Read(s32 fd, void *buf, s32 len)
void * IPC_GetBufferLo()
Data type definitions.
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
s32 IOS_ReadAsync(s32 fd, void *buf, s32 len, ipccallback ipc_cb, void *usrdata)
u32 usr_data
Definition: gx_regdef.h:5096
s32 IOS_Open(const char *filepath, u32 mode)
GLenum GLsizei len
Definition: glext.h:7389
GLsizeiptr size
Definition: glext.h:6559
void __IPC_Reinitialize(void)
void iosFree(s32 hid, void *ptr)
struct _ioctlv ioctlv
s32 IOS_IoctlvFormatAsync(s32 hId, s32 fd, s32 ioctl, ipccallback usr_cb, void *usr_data, const char *format,...)
s32 IOS_Write(s32 fd, const void *buf, s32 len)
void IPC_SetBufferLo(void *bufferlo)
s32 IOS_SeekAsync(s32 fd, s32 where, s32 whence, ipccallback ipc_cb, void *usrdata)
s32 iosCreateHeap(s32 size)
s32 IOS_WriteAsync(s32 fd, const void *buf, s32 len, ipccallback ipc_cb, void *usrdata)
s32 IOS_IoctlvAsync(s32 fd, s32 ioctl, s32 cnt_in, s32 cnt_io, ioctlv *argv, ipccallback ipc_cb, void *usrdata)
s32 IOS_Ioctlv(s32 fd, s32 ioctl, s32 cnt_in, s32 cnt_io, ioctlv *argv)
static s32 hId
Definition: usbkeyboard.c:77
s32 IOS_Seek(s32 fd, s32 where, s32 whence)
void * data
Definition: ipc.h:58
s32 IOS_IoctlvRebootBackground(s32 fd, s32 ioctl, s32 cnt_in, s32 cnt_io, ioctlv *argv)
Definition: ipc.h:56
static char * filepath
Definition: mpv-libretro.c:60
GLuint64EXT * result
Definition: glext.h:12211
u32 len
Definition: ipc.h:59
s32 IOS_IoctlvFormat(s32 hId, s32 fd, s32 ioctl, const char *format,...)
void * IPC_GetBufferHi()
s32 IOS_IoctlAsync(s32 fd, s32 ioctl, void *buffer_in, s32 len_in, void *buffer_io, s32 len_io, ipccallback ipc_cb, void *usrdata)
s32 IOS_CloseAsync(s32 fd, ipccallback ipc_cb, void *usrdata)
void * iosAlloc(s32 hid, s32 size)
s32(* ipccallback)(s32 result, void *usrdata)
Definition: ipc.h:64
void IPC_SetBufferHi(void *bufferhi)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glext.h:6293
s32 IOS_Ioctl(s32 fd, s32 ioctl, void *buffer_in, s32 len_in, void *buffer_io, s32 len_io)
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19