7#ifndef ZEPHYR_INCLUDE_SYS_CBPRINTF_H_
8#define ZEPHYR_INCLUDE_SYS_CBPRINTF_H_
15#ifdef CONFIG_CBPRINTF_LIBC_SUBSTS
30#if defined(__cplusplus) || (((__STDC_VERSION__ >= 201112L) || \
31 ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40900) || \
32 ((__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) >= 30800)))
54#define CBPRINTF_PACKAGE_ALIGNMENT 16
55#elif defined(CONFIG_X86) && !defined(CONFIG_64BIT)
59#define CBPRINTF_PACKAGE_ALIGNMENT \
60 (IS_ENABLED(CONFIG_CBPRINTF_PACKAGE_LONGDOUBLE) ? \
61 16 : MAX(sizeof(double), sizeof(long long)))
63#define CBPRINTF_PACKAGE_ALIGNMENT \
64 (IS_ENABLED(CONFIG_CBPRINTF_PACKAGE_LONGDOUBLE) ? \
65 sizeof(long double) : MAX(sizeof(double), sizeof(long long)))
78#define CBPRINTF_PACKAGE_ADD_STRING_IDXS BIT(0)
91#define CBPRINTF_MUST_RUNTIME_PACKAGE_CONST_CHAR BIT(0)
133 const char *fmt, va_list ap);
156#define CBPRINTF_MUST_RUNTIME_PACKAGE(skip, flags, ... ) \
157 Z_CBPRINTF_MUST_RUNTIME_PACKAGE(skip, flags, __VA_ARGS__)
188#define CBPRINTF_STATIC_PACKAGE(packaged, inlen, outlen, align_offset, flags, \
190 Z_CBPRINTF_STATIC_PACKAGE(packaged, inlen, outlen, \
191 align_offset, flags, __VA_ARGS__)
415#ifdef CONFIG_CBPRINTF_LIBC_SUBSTS
517int snprintfcb(
char *str,
size_t size, const
char *format, ...);
541int vsnprintfcb(
char *str,
size_t size, const
char *format, va_list ap);
int cbpprintf_external(cbprintf_cb out, cbvprintf_exteral_formatter_func formatter, void *ctx, void *packaged)
Generate the output for a previously captured format operation using an external formatter.
int cbprintf(cbprintf_cb out, void *ctx, const char *format,...)
*printf-like output through a callback.
static int cbpprintf(cbprintf_cb out, void *ctx, void *packaged)
Generate the output for a previously captured format operation.
Definition: cbprintf.h:410
int printfcb(const char *format,...)
printf using Zephyrs cbprintf infrastructure.
int vfprintfcb(FILE *stream, const char *format, va_list ap)
vfprintf using Zephyrs cbprintf infrastructure.
int fprintfcb(FILE *stream, const char *format,...)
fprintf using Zephyrs cbprintf infrastructure.
int vsnprintfcb(char *str, size_t size, const char *format, va_list ap)
vsnprintf using Zephyrs cbprintf infrastructure.
int cbvprintf(cbprintf_cb out, void *ctx, const char *format, va_list ap)
varargs-aware *printf-like output through a callback.
int cbprintf_fsc_package(void *in_packaged, size_t in_len, void *packaged, size_t len)
Convert package to fully self-contained (fsc) package.
int snprintfcb(char *str, size_t size, const char *format,...)
snprintf using Zephyrs cbprintf infrastructure.
int vprintfcb(const char *format, va_list ap)
vprintf using Zephyrs cbprintf infrastructure.
int cbvprintf_package(void *packaged, size_t len, uint32_t flags, const char *format, va_list ap)
Capture state required to output formatted data later.
int(* cbprintf_cb)()
Signature for a cbprintf callback function.
Definition: cbprintf.h:112
int(* cbvprintf_exteral_formatter_func)(cbprintf_cb out, void *ctx, const char *fmt, va_list ap)
Signature for a external formatter function identical to cbvprintf.
Definition: cbprintf.h:132
int cbprintf_package(void *packaged, size_t len, uint32_t flags, const char *format,...)
Capture state required to output formatted data later.
flags
Definition: http_parser.h:131
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
int FILE
Definition: stdio.h:22