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
# Configuration for generating include/generic.h from the ABI types.
# Regenerate with `make generate-plugin-header`; CI fails if the checked-in
# header is out of date. Never edit the header by hand.
= "C"
= "GENERIC_H"
= true
= true
= true
= "/* Plugin ABI of the generic programming language. GENERATED - do not edit. */"
# The trailer is emitted after the header's own `extern "C"` block closes,
# so it needs its own guard - without it, C++ consumers see the declaration
# with C++ linkage and cannot define the symbol as `extern "C"`.
= """
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/**
* The one symbol every plugin must export.
*/
const ModuleDesc *generic_plugin_init(void);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
"""
[]
# The crate exports no extern functions itself, so the ABI types (and the
# two code enums) must be listed explicitly (they pull in everything they
# reference).
= ["HostApi", "ModuleDesc", "FunctionDesc", "PluginFn", "GenericValue", "FfiStr", "FfiReturn", "FfiStatus", "ValueKind"]
= ["RustPluginFn"]
# The code enums cross the FFI as plain u32 (see FfiReturn.status and
# HostApi.value_kind); the C enum types below exist only to name the codes.
# Constant names are derived per-variant from the renamed enum type, so new
# variants get correct prefixed C names automatically.
[]
= "GenericFfiStatus"
= "GenericValueKind"
[]
= true
= "ScreamingSnakeCase"
[]
= false