sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
printf.h
Go to the documentation of this file.
1
38
43#ifndef PRINTF_H_
44#define PRINTF_H_
45
46#ifdef __cplusplus
47# include <cstdarg>
48# include <cstddef>
49extern "C" {
50#else
51# include <stdarg.h>
52# include <stddef.h>
53#endif
54
55#ifdef __GNUC__
56# define ATTR_PRINTF(one_based_format_index, first_arg) \
57__attribute__((format(__printf__, (one_based_format_index), (first_arg))))
58# define ATTR_VPRINTF(one_based_format_index) ATTR_PRINTF((one_based_format_index), 0)
59#else
60# define ATTR_PRINTF((one_based_format_index), (first_arg))
61# define ATTR_VPRINTF(one_based_format_index)
62#endif
63
64#ifndef PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
65#define PRINTF_ALIAS_STANDARD_FUNCTION_NAMES 0
66#endif
67
68#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
69# define printf_ printf
70# define sprintf_ sprintf
71# define vsprintf_ vsprintf
72# define snprintf_ snprintf
73# define vsnprintf_ vsnprintf
74# define vprintf_ vprintf
75#endif
76
77// If you want to include this implementation file directly rather than
78// link against, this will let you control the functions' visibility,
79// e.g. make them static so as not to clash with other objects also
80// using them.
81#ifndef PRINTF_VISIBILITY
82#define PRINTF_VISIBILITY
83#endif
84
104PRINTF_VISIBILITY
105void putchar_(char c);
106
107
121PRINTF_VISIBILITY
122int printf_(const char* format, ...) ATTR_PRINTF(1, 2);
123PRINTF_VISIBILITY
124int vprintf_(const char* format, va_list arg) ATTR_VPRINTF(1);
126
127
142PRINTF_VISIBILITY
143int sprintf_(char* s, const char* format, ...) ATTR_PRINTF(2, 3);
144PRINTF_VISIBILITY
145int vsprintf_(char* s, const char* format, va_list arg) ATTR_VPRINTF(2);
147
148
165PRINTF_VISIBILITY
166int snprintf_(char* s, size_t count, const char* format, ...) ATTR_PRINTF(3, 4);
167PRINTF_VISIBILITY
168int vsnprintf_(char* s, size_t count, const char* format, va_list arg) ATTR_VPRINTF(3);
170
171
172
187PRINTF_VISIBILITY
188int fctprintf(void (*out)(char c, void* extra_arg), void* extra_arg, const char* format, ...) ATTR_PRINTF(3, 4);
189PRINTF_VISIBILITY
190int vfctprintf(void (*out)(char c, void* extra_arg), void* extra_arg, const char* format, va_list arg) ATTR_VPRINTF(3);
191
192#ifdef __cplusplus
193} // extern "C"
194#endif
195
196#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
197# undef printf_
198# undef sprintf_
199# undef vsprintf_
200# undef snprintf_
201# undef vsnprintf_
202# undef vprintf_
203#endif
204
205#endif // PRINTF_H_
PRINTF_VISIBILITY int printf_(const char *format,...) ATTR_PRINTF(1
u32 count
start sector of fragmented bd/file