1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#[repr(C)]
pub struct Position {
pub line: usize,
pub column: usize,
pub index: usize,
}
#[repr(C)]
pub struct Diagnostic {
pub position: Position,
pub error: *const std::os::raw::c_char,
pub is_text_source: bool,
}
#[derive(Copy, Clone, PartialEq, Debug)]
#[repr(C)]
pub enum MessageLevel {
Fatal,
InternalError,
Error,
Warning,
Info,
Debug,
}
pub type MessageCallback = extern "C" fn(
MessageLevel, *const std::os::raw::c_char, *const Position, *const std::os::raw::c_char, *mut std::ffi::c_void, );
extern "C" {
#[link_name = "spvDiagnosticDestroy"]
pub fn diagnostic_destroy(diag: *mut Diagnostic);
}