#[repr(C)]pub struct PrismPluginBackend {
pub abi_version: u64,
pub struct_size: u32,
pub reserved: u32,
pub name: *const c_char,
pub priority: c_int,
pub features: u64,
pub vtable: *const PrismBackendVTable,
pub userdata: *mut c_void,
pub plugin_version: u64,
}Expand description
A descriptor supplied by a plugin to describe a single backend.
Fields§
§abi_version: u64The plugin ABI generation this descriptor was built against. A plugin MUST set this member to the PRISM_PLUGIN_ABI_VERSION against which it was compiled. Prism rejects a descriptor whose generation it does not accept, as described under ABI compatibility.
struct_size: u32The size of this structure as the plugin understands it. A plugin MUST set this member to sizeof(PrismPluginBackend). Prism consults at most this many bytes.
reserved: u32Reserved for future use. A plugin MUST set this member to zero.
name: *const c_charThe backend’s name, as a null-terminated UTF-8 string, subject to the same requirements and consequences as the name parameter of prism_registry_builder_add_backend. The backend’s identifier is derived from it by the hash function described in the chapter on backend identifiers. The string is copied during loading.
priority: c_intThe backend’s priority. Higher values indicate higher priority. This value MUST be non-negative unless the loading call supplies a priority override, in which case it is ignored.
features: u64The feature set the backend declares, formed by ORing PRISM_BACKEND_* feature constants together. It MUST be consistent with the vtable in the sense required of any custom backend.
vtable: *const PrismBackendVTableThe vtable implementing the backend, subject to every requirement placed on a vtable by the chapter on custom backends. This member MUST NOT be NULL, and its size member MUST be set as that chapter requires. The vtable MUST provide a create member, as described under Host services. The vtable is copied during loading; the code it names remains valid while the library remains loaded.
userdata: *mut c_voidAn opaque pointer that Prism delivers to the backend’s create member as the userdata member of a PrismPluginInstanceContext (see PrismPluginInstanceContext). It has the meaning the userdata parameter of prism_registry_builder_add_backend would have, and permits several descriptors that share one vtable to be distinguished at instance creation. This member MAY be NULL. Prism does not free it.
plugin_version: u64An informational version identifying the plugin’s own release, distinct from the ABI generation and used for no compatibility decision. The value is three 16-bit components, major, minor, and patch, packed most-significant first, with the least-significant 16 bits reserved and set to zero. A plugin MAY set it to zero if it has no version to report.