PS2SDK
PS2 Homebrew Libraries
sior.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 __SIOR_H__
17 #define __SIOR_H__
18 
19 #include <stdarg.h>
20 #include <irx.h>
21 
22 #include <sior-common.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 extern void sio_init(u32 baudrate, u8 lcr_ueps, u8 lcr_upen, u8 lcr_usbl, u8 lcr_umode);
29 extern int sio_putc(int c);
30 extern int sio_getc(void);
31 extern int sio_getc_block(void);
32 
33 extern size_t sio_write(const char *buf, size_t size);
34 extern size_t sio_read(char *buf, size_t size);
35 
36 extern int sio_puts(const char *str);
37 extern int sio_putsn(const char *str); // no newline for this one
38 extern char *sio_gets(char *str);
39 
40 extern void sio_flush(void);
41 
42 extern int sio_printf(const char *format, ...);
43 extern int sio_vprintf(const char *format, va_list);
44 
45 #define sior_IMPORTS_start DECLARE_IMPORT_TABLE(sior, 1, 1)
46 #define sior_IMPORTS_end END_IMPORT_TABLE
47 
48 #define I_sio_init DECLARE_IMPORT(4, sio_init)
49 #define I_sio_putc DECLARE_IMPORT(5, sio_putc)
50 #define I_sio_getc DECLARE_IMPORT(6, sio_getc)
51 #define I_sio_getc_block DECLARE_IMPORT(7, sio_getc_block)
52 #define I_sio_write DECLARE_IMPORT(8, sio_write)
53 #define I_sio_read DECLARE_IMPORT(9, sio_read)
54 #define I_sio_puts DECLARE_IMPORT(10, sio_puts)
55 #define I_sio_putsn DECLARE_IMPORT(11, sio_putsn)
56 #define I_sio_gets DECLARE_IMPORT(12, sio_gets)
57 #define I_sio_flush DECLARE_IMPORT(13, sio_flush)
58 #define I_sio_printf DECLARE_IMPORT(14, sio_printf)
59 #define I_sio_vprintf DECLARE_IMPORT(15, sio_vprintf)
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif /* __SIOR_H__ */
sio_flush
void sio_flush(void)
Definition: sior.c:89
sior-common.h
sio_write
size_t sio_write(void *buf, size_t size)
sio_read
size_t sio_read(void *buf, size_t size)
irx.h
sio_gets
char * sio_gets(char *str)
Definition: sior.c:83
sio_getc_block
int sio_getc_block(void)
Definition: sior.c:52