dlt_sys/
dlt_bindings.rs

1/*
2 * Copyright (c) 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS)
3 *
4 * See the NOTICE file(s) distributed with this work for additional
5 * information regarding copyright ownership.
6 *
7 * This program and the accompanying materials are made available under the
8 * terms of the Apache License Version 2.0 which is available at
9 * https://www.apache.org/licenses/LICENSE-2.0
10 *
11 * SPDX-License-Identifier: Apache-2.0
12 */
13
14/* automatically generated by rust-bindgen 0.72.1 */
15
16pub const DLT_ID_SIZE: u32 = 4;
17pub const DltReturnValue_DLT_RETURN_LOAD_EXCEEDED: DltReturnValue = -9;
18pub const DltReturnValue_DLT_RETURN_FILESZERR: DltReturnValue = -8;
19pub const DltReturnValue_DLT_RETURN_LOGGING_DISABLED: DltReturnValue = -7;
20pub const DltReturnValue_DLT_RETURN_USER_BUFFER_FULL: DltReturnValue = -6;
21pub const DltReturnValue_DLT_RETURN_WRONG_PARAMETER: DltReturnValue = -5;
22pub const DltReturnValue_DLT_RETURN_BUFFER_FULL: DltReturnValue = -4;
23pub const DltReturnValue_DLT_RETURN_PIPE_FULL: DltReturnValue = -3;
24pub const DltReturnValue_DLT_RETURN_PIPE_ERROR: DltReturnValue = -2;
25pub const DltReturnValue_DLT_RETURN_ERROR: DltReturnValue = -1;
26pub const DltReturnValue_DLT_RETURN_OK: DltReturnValue = 0;
27pub const DltReturnValue_DLT_RETURN_TRUE: DltReturnValue = 1;
28pub type DltReturnValue = ::std::os::raw::c_int;
29pub const DltLogLevelType_DLT_LOG_DEFAULT: DltLogLevelType = -1;
30pub const DltLogLevelType_DLT_LOG_OFF: DltLogLevelType = 0;
31pub const DltLogLevelType_DLT_LOG_FATAL: DltLogLevelType = 1;
32pub const DltLogLevelType_DLT_LOG_ERROR: DltLogLevelType = 2;
33pub const DltLogLevelType_DLT_LOG_WARN: DltLogLevelType = 3;
34pub const DltLogLevelType_DLT_LOG_INFO: DltLogLevelType = 4;
35pub const DltLogLevelType_DLT_LOG_DEBUG: DltLogLevelType = 5;
36pub const DltLogLevelType_DLT_LOG_VERBOSE: DltLogLevelType = 6;
37pub const DltLogLevelType_DLT_LOG_MAX: DltLogLevelType = 7;
38pub type DltLogLevelType = ::std::os::raw::c_int;
39pub const DltTraceStatusType_DLT_TRACE_STATUS_DEFAULT: DltTraceStatusType = -1;
40pub const DltTraceStatusType_DLT_TRACE_STATUS_OFF: DltTraceStatusType = 0;
41pub const DltTraceStatusType_DLT_TRACE_STATUS_ON: DltTraceStatusType = 1;
42pub const DltTraceStatusType_DLT_TRACE_STATUS_MAX: DltTraceStatusType = 2;
43pub type DltTraceStatusType = ::std::os::raw::c_int;
44pub const DltTimestampType_DLT_AUTO_TIMESTAMP: DltTimestampType = 0;
45pub const DltTimestampType_DLT_USER_TIMESTAMP: DltTimestampType = 1;
46pub type DltTimestampType = ::std::os::raw::c_uint;
47#[repr(C)]
48#[derive(Debug, Copy, Clone)]
49pub struct DltContext {
50    pub contextID: [::std::os::raw::c_char; 4usize],
51    pub log_level_pos: i32,
52    pub log_level_ptr: *mut i8,
53    pub trace_status_ptr: *mut i8,
54    pub mcnt: u8,
55}
56#[allow(clippy::unnecessary_operation, clippy::identity_op)]
57const _: () = {
58    ["Size of DltContext"][::std::mem::size_of::<DltContext>() - 32usize];
59    ["Alignment of DltContext"][::std::mem::align_of::<DltContext>() - 8usize];
60    ["Offset of field: DltContext::contextID"]
61        [::std::mem::offset_of!(DltContext, contextID) - 0usize];
62    ["Offset of field: DltContext::log_level_pos"]
63        [::std::mem::offset_of!(DltContext, log_level_pos) - 4usize];
64    ["Offset of field: DltContext::log_level_ptr"]
65        [::std::mem::offset_of!(DltContext, log_level_ptr) - 8usize];
66    ["Offset of field: DltContext::trace_status_ptr"]
67        [::std::mem::offset_of!(DltContext, trace_status_ptr) - 16usize];
68    ["Offset of field: DltContext::mcnt"][::std::mem::offset_of!(DltContext, mcnt) - 24usize];
69};
70#[repr(C)]
71#[derive(Debug, Copy, Clone)]
72pub struct DltContextData {
73    pub handle: *mut DltContext,
74    pub buffer: *mut ::std::os::raw::c_uchar,
75    pub size: i32,
76    pub log_level: i32,
77    pub trace_status: i32,
78    pub args_num: i32,
79    pub context_description: *mut ::std::os::raw::c_char,
80    pub use_timestamp: DltTimestampType,
81    pub user_timestamp: u32,
82    pub verbose_mode: i8,
83}
84#[allow(clippy::unnecessary_operation, clippy::identity_op)]
85const _: () = {
86    ["Size of DltContextData"][::std::mem::size_of::<DltContextData>() - 56usize];
87    ["Alignment of DltContextData"][::std::mem::align_of::<DltContextData>() - 8usize];
88    ["Offset of field: DltContextData::handle"]
89        [::std::mem::offset_of!(DltContextData, handle) - 0usize];
90    ["Offset of field: DltContextData::buffer"]
91        [::std::mem::offset_of!(DltContextData, buffer) - 8usize];
92    ["Offset of field: DltContextData::size"]
93        [::std::mem::offset_of!(DltContextData, size) - 16usize];
94    ["Offset of field: DltContextData::log_level"]
95        [::std::mem::offset_of!(DltContextData, log_level) - 20usize];
96    ["Offset of field: DltContextData::trace_status"]
97        [::std::mem::offset_of!(DltContextData, trace_status) - 24usize];
98    ["Offset of field: DltContextData::args_num"]
99        [::std::mem::offset_of!(DltContextData, args_num) - 28usize];
100    ["Offset of field: DltContextData::context_description"]
101        [::std::mem::offset_of!(DltContextData, context_description) - 32usize];
102    ["Offset of field: DltContextData::use_timestamp"]
103        [::std::mem::offset_of!(DltContextData, use_timestamp) - 40usize];
104    ["Offset of field: DltContextData::user_timestamp"]
105        [::std::mem::offset_of!(DltContextData, user_timestamp) - 44usize];
106    ["Offset of field: DltContextData::verbose_mode"]
107        [::std::mem::offset_of!(DltContextData, verbose_mode) - 48usize];
108};
109unsafe extern "C" {
110    pub fn registerApplication(
111        appId: *const ::std::os::raw::c_char,
112        appDescription: *const ::std::os::raw::c_char,
113    ) -> DltReturnValue;
114}
115unsafe extern "C" {
116    pub fn unregisterApplicationFlushBufferedLogs() -> DltReturnValue;
117}
118unsafe extern "C" {
119    pub fn dltFree() -> DltReturnValue;
120}
121unsafe extern "C" {
122    pub fn registerContext(
123        contextId: *const ::std::os::raw::c_char,
124        contextDescription: *const ::std::os::raw::c_char,
125        context: *mut DltContext,
126    ) -> DltReturnValue;
127}
128unsafe extern "C" {
129    pub fn unregisterContext(context: *mut DltContext) -> DltReturnValue;
130}
131unsafe extern "C" {
132    pub fn logDlt(
133        context: *mut DltContext,
134        logLevel: DltLogLevelType,
135        message: *const ::std::os::raw::c_char,
136    ) -> DltReturnValue;
137}
138unsafe extern "C" {
139    pub fn logDltString(
140        context: *mut DltContext,
141        logLevel: DltLogLevelType,
142        message: *const ::std::os::raw::c_char,
143    ) -> DltReturnValue;
144}
145unsafe extern "C" {
146    pub fn logDltUint(
147        context: *mut DltContext,
148        logLevel: DltLogLevelType,
149        value: u32,
150    ) -> DltReturnValue;
151}
152unsafe extern "C" {
153    pub fn logDltInt(
154        context: *mut DltContext,
155        logLevel: DltLogLevelType,
156        value: i32,
157    ) -> DltReturnValue;
158}
159unsafe extern "C" {
160    pub fn dltUserLogWriteStart(
161        context: *mut DltContext,
162        log: *mut DltContextData,
163        logLevel: DltLogLevelType,
164    ) -> DltReturnValue;
165}
166unsafe extern "C" {
167    pub fn dltUserLogWriteFinish(log: *mut DltContextData) -> DltReturnValue;
168}
169unsafe extern "C" {
170    pub fn dltUserLogWriteString(
171        log: *mut DltContextData,
172        text: *const ::std::os::raw::c_char,
173    ) -> DltReturnValue;
174}
175unsafe extern "C" {
176    pub fn dltUserLogWriteUint(log: *mut DltContextData, data: u32) -> DltReturnValue;
177}
178unsafe extern "C" {
179    pub fn dltUserLogWriteInt(log: *mut DltContextData, data: i32) -> DltReturnValue;
180}
181unsafe extern "C" {
182    pub fn dltUserLogWriteUint64(log: *mut DltContextData, data: u64) -> DltReturnValue;
183}
184unsafe extern "C" {
185    pub fn dltUserLogWriteInt64(log: *mut DltContextData, data: i64) -> DltReturnValue;
186}
187unsafe extern "C" {
188    pub fn dltUserLogWriteFloat32(log: *mut DltContextData, data: f32) -> DltReturnValue;
189}
190unsafe extern "C" {
191    pub fn dltUserLogWriteFloat64(log: *mut DltContextData, data: f64) -> DltReturnValue;
192}
193unsafe extern "C" {
194    pub fn dltUserLogWriteBool(log: *mut DltContextData, data: u8) -> DltReturnValue;
195}
196unsafe extern "C" {
197    pub fn registerLogLevelChangedCallback(
198        handle: *mut DltContext,
199        callback: ::std::option::Option<
200            unsafe extern "C" fn(
201                context_id: *mut ::std::os::raw::c_char,
202                log_level: u8,
203                trace_status: u8,
204            ),
205        >,
206    ) -> DltReturnValue;
207}