Module sdk

Source
Expand description

Extism C API

Structs§

ExtismFunction
ExtismVal
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_errorDeprecated
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 from extism_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§

ExtismFunctionType
Host function signature
ExtismLogDrainFunctionType
Log drain callback
ExtismMemoryHandle
Size

Unions§

ValUnion
A union type for host function argument/return values