@@ -15,9 +15,7 @@ use datadog_crashtracker::{
15
15
pub use datadog_crashtracker:: CallbackType as ddog_CallbackType;
16
16
pub use datadog_crashtracker:: RuntimeType as ddog_RuntimeType;
17
17
18
- #[ cfg( test) ]
19
- use datadog_crashtracker:: clear_runtime_callback;
20
- use std:: ffi:: c_char;
18
+ pub use datadog_crashtracker:: RuntimeStackFrame as ddog_RuntimeStackFrame;
21
19
22
20
/// Result type for runtime callback registration
23
21
#[ repr( C ) ]
@@ -60,7 +58,7 @@ impl From<CallbackError> for CallbackResult {
60
58
/// static void my_runtime_callback(
61
59
/// void (*emit_frame)(const ddog_RuntimeStackFrame*),
62
60
/// void (*emit_stacktrace_string)(const char*),
63
- /// void* context
61
+ /// void* writer_ctx
64
62
/// ) {
65
63
/// // Collect runtime frames and call emit_frame for each one
66
64
/// ddog_RuntimeStackFrame frame = {
@@ -71,7 +69,7 @@ impl From<CallbackError> for CallbackResult {
71
69
/// .class_name = "MyClass",
72
70
/// .module_name = NULL
73
71
/// };
74
- /// emit_frame(&frame);
72
+ /// emit_frame(writer_ctx, &frame);
75
73
/// }
76
74
///
77
75
///
@@ -131,7 +129,7 @@ pub extern "C" fn ddog_crasht_is_runtime_callback_registered() -> bool {
131
129
/// - The caller should not free the returned pointer
132
130
/// - The returned string should be copied if it needs to persist beyond callback lifetime
133
131
#[ no_mangle]
134
- pub unsafe extern "C" fn ddog_crasht_get_registered_runtime_type ( ) -> * const c_char {
132
+ pub unsafe extern "C" fn ddog_crasht_get_registered_runtime_type ( ) -> * const std :: ffi :: c_char {
135
133
get_registered_runtime_type_ptr ( )
136
134
}
137
135
@@ -145,19 +143,15 @@ pub unsafe extern "C" fn ddog_crasht_get_registered_runtime_type() -> *const c_c
145
143
/// - The caller should not free the returned pointer
146
144
/// - The returned string should be copied if it needs to persist beyond callback lifetime
147
145
#[ no_mangle]
148
- pub unsafe extern "C" fn ddog_crasht_get_registered_callback_type ( ) -> * const c_char {
146
+ pub unsafe extern "C" fn ddog_crasht_get_registered_callback_type ( ) -> * const std :: ffi :: c_char {
149
147
get_registered_callback_type_ptr ( )
150
148
}
151
149
152
- // Re-export the core RuntimeStackFrame for C interop; consumers need to create RuntimeStackFrame
153
- pub use datadog_crashtracker:: RuntimeStackFrame as ddog_RuntimeStackFrame;
154
-
155
150
#[ cfg( test) ]
156
151
mod tests {
157
152
use super :: * ;
158
- use datadog_crashtracker:: RuntimeStackFrame ;
159
- use std:: ffi:: c_void;
160
- use std:: ffi:: CString ;
153
+ use datadog_crashtracker:: { clear_runtime_callback, RuntimeStackFrame } ;
154
+ use std:: ffi:: { c_char, c_void, CString } ;
161
155
use std:: ptr;
162
156
use std:: sync:: Mutex ;
163
157
0 commit comments