PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
printf.h
1
39#ifndef PRINTF_H_
40#define PRINTF_H_
41
42#ifdef __cplusplus
43# include <cstdarg>
44# include <cstddef>
45extern "C" {
46#else
47# include <stdarg.h>
48# include <stddef.h>
49#endif
50
51#ifdef __GNUC__
52# define ATTR_PRINTF(one_based_format_index, first_arg) \
53__attribute__((format(__printf__, (one_based_format_index), (first_arg))))
54# define ATTR_VPRINTF(one_based_format_index) ATTR_PRINTF((one_based_format_index), 0)
55#else
56# define ATTR_PRINTF((one_based_format_index), (first_arg))
57# define ATTR_VPRINTF(one_based_format_index)
58#endif
59
60#ifndef PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
61#define PRINTF_ALIAS_STANDARD_FUNCTION_NAMES 0
62#endif
63
64#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
65# define printf_ printf
66# define sprintf_ sprintf
67# define vsprintf_ vsprintf
68# define snprintf_ snprintf
69# define vsnprintf_ vsnprintf
70# define vprintf_ vprintf
71#endif
72
73// If you want to include this implementation file directly rather than
74// link against, this will let you control the functions' visibility,
75// e.g. make them static so as not to clash with other objects also
76// using them.
77#ifndef PRINTF_VISIBILITY
78#define PRINTF_VISIBILITY
79#endif
80
100PRINTF_VISIBILITY
101void putchar_(char c);
102
103
117PRINTF_VISIBILITY
118int printf_(const char* format, ...) ATTR_PRINTF(1, 2);
119PRINTF_VISIBILITY
120int vprintf_(const char* format, va_list arg) ATTR_VPRINTF(1);
122
123
138PRINTF_VISIBILITY
139int sprintf_(char* s, const char* format, ...) ATTR_PRINTF(2, 3);
140PRINTF_VISIBILITY
141int vsprintf_(char* s, const char* format, va_list arg) ATTR_VPRINTF(2);
143
144
161PRINTF_VISIBILITY
162int snprintf_(char* s, size_t count, const char* format, ...) ATTR_PRINTF(3, 4);
163PRINTF_VISIBILITY
164int vsnprintf_(char* s, size_t count, const char* format, va_list arg) ATTR_VPRINTF(3);
166
167
168
183PRINTF_VISIBILITY
184int fctprintf(void (*out)(char c, void* extra_arg), void* extra_arg, const char* format, ...) ATTR_PRINTF(3, 4);
185PRINTF_VISIBILITY
186int vfctprintf(void (*out)(char c, void* extra_arg), void* extra_arg, const char* format, va_list arg) ATTR_VPRINTF(3);
187
188#ifdef __cplusplus
189} // extern "C"
190#endif
191
192#if PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
193# undef printf_
194# undef sprintf_
195# undef vsprintf_
196# undef snprintf_
197# undef vsnprintf_
198# undef vprintf_
199#endif
200
201#endif // PRINTF_H_
u32 count
start sector of fragmented bd/file