diag-trace 5.0.1
µOS++ Tracing Infrastructure
Loading...
Searching...
No Matches
trace-c-api.cpp
Go to the documentation of this file.
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
56
57ssize_t
58micro_os_plus_trace_write (const void* buf, size_t nbyte)
59{
61}
62
63void
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{
87 return detail::tracer<detail::implementation>::vprintf (format, arguments);
88}
89
90int
95
96int
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// ----------------------------------------------------------------------------
static void initialise(void) noexcept
Initialise the trace output channel.
Definition cpp-api.h:432
static int puts(const char *s="") noexcept
Write the string and a line terminator to the trace output channel.
static int vprintf(const char *format, std::va_list arguments) noexcept
Write a formatted variable arguments list to the trace output channel.
static void dump_args(int argc, char *argv[], const char *name="main") noexcept
Send the argv[] array to the trace output channel.
static ssize_t write(const void *buf, std::size_t nbyte) noexcept
Write the given number of bytes to the trace output channel.
Definition cpp-api.h:453
static void flush(void) noexcept
Flush the trace output channel.
Definition cpp-api.h:477
static int putchar(int c) noexcept
Write the single character to the trace output channel.
void micro_os_plus_trace_dump_args(int argc, char *argv[])
Write the argv[] array to the trace output channel.
void micro_os_plus_trace_initialise(void)
Initialise the trace output channel.
ssize_t micro_os_plus_trace_write(const void *buf, size_t nbyte)
Write the given number of bytes to the trace output channel.
void micro_os_plus_trace_flush(void)
Flush the trace output channel.
int micro_os_plus_trace_printf(const char *format,...)
Write a formatted string to the trace output channel.
int micro_os_plus_trace_puts(const char *s)
Write the string and a line terminator to the trace output channel.
int micro_os_plus_trace_vprintf(const char *format, va_list arguments)
Write a formatted variable arguments list to the trace output channel.
int micro_os_plus_trace_putchar(int c)
Write the single character to the trace output channel.
Implementation details namespace.
Definition cpp-api.h:286
C++ header file with the declarations for the µOS++ Tracing Infrastructure.