graft

May 17, 2026 ยท View on GitHub

{#graftmodule}

graft

Native ABI contracts and runtime loading helpers.

Namespaces

NameDescription
graftShared-library ABI contracts and runtime loading helpers.

{#graft}

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}

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 nodiscard noexceptConverts a manifest runtime string to a [RuntimeKind](#runtimekind).
Graft_API const char *runtimeKindName nodiscard noexceptReturns the manifest runtime string for a [RuntimeKind](#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.

{#parseruntimekind}

parseRuntimeKind

nodiscard noexcept

[[nodiscard]] Graft_APIRuntimeKind parseRuntimeKind(std::string_view runtime) noexcept

Converts a manifest runtime string to a [RuntimeKind](#runtimekind).


{#runtimekindname}

runtimeKindName

nodiscard noexcept

[[nodiscard]] Graft_API const char * runtimeKindName(RuntimeKind runtime) noexcept

Returns the manifest runtime string for a [RuntimeKind](#runtimekind).


{#validatemanifest}

validateManifest

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

Throws when a manifest is incompatible or missing required fields.


{#validatepluginmanifest}

validatePluginManifest

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

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


{#validatehostsurfacemanifest}

validateHostSurfaceManifest

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

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

Variables

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

{#abi_version}

ABI_VERSION

constexpr

std::uint32_t ABI_VERSION = 1

Current binary manifest ABI version required by the loader.


{#plugin_manifest_symbol}

PLUGIN_MANIFEST_SYMBOL

constexpr

const char * PLUGIN_MANIFEST_SYMBOL = "icy_graft_manifest"

Exported symbol name that plugin libraries use for their manifest.


{#manifest_symbol}

MANIFEST_SYMBOL

constexpr

const char * MANIFEST_SYMBOL = "icy_graft_manifest"

Backwards-compatible name for PLUGIN_MANIFEST_SYMBOL.


{#runtime_native}

RUNTIME_NATIVE

constexpr

const char * RUNTIME_NATIVE = "native"

Runtime string for plugins loaded directly into the current process.


{#runtime_worker}

RUNTIME_WORKER

constexpr

const char * RUNTIME_WORKER = "worker"

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


{#runtime_host}

RUNTIME_HOST

constexpr

const char * RUNTIME_HOST = "host"

Runtime string for host-exported C ABI surfaces.


{#library}

Library

#include <icy/graft/graft.h>
class Library

Defined in src/graft/include/icy/graft/graft.h:90

Loads a native plugin library and resolves its typed entrypoint.

List of all members

NameKindOwner
LibraryfunctionDeclared here
LibraryfunctionDeclared here
LibraryfunctionDeclared here
openfunctionDeclared here
closefunctionDeclared here
isOpenfunctionDeclared here
pathfunctionDeclared here
manifestfunctionDeclared here
requireSymbolAddressfunctionDeclared here
requireSymbolfunctionDeclared here
entrypointfunctionDeclared here
_libraryvariableDeclared here
_pathvariableDeclared here
_manifestvariableDeclared here
_openvariableDeclared here
loadManifestfunctionDeclared here

Public Methods

ReturnNameDescription
LibraryDefaulted constructor.
LibraryDeleted constructor.
LibraryDeleted constructor.
voidopen
voidclose noexcept
boolisOpen const nodiscard noexcept
const std::string &path const nodiscard noexcept
const Manifest &manifest const nodiscard
void *requireSymbolAddress const nodiscard
TrequireSymbol const inline nodiscard
Tentrypoint const inline nodiscard

{#library-1}

Library

Library() = default

Defined in src/graft/include/icy/graft/graft.h:93

Defaulted constructor.


{#library-2}

Library

Library(const Library &) = delete

Defined in src/graft/include/icy/graft/graft.h:96

Deleted constructor.


{#library-3}

Library

Library(Library &&) = delete

Defined in src/graft/include/icy/graft/graft.h:98

Deleted constructor.


{#open-6}

open

void open(const std::string & path)

Defined in src/graft/include/icy/graft/graft.h:101


{#close-24}

close

noexcept

void close() noexcept

Defined in src/graft/include/icy/graft/graft.h:102


{#isopen}

isOpen

const nodiscard noexcept

[[nodiscard]] bool isOpen() const noexcept

Defined in src/graft/include/icy/graft/graft.h:104


{#path-3}

path

const nodiscard noexcept

[[nodiscard]] const std::string & path() const noexcept

Defined in src/graft/include/icy/graft/graft.h:105


{#manifest-4}

manifest

const nodiscard

[[nodiscard]] const Manifest & manifest() const

Defined in src/graft/include/icy/graft/graft.h:106


{#requiresymboladdress}

requireSymbolAddress

const nodiscard

[[nodiscard]] void * requireSymbolAddress(const char * name) const

Defined in src/graft/include/icy/graft/graft.h:108


{#requiresymbol}

requireSymbol

const inline nodiscard

template<typename T> [[nodiscard]] inline T requireSymbol(const char * name) const

Defined in src/graft/include/icy/graft/graft.h:111


{#entrypoint-2}

entrypoint

const inline nodiscard

template<typename T> [[nodiscard]] inline T entrypoint() const

Defined in src/graft/include/icy/graft/graft.h:117

Private Attributes

ReturnNameDescription
SharedLibrary_library
std::string_path
const Manifest *_manifest
bool_open

{#_library}

_library

SharedLibrary _library

Defined in src/graft/include/icy/graft/graft.h:125


{#_path-4}

_path

std::string _path

Defined in src/graft/include/icy/graft/graft.h:126


{#_manifest}

_manifest

const Manifest * _manifest = nullptr

Defined in src/graft/include/icy/graft/graft.h:127


{#_open}

_open

bool _open = false

Defined in src/graft/include/icy/graft/graft.h:128

Private Methods

ReturnNameDescription
voidloadManifest

{#loadmanifest}

loadManifest

void loadManifest()

Defined in src/graft/include/icy/graft/graft.h:123

{#manifest-3}

Manifest

#include <icy/graft/graft.h>
struct Manifest

Defined in src/graft/include/icy/graft/graft.h:70

Metadata exported by a plugin or host surface.

List of all members

NameKindOwner
abiVersionvariableDeclared here
fileNamevariableDeclared here
idvariableDeclared here
namevariableDeclared here
versionvariableDeclared here
runtimevariableDeclared here
entrypointvariableDeclared here

Public Attributes

ReturnNameDescription
std::uint32_tabiVersionABI version expected to match [ABI_VERSION](#abi_version).
const char *fileNameSource file that declared the manifest.
const char *idStable plugin or surface identifier.
const char *nameHuman-readable plugin or surface name.
const char *versionPlugin or surface version string.
const char *runtimeRuntime contract string, such as native, worker, or host.
const char *entrypointExported symbol name for the typed entrypoint.

{#abiversion-1}

abiVersion

std::uint32_t abiVersion

Defined in src/graft/include/icy/graft/graft.h:73

ABI version expected to match [ABI_VERSION](#abi_version).


{#filename-3}

fileName

const char * fileName

Defined in src/graft/include/icy/graft/graft.h:75

Source file that declared the manifest.


{#id-4}

id

const char * id

Defined in src/graft/include/icy/graft/graft.h:77

Stable plugin or surface identifier.


{#name-8}

name

const char * name

Defined in src/graft/include/icy/graft/graft.h:79

Human-readable plugin or surface name.


{#version-6}

version

const char * version

Defined in src/graft/include/icy/graft/graft.h:81

Plugin or surface version string.


{#runtime-1}

runtime

const char * runtime

Defined in src/graft/include/icy/graft/graft.h:83

Runtime contract string, such as native, worker, or host.


{#entrypoint-1}

entrypoint

const char * entrypoint

Defined in src/graft/include/icy/graft/graft.h:85

Exported symbol name for the typed entrypoint.