Home
Graft module

graft

Shared-library plugin contracts and runtime loading helpers.

graft

Shared-library plugin contracts and runtime loading helpers.

Classes

NameDescription
LibraryLoads a native plugin library and resolves its typed entrypoint.
ManifestMetadata exported by a plugin under icy_graft_manifest.

Enumerations

NameDescription
RuntimeKindRuntime contract declared by a plugin manifest.

RuntimeKind

enum RuntimeKind

Runtime contract declared by a plugin manifest.

ValueDescription
UnknownRuntime string is missing or not recognized.
NativePlugin is loaded directly into the host process.
WorkerPlugin is intended for a worker runtime.

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.

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.

Variables

ReturnNameDescription
constexpr std::uint32_tABI_VERSION constexprCurrent binary manifest ABI version required by the loader.
constexpr const char *MANIFEST_SYMBOL constexprExported symbol name that plugins use for their manifest.
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.

ABI_VERSION

constexpr

constexpr std::uint32_t ABI_VERSION = 1

Current binary manifest ABI version required by the loader.


MANIFEST_SYMBOL

constexpr

constexpr const char * MANIFEST_SYMBOL = "icy_graft_manifest"

Exported symbol name that plugins use for their manifest.


RUNTIME_NATIVE

constexpr

constexpr const char * RUNTIME_NATIVE = "native"

Runtime string for plugins loaded directly into the current process.


RUNTIME_WORKER

constexpr

constexpr const char * RUNTIME_WORKER = "worker"

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