The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
stdio.h File Reference
#include "stdint.h"
#include "stdarg.h"

Go to the source code of this file.

Typedefs

typedef void(*) StdioPutCharFn(char c)
 signature of a low-level character output function used by stdio.

Functions

void stdio_set_putchar (StdioPutCharFn func)
 configure the low-level output backend for stdio.
void stdio_putchar (char c)
 output a single character through the configured stdio backend.
void puts (const char *str)
 print a null terminated string to the output.
void printf (const char *fmt,...) __attribute__((format(printf
 print a formatted string to the output.
void void stdio_printf_to (StdioPutCharFn out, const char *fmt,...) __attribute__((format(printf
 print a formatted string through a caller-supplied output backend, bypassing the global stdio backend.
void void void stdio_format_args (StdioPutCharFn out, const char *fmt, va_list args)
 format engine entry point for variadic wrappers: they va_start their own arguments and pass the list here.

Typedef Documentation

◆ StdioPutCharFn

typedef void(*) StdioPutCharFn(char c)

signature of a low-level character output function used by stdio.

Parameters
ccharacter to output.

Function Documentation

◆ stdio_set_putchar()

void stdio_set_putchar ( StdioPutCharFn func)

configure the low-level output backend for stdio.

this must be called by each runtime environment before printf/puts are used.

Parameters
funccallback used for character output.

◆ stdio_putchar()

void stdio_putchar ( char c)

output a single character through the configured stdio backend.

if no backend is configured this function does nothing.

Parameters
ccharacter to output.

◆ puts()

void puts ( const char * str)

print a null terminated string to the output.

Parameters
strnull terminated string to print.

◆ printf()

void printf ( const char * fmt,
... )

print a formatted string to the output.

conversions: d i u x X o c s p %%, with the length modifiers hh h l ll z (z: size_t / ssize_t). p prints 0x and pointer-width hex. no field width, precision or flags.

Parameters
fmtformat string.

◆ stdio_printf_to()

void void stdio_printf_to ( StdioPutCharFn out,
const char * fmt,
... )

print a formatted string through a caller-supplied output backend, bypassing the global stdio backend.

lets subsystems (e.g. klog) reuse the printf formatter to write somewhere other than the console.

Parameters
outcharacter output callback.
fmtformat string.

◆ stdio_format_args()

void void void stdio_format_args ( StdioPutCharFn out,
const char * fmt,
va_list args )

format engine entry point for variadic wrappers: they va_start their own arguments and pass the list here.

Parameters
outcharacter output callback.
fmtformat string.
argsthe caller's argument list.