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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! C-ABI boundary types for dynamic audit plugins (, Phase B).
//!
//! Only flat `#[repr(C)]` data crosses the FFI. No Rust trait objects, `Box`,
//! `Vec`, or `FnScan` are passed across the boundary — the plugin performs its
//! own scanning internally and returns only flat [`Finding`](crate::types::Finding)
//! records via a fixed-capacity buffer.
use ;
/// Plugin ABI major version. BREAKING changes bump this; the host rejects any
/// plugin whose major does not match.
pub const SDKT_AUDIT_ABI_MAJOR: u32 = 1;
/// Plugin ABI minor version. Additive/backward-compatible changes bump this.
///
/// The host DOES NOT reject plugins with a lower minor (older plugin, newer host).
/// Plugins with a higher minor (newer plugin, older host) may expose symbols the
/// host does not call — that is safe. Only a major-version mismatch causes a
/// load failure.
pub const SDKT_AUDIT_ABI_MINOR: u32 = 0;
/// Pack `(major, minor)` into the single `u32` returned by
/// `sdkt_plugin_abi_version`.
/// Extract the major component of a packed ABI version.
/// Extract the minor component of a packed ABI version.
/// Severity encoding shared with the C-ABI boundary (must match
/// [`Severity`](crate::types::Severity) ordering).
pub const SEVERITY_CRITICAL: u32 = 0;
/// See [`SEVERITY_CRITICAL`].
pub const SEVERITY_WARNING: u32 = 1;
/// See [`SEVERITY_CRITICAL`].
pub const SEVERITY_INFO: u32 = 2;
/// Maximum findings a plugin may emit in a single `sdkt_plugin_check` call.
pub const MAX_FINDINGS: usize = 64;
/// A single finding as seen across the FFI. `rule_id`, `message`, and
/// `location` are NUL-terminated C strings owned by the plugin and valid only
/// for the duration of the `sdkt_plugin_check` call. The host copies them into
/// owned `String`s before returning.
/// Fixed-capacity report buffer the plugin writes into during
/// `sdkt_plugin_check`. The host reads only the first `count` entries.
// Re-export the raw int type for plugin authors' convenience.
pub type CInt = c_int;