picofuse

printf.h
Go to the documentation of this file.
1 
64 #pragma once
65 #include "io.h"
66 #include <stdarg.h>
67 #include <stddef.h>
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
74 
84 extern void sys_puts(const char *str);
85 
94 extern void sys_putch(const char ch);
95 
104 extern size_t sys_printf(const char *format, ...);
105 
113 extern size_t sys_vprintf(const char *format, va_list args);
114 
123 extern size_t sys_fprintf(sys_iostream_t *stream, const char *format, ...);
124 
133 extern size_t sys_vfprintf(sys_iostream_t *stream, const char *format,
134  va_list args);
135 
148 extern size_t sys_sprintf(char *buf, size_t sz, const char *format, ...);
149 
162 extern size_t sys_vsprintf(char *buf, size_t sz, const char *format,
163  va_list args);
164 
173 typedef const char *(*sys_printf_format_handler_t)(char format, va_list *va);
174 
190 extern size_t sys_vprintf_ex(const char *format, va_list args,
191  sys_printf_format_handler_t custom_handler);
192 
213 extern size_t sys_vsprintf_ex(char *buf, size_t sz, const char *format,
214  va_list args,
215  sys_printf_format_handler_t custom_handler);
216 
237 extern size_t sys_sprintf_ex(char *buf, size_t sz, const char *format,
238  sys_printf_format_handler_t custom_handler, ...);
239 
241 
242 #ifdef __cplusplus
243 }
244 #endif
size_t sys_printf(const char *format,...)
Prints formatted output to the system console.
const char *(* sys_printf_format_handler_t)(char format, va_list *va)
Custom format handler function type.
Definition: printf.h:173
void sys_putch(const char ch)
Outputs a character to the system console or standard output.
size_t sys_sprintf(char *buf, size_t sz, const char *format,...)
Prints formatted output to a string buffer.
void sys_puts(const char *str)
Outputs a string to the system console or standard output.
size_t sys_vprintf(const char *format, va_list args)
Prints formatted output using a va_list argument.
Opaque byte streams for reading, writing, seeking, and readiness notification.
size_t sys_vsprintf(char *buf, size_t sz, const char *format, va_list args)
Prints formatted output to a string buffer using a va_list argument.
struct sys_iostream_t sys_iostream_t
An opaque byte stream.
Definition: io.h:70
size_t sys_sprintf_ex(char *buf, size_t sz, const char *format, sys_printf_format_handler_t custom_handler,...)
Prints formatted output to a string buffer with custom format handler support.
size_t sys_vfprintf(sys_iostream_t *stream, const char *format, va_list args)
Prints formatted output to a stream using a va_list argument.
size_t sys_vprintf_ex(const char *format, va_list args, sys_printf_format_handler_t custom_handler)
Prints formatted output using a va_list argument with custom format handler support.
size_t sys_vsprintf_ex(char *buf, size_t sz, const char *format, va_list args, sys_printf_format_handler_t custom_handler)
Prints formatted output to a string buffer using a va_list argument with custom format handler suppor...
size_t sys_fprintf(sys_iostream_t *stream, const char *format,...)
Prints formatted output to a stream.