Skip to main content

trace-c-api.cpp File

C++ source file with the definitions for the C trace API. More...

Included Headers

Functions Index

voidmicro_os_plus_trace_dump_args (int argc, char *argv[])

Write the argv[] array to the trace output channel. More...

voidmicro_os_plus_trace_flush (void)

Flush the trace output channel. More...

voidmicro_os_plus_trace_initialise (void)

Initialise the trace output channel. More...

intmicro_os_plus_trace_printf (const char *format,...)

Write a formatted string to the trace output channel. More...

intmicro_os_plus_trace_putchar (int c)

Write the single character to the trace output channel. More...

intmicro_os_plus_trace_puts (const char *s)

Write the string and a line terminator to the trace output channel. More...

intmicro_os_plus_trace_vprintf (const char *format, va_list arguments)

Write a formatted variable arguments list to the trace output channel. More...

ssize_tmicro_os_plus_trace_write (const void *buf, size_t nbyte)

Write the given number of bytes to the trace output channel. More...

Description

C++ source file with the definitions for the C trace API.

Definitions for the C-linkage wrapper functions (micro_os_plus_trace_printf(), etc.) that forward to the corresponding C++ internal tracer<implementation> functions.

The empty inline stubs (used when tracing is disabled) are located in c-api-inlines.h, included at the bottom of c-api.h.

File Listing

The file content with the documentation metadata removed is:

1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2015-2026 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can be
9 * obtained from https://opensource.org/licenses/mit.
10 */
11
12// ----------------------------------------------------------------------------
13
27
28// ----------------------------------------------------------------------------
29
31
32// ----------------------------------------------------------------------------
33
34#if defined(MICRO_OS_PLUS_DIAG_TRACE_ENABLED)
35
36// ----------------------------------------------------------------------------
37
38#if defined(__clang__)
39#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
40#endif // defined(__clang__)
41
42// ----------------------------------------------------------------------------
43
45
46// The C API is always bound to the `tracer<implementation>` policy class;
47// extern "C" does not support templates, so it cannot expose other
48// instances. Code that needs custom instances must call the C++
49// API directly.
50
51void
53{
55}
56
57ssize_t
58micro_os_plus_trace_write (const void* buf, size_t nbyte)
59{
61}
62
63void
65{
67}
68
69// ----------------------------------------------------------------------------
70
71int
72micro_os_plus_trace_printf (const char* format, ...)
73{
74 std::va_list arguments;
75 va_start (arguments, format);
76
77 int ret
79
80 va_end (arguments);
81 return ret;
82}
83
84int
85micro_os_plus_trace_vprintf (const char* format, va_list arguments)
86{
88}
89
90int
92{
94}
95
96int
98{
100}
101
102void
103micro_os_plus_trace_dump_args (int argc, char* argv[])
104{
106}
107
108// ----------------------------------------------------------------------------
109
110#endif // defined(MICRO_OS_PLUS_DIAG_TRACE_ENABLED)
111
112// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.17.0.