SSBM Decomp
Toggle main menu visibility
Loading...
Searching...
No Matches
stdio.h
Go to the documentation of this file.
1
#ifndef _STDIO_H_
2
#define _STDIO_H_
3
4
#include <
stdarg.h
>
5
#include <
stddef.h
>
6
7
#define SEEK_SET 0
8
#define SEEK_CUR 1
9
#define SEEK_END 2
10
11
#define __ungetc_buffer_size 2
12
13
typedef
unsigned
long
__file_handle
;
14
typedef
unsigned
long
fpos_t
;
15
16
#ifdef __MWERKS__
17
typedef
unsigned
short
wchar_t
;
18
#endif
19
20
enum
__io_modes
{
21
__read
= 1,
22
__write
= 2,
23
__read_write
= 3,
24
__append
= 4,
25
};
26
enum
__file_kinds
{
27
__closed_file
,
28
__disk_file
,
29
__console_file
,
30
__unavailable_file
,
31
};
32
enum
__file_orientation
{
33
__unoriented
,
34
__char_oriented
,
35
__wide_oriented
,
36
};
37
38
enum
__io_results
{
39
__no_io_error
,
40
__io_error
,
41
__io_EOF
,
42
};
43
44
typedef
struct
{
45
unsigned
int
open_mode
: 2;
46
unsigned
int
io_mode
: 3;
47
unsigned
int
buffer_mode
: 2;
48
unsigned
int
file_kind
: 3;
49
unsigned
int
file_orientation
: 2;
50
unsigned
int
binary_io
: 1;
51
}
__file_modes
;
52
53
enum
__io_states
{
54
__neutral
,
55
__writing
,
56
__reading
,
57
__rereading
,
58
};
59
60
typedef
struct
{
61
unsigned
int
io_state
: 3;
62
unsigned
int
free_buffer
: 1;
63
unsigned
char
eof
;
64
unsigned
char
error
;
65
}
__file_state
;
66
67
typedef
void (*
__idle_proc
)(void);
68
typedef
int (*
__pos_proc
)(
__file_handle
file,
fpos_t
* position,
int
mode,
69
__idle_proc
idle_proc);
70
typedef
int (*
__io_proc
)(
__file_handle
file,
unsigned
char
* buff,
71
size_t
* count,
__idle_proc
idle_proc);
72
typedef
int (*
__close_proc
)(
__file_handle
file);
73
74
typedef
struct
_IO_FILE {
75
__file_handle
handle
;
76
__file_modes
mode
;
77
__file_state
state
;
78
unsigned
char
char_buffer
;
79
unsigned
char
char_buffer_overflow
;
80
unsigned
char
ungetc_buffer
[
__ungetc_buffer_size
];
81
wchar_t
ungetwc_buffer
[
__ungetc_buffer_size
];
82
unsigned
long
position
;
83
unsigned
char
*
buffer
;
84
unsigned
long
buffer_size
;
85
unsigned
char
*
buffer_ptr
;
86
unsigned
long
buffer_len
;
87
unsigned
long
buffer_alignment
;
88
unsigned
long
saved_buffer_len
;
89
unsigned
long
buffer_pos
;
90
__pos_proc
position_proc
;
91
__io_proc
read_proc
;
92
__io_proc
write_proc
;
93
__close_proc
close_proc
;
94
__idle_proc
idle_proc
;
95
}
FILE
;
96
97
typedef
struct
{
98
char
*
CharStr
;
99
size_t
MaxCharCount
;
100
size_t
CharsWritten
;
101
}
__OutStrCtrl
;
102
103
typedef
struct
{
104
char
*
NextChar
;
105
int
NullCharDetected
;
106
}
__InStrCtrl
;
107
108
#define EOF -1L
109
110
enum
__ReadProcActions
{
111
__GetAChar
,
112
__UngetAChar
,
113
__TestForError
,
114
};
115
116
int
__StringRead
(
void
* str,
int
ch,
int
behavior);
117
118
#define _IONBF 0
119
#define _IOLBF 1
120
#define _IOFBF 2
121
122
extern
FILE
__files
[3];
123
124
#define stdin (&__files[0])
125
#define stdout (&__files[1])
126
#define stderr (&__files[2])
127
128
int
printf
(
const
char
* format, ...);
129
int
sprintf
(
char
* s,
const
char
* format, ...);
130
int
vprintf
(
const
char
* format,
va_list
arg);
131
int
vsprintf
(
char
* s,
const
char
* format,
va_list
arg);
132
133
size_t
fwrite
(
const
void
*,
size_t
memb_size,
size_t
num_memb,
FILE
*);
134
135
#endif
// _STDIO
__files
FILE __files[3]
Definition
ansi_files.c:4
stdarg.h
va_list
__va_list va_list
Definition
stdarg.h:11
stddef.h
wchar_t
unsigned short wchar_t
Definition
stddef.h:4
__io_results
__io_results
Definition
stdio.h:38
__io_EOF
@ __io_EOF
Definition
stdio.h:41
__no_io_error
@ __no_io_error
Definition
stdio.h:39
__io_error
@ __io_error
Definition
stdio.h:40
vprintf
int vprintf(const char *format, va_list arg)
Definition
printf.c:1058
__io_modes
__io_modes
Definition
stdio.h:20
__write
@ __write
Definition
stdio.h:22
__read
@ __read
Definition
stdio.h:21
__read_write
@ __read_write
Definition
stdio.h:23
__append
@ __append
Definition
stdio.h:24
fpos_t
unsigned long fpos_t
Definition
stdio.h:14
__close_proc
int(* __close_proc)(__file_handle file)
Definition
stdio.h:72
vsprintf
int vsprintf(char *s, const char *format, va_list arg)
Definition
printf.c:1080
printf
int printf(const char *format,...)
Definition
printf.c:1041
sprintf
int sprintf(char *s, const char *format,...)
Definition
printf.c:1085
__ungetc_buffer_size
#define __ungetc_buffer_size
Definition
stdio.h:11
__ReadProcActions
__ReadProcActions
Definition
stdio.h:110
__GetAChar
@ __GetAChar
Definition
stdio.h:111
__UngetAChar
@ __UngetAChar
Definition
stdio.h:112
__TestForError
@ __TestForError
Definition
stdio.h:113
__io_states
__io_states
Definition
stdio.h:53
__reading
@ __reading
Definition
stdio.h:56
__rereading
@ __rereading
Definition
stdio.h:57
__neutral
@ __neutral
Definition
stdio.h:54
__writing
@ __writing
Definition
stdio.h:55
fwrite
size_t fwrite(const void *, size_t memb_size, size_t num_memb, FILE *)
Definition
direct_io.c:8
__pos_proc
int(* __pos_proc)(__file_handle file, fpos_t *position, int mode, __idle_proc idle_proc)
Definition
stdio.h:68
__file_kinds
__file_kinds
Definition
stdio.h:26
__unavailable_file
@ __unavailable_file
Definition
stdio.h:30
__closed_file
@ __closed_file
Definition
stdio.h:27
__disk_file
@ __disk_file
Definition
stdio.h:28
__console_file
@ __console_file
Definition
stdio.h:29
__idle_proc
void(* __idle_proc)(void)
Definition
stdio.h:67
__io_proc
int(* __io_proc)(__file_handle file, unsigned char *buff, size_t *count, __idle_proc idle_proc)
Definition
stdio.h:70
__file_handle
unsigned long __file_handle
Definition
stdio.h:13
__StringRead
int __StringRead(void *str, int ch, int behavior)
Definition
string.c:291
__file_orientation
__file_orientation
Definition
stdio.h:32
__wide_oriented
@ __wide_oriented
Definition
stdio.h:35
__char_oriented
@ __char_oriented
Definition
stdio.h:34
__unoriented
@ __unoriented
Definition
stdio.h:33
FILE
Definition
stdio.h:74
FILE::buffer_size
unsigned long buffer_size
Definition
stdio.h:84
FILE::char_buffer
unsigned char char_buffer
Definition
stdio.h:78
FILE::ungetc_buffer
unsigned char ungetc_buffer[__ungetc_buffer_size]
Definition
stdio.h:80
FILE::buffer
unsigned char * buffer
Definition
stdio.h:83
FILE::ungetwc_buffer
wchar_t ungetwc_buffer[__ungetc_buffer_size]
Definition
stdio.h:81
FILE::mode
__file_modes mode
Definition
stdio.h:76
FILE::position
unsigned long position
Definition
stdio.h:82
FILE::close_proc
__close_proc close_proc
Definition
stdio.h:93
FILE::saved_buffer_len
unsigned long saved_buffer_len
Definition
stdio.h:88
FILE::buffer_ptr
unsigned char * buffer_ptr
Definition
stdio.h:85
FILE::write_proc
__io_proc write_proc
Definition
stdio.h:92
FILE::state
__file_state state
Definition
stdio.h:77
FILE::buffer_alignment
unsigned long buffer_alignment
Definition
stdio.h:87
FILE::idle_proc
__idle_proc idle_proc
Definition
stdio.h:94
FILE::buffer_len
unsigned long buffer_len
Definition
stdio.h:86
FILE::position_proc
__pos_proc position_proc
Definition
stdio.h:90
FILE::buffer_pos
unsigned long buffer_pos
Definition
stdio.h:89
FILE::handle
__file_handle handle
Definition
stdio.h:75
FILE::char_buffer_overflow
unsigned char char_buffer_overflow
Definition
stdio.h:79
FILE::read_proc
__io_proc read_proc
Definition
stdio.h:91
__InStrCtrl
Definition
stdio.h:103
__InStrCtrl::NullCharDetected
int NullCharDetected
Definition
stdio.h:105
__InStrCtrl::NextChar
char * NextChar
Definition
stdio.h:104
__OutStrCtrl
Definition
stdio.h:97
__OutStrCtrl::CharsWritten
size_t CharsWritten
Definition
stdio.h:100
__OutStrCtrl::CharStr
char * CharStr
Definition
stdio.h:98
__OutStrCtrl::MaxCharCount
size_t MaxCharCount
Definition
stdio.h:99
__file_modes
Definition
stdio.h:44
__file_modes::file_orientation
unsigned int file_orientation
Definition
stdio.h:49
__file_modes::io_mode
unsigned int io_mode
Definition
stdio.h:46
__file_modes::file_kind
unsigned int file_kind
Definition
stdio.h:48
__file_modes::open_mode
unsigned int open_mode
Definition
stdio.h:45
__file_modes::binary_io
unsigned int binary_io
Definition
stdio.h:50
__file_modes::buffer_mode
unsigned int buffer_mode
Definition
stdio.h:47
__file_state
Definition
stdio.h:60
__file_state::eof
unsigned char eof
Definition
stdio.h:63
__file_state::io_state
unsigned int io_state
Definition
stdio.h:61
__file_state::error
unsigned char error
Definition
stdio.h:64
__file_state::free_buffer
unsigned int free_buffer
Definition
stdio.h:62
src
MSL
stdio.h
Generated by
1.17.0