Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
printk.h
Go to the documentation of this file.
1/* printk.h - low-level debug output */
2
3/*
4 * Copyright (c) 2010-2012, 2014 Wind River Systems, Inc.
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8#ifndef ZEPHYR_INCLUDE_SYS_PRINTK_H_
9#define ZEPHYR_INCLUDE_SYS_PRINTK_H_
10
11#include <zephyr/toolchain.h>
12#include <stddef.h>
13#include <stdarg.h>
14#include <inttypes.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
45#ifdef CONFIG_PRINTK
46
47__printf_like(1, 2) void printk(const char *fmt, ...);
48__printf_like(1, 0) void vprintk(const char *fmt, va_list ap);
49
50#else
51static inline __printf_like(1, 2) void printk(const char *fmt, ...)
52{
53 ARG_UNUSED(fmt);
54}
55
56static inline __printf_like(1, 0) void vprintk(const char *fmt, va_list ap)
57{
58 ARG_UNUSED(fmt);
59 ARG_UNUSED(ap);
60}
61#endif
62
63#ifdef CONFIG_PICOLIBC
64
65#include <stdio.h>
66
67#define snprintk(...) snprintf(__VA_ARGS__)
68#define vsnprintk(str, size, fmt, ap) vsnprintf(str, size, fmt, ap)
69
70#else
71
72__printf_like(3, 4) int snprintk(char *str, size_t size,
73 const char *fmt, ...);
74__printf_like(3, 0) int vsnprintk(char *str, size_t size,
75 const char *fmt, va_list ap);
76
77#endif
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif
int snprintk(char *str, size_t size, const char *fmt,...)
static void vprintk(const char *fmt, va_list ap)
Definition: printk.h:56
static void printk(const char *fmt,...)
Print kernel debugging message.
Definition: printk.h:51
int vsnprintk(char *str, size_t size, const char *fmt, va_list ap)
Macros to abstract toolchain specific capabilities.