76int vxprintf(
void (*func)(
const char *,
int,
void *),
void *opaque,
const char *fmt, va_list ap);
90int vsprintf(
char *
buf,
const char *fmt, va_list ap);
106int vsnprintf(
char *
buf,
size_t n,
const char *fmt, va_list ap);
123static inline int xprintf(
void (*func)(
const char *,
int,
void *),
void *arg,
const char *fmt, ...) {
131static inline int sprintf(
char *
buf,
const char *fmt, ...) {
139static inline int snprintf(
char *
buf,
size_t n,
const char *fmt, ...) {
147static inline int asprintf(
char **
out,
const char *fmt, ...) {
155static inline void writeToTTYCallback(
const char *str,
int len,
void *opaque) { syscall_write(1, str, len); }
156static inline int vprintf(
const char *fmt, va_list ap) {
return vxprintf(writeToTTYCallback, NULL, fmt, ap); }
157static inline int printf(
const char *fmt, ...) {
160 int ret = vprintf(fmt, ap);
168#include <EASTL/fixed_string.h>
169#include <EASTL/string.h>
181template <
int nodeCount,
bool bEnableOverflow = true>
182static inline void vfsprintf(eastl::fixed_string<char, nodeCount, bEnableOverflow> &str,
const char *fmt, va_list ap) {
185 [](
const char *str,
int len,
void *opaque) {
186 eastl::fixed_string<char, nodeCount, bEnableOverflow> *
out =
187 (eastl::fixed_string<char, nodeCount, bEnableOverflow> *)opaque;
188 out->append(str, len);
193template <
int nodeCount,
bool bEnableOverflow = true>
194static inline void fsprintf(eastl::fixed_string<char, nodeCount, bEnableOverflow> &str,
const char *fmt, ...) {
198 vfsprintf<nodeCount, bEnableOverflow>(str, fmt, ap);
212static inline eastl::string
vsprintf(
const char *fmt, va_list ap) {
215 [](
const char *str,
int len,
void *opaque) {
216 eastl::string *
ret = (eastl::string *)opaque;
217 ret->append(str, len);
223static inline eastl::string sprintf(
const char *fmt, ...) {
uint32_t out
Definition cpu.c:62
#define printf
Definition demo.c:34
static int ret
Definition syscalls.h:72
static const void * buf
Definition syscalls.h:60
int vsprintf(char *buf, const char *fmt, va_list ap)
Prints a formatted string to a string.
Definition xprintf.c:728
int vxprintf(void(*func)(const char *, int, void *), void *opaque, const char *fmt, va_list ap)
Prints a formatted string to a callback.
int vasprintf(char **out, const char *fmt, va_list ap)
Prints a formatted string to a newly allocated string.
Definition xprintf.c:793
int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap)
Prints a formatted string to a length-limited string.
Definition xprintf.c:735