Home
Graft module

graft

Shared-library ABI contracts and runtime loading helpers.

graft

Shared-library ABI contracts and runtime loading helpers.

Classes

NameDescription
LibraryLoads a native plugin library and resolves its typed entrypoint.
ManifestMetadata exported by a plugin or host surface.

Enumerations

NameDescription
RuntimeKindRuntime contract declared by a graft manifest.

RuntimeKind

enum RuntimeKind

Runtime contract declared by a graft manifest.

ValueDescription
UnknownRuntime string is missing or not recognized.
NativePlugin is loaded directly into the host process.
WorkerPlugin is intended for a worker runtime.
HostManifest describes a host-exported C ABI surface, not a plugin.

Functions

ReturnNameDescription
Graft_APIRuntimeKindparseRuntimeKind noexceptConverts a manifest runtime string to a RuntimeKind.
Graft_API const char *runtimeKindName noexceptReturns the manifest runtime string for a RuntimeKind.
Graft_API voidvalidateManifestThrows when a manifest is incompatible or missing required fields.
Graft_API voidvalidatePluginManifestThrows when a manifest is not a plugin-loadable manifest.
Graft_API voidvalidateHostSurfaceManifestThrows when a manifest is not a host-exported surface manifest.
ManifestmanifestFromC inline noexcept
voidvalidateManifest inline
voidvalidatePluginManifest inline
voidvalidateHostSurfaceManifest inline

parseRuntimeKind

noexcept

Graft_APIRuntimeKind parseRuntimeKind(std::string_view runtime) noexcept

Converts a manifest runtime string to a RuntimeKind.


runtimeKindName

noexcept

Graft_API const char * runtimeKindName(RuntimeKind runtime) noexcept

Returns the manifest runtime string for a RuntimeKind.


validateManifest

Graft_API void validateManifest(const Manifest & manifest, std::string_view path)

Throws when a manifest is incompatible or missing required fields.


validatePluginManifest

Graft_API void validatePluginManifest(const Manifest & manifest, std::string_view path)

Throws when a manifest is not a plugin-loadable manifest.


validateHostSurfaceManifest

Graft_API void validateHostSurfaceManifest(const Manifest & manifest, std::string_view path)

Throws when a manifest is not a host-exported surface manifest.


manifestFromC

inline noexcept

inline Manifest manifestFromC(const ::icy_graft_manifest_t & manifest) noexcept

validateManifest

inline

inline void validateManifest(const ::icy_graft_manifest_t & manifest, std::string_view path)

validatePluginManifest

inline

inline void validatePluginManifest(const ::icy_graft_manifest_t & manifest, std::string_view path)

validateHostSurfaceManifest

inline

inline void validateHostSurfaceManifest(const ::icy_graft_manifest_t & manifest, std::string_view path)

Variables

ReturnNameDescription
constexpr std::uint32_tABI_VERSION constexprCurrent binary manifest ABI version required by the loader.
constexpr const char *PLUGIN_MANIFEST_SYMBOL constexprExported symbol name that plugin libraries use for their manifest.
constexpr const char *MANIFEST_SYMBOL constexprBackwards-compatible name for PLUGIN_MANIFEST_SYMBOL.
constexpr const char *RUNTIME_NATIVE constexprRuntime string for plugins loaded directly into the current process.
constexpr const char *RUNTIME_WORKER constexprRuntime string for plugins intended to execute in a worker runtime.
constexpr const char *RUNTIME_HOST constexprRuntime string for host-exported C ABI surfaces.

ABI_VERSION

constexpr

constexpr std::uint32_t ABI_VERSION = 

Current binary manifest ABI version required by the loader.


PLUGIN_MANIFEST_SYMBOL

constexpr

constexpr const char * PLUGIN_MANIFEST_SYMBOL = 

Exported symbol name that plugin libraries use for their manifest.


MANIFEST_SYMBOL

constexpr

constexpr const char * MANIFEST_SYMBOL = 

Backwards-compatible name for PLUGIN_MANIFEST_SYMBOL.


RUNTIME_NATIVE

constexpr

constexpr const char * RUNTIME_NATIVE = 

Runtime string for plugins loaded directly into the current process.


RUNTIME_WORKER

constexpr

constexpr const char * RUNTIME_WORKER = 

Runtime string for plugins intended to execute in a worker runtime.


RUNTIME_HOST

constexpr

constexpr const char * RUNTIME_HOST = 

Runtime string for host-exported C ABI surfaces.