Expand description
Extism C API
Structs§
- Extism
Function - Extism
Val ExtismVal
holds the type and value of a function argument/return
Statics§
- EXTISM_
SUCCESS - The return code used to specify a successful plugin call
Functions§
- extism_
compiled_ ⚠plugin_ free - Free
ExtismCompiledPlugin
- extism_
compiled_ ⚠plugin_ new - Pre-compile an Extism plugin
- extism_
current_ ⚠plugin_ host_ context - Get the current plugin’s associated host context data. Returns null if call was made without host context.
- extism_
current_ ⚠plugin_ memory - Returns a pointer to the memory of the currently running plugin NOTE: this should only be called from host functions.
- extism_
current_ ⚠plugin_ memory_ alloc - Allocate a memory block in the currently running plugin NOTE: this should only be called from host functions.
- extism_
current_ ⚠plugin_ memory_ free - Free an allocated memory block NOTE: this should only be called from host functions.
- extism_
current_ ⚠plugin_ memory_ length - Get the length of an allocated block NOTE: this should only be called from host functions.
- extism_
error ⚠Deprecated - Get the error associated with a
Plugin
- extism_
function_ ⚠free - Free
ExtismFunction
- extism_
function_ ⚠new - Create a new host function
- extism_
function_ ⚠set_ namespace - Set the namespace of an
ExtismFunction
- extism_
log_ ⚠custom - Enable a custom log handler, this will buffer logs until
extism_log_drain
is called Log level should be one of: info, error, trace, debug, warn - extism_
log_ ⚠drain - Calls the provided callback function for each buffered log line.
This is only needed when
extism_log_custom
is used. - extism_
log_ ⚠file - Set log file and level.
The log level can be either one of: info, error, trace, debug, warn or a more
complex filter like
extism=trace,cranelift=debug
The file will be created if it doesn’t exist. - extism_
plugin_ ⚠allow_ http_ response_ headers - Enable HTTP response headers in plugins using
extism:host/env::http_request
- extism_
plugin_ ⚠call - Call a function
- extism_
plugin_ ⚠call_ with_ host_ context - Call a function with host context.
- extism_
plugin_ ⚠cancel - Cancel a running plugin
- extism_
plugin_ ⚠cancel_ handle - Get handle for plugin cancellation
- extism_
plugin_ ⚠config - Update plugin config values.
- extism_
plugin_ ⚠error - Get the error associated with a
Plugin
- extism_
plugin_ ⚠free - Free
ExtismPlugin
- extism_
plugin_ ⚠function_ exists - Returns true if
func_name
exists - extism_
plugin_ ⚠id - Get a plugin’s ID, the returned bytes are a 16 byte buffer that represent a UUIDv4
- extism_
plugin_ ⚠new - Create a new plugin with host functions, the functions passed to this function no longer need to be manually freed using
- extism_
plugin_ ⚠new_ error_ free - Free the error returned by
extism_plugin_new
, errors returned fromextism_plugin_error
don’t need to be freed - extism_
plugin_ ⚠new_ from_ compiled - Create a new plugin from an
ExtismCompiledPlugin
- extism_
plugin_ ⚠new_ with_ fuel_ limit - Create a new plugin and set the number of instructions a plugin is allowed to execute
- extism_
plugin_ ⚠output_ data - Get a pointer to the output data
- extism_
plugin_ ⚠output_ length - Get the length of a plugin’s output data
- extism_
plugin_ ⚠reset - Reset the Extism runtime, this will invalidate all allocated memory
- extism_
version ⚠ - Get the Extism version string
Type Aliases§
- Extism
Function Type - Host function signature
- Extism
LogDrain Function Type - Log drain callback
- Extism
Memory Handle - Size
Unions§
- ValUnion
- A union type for host function argument/return values