Skip to content

Commit d983184

Browse files
author
zach
authored
chore: update to use new extism namespaces (#13)
See extism/extism#504
1 parent 8512d24 commit d983184

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/source/usage.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ Guest Code
204204
(module
205205
(; code between winking-emoji parenthesis is a WAT comment! ;)
206206

207-
(import "env" "hello_world" (func $hello (param i64) (result i64)))
208-
(import "env" "extism_alloc" (func $extism_alloc (param i64) (result i64)))
209-
(import "env" "extism_store_u8" (func $extism_store_u8 (param i64 i32)))
210-
(import "env" "extism_output_set" (func $extism_output_set (param i64 i64)))
211-
(import "env" "extism_length" (func $extism_length (param i64) (result i64)))
207+
(import "extism:host/user" "hello_world" (func $hello (param i64) (result i64)))
208+
(import "extism:host/env" "alloc" (func $extism_alloc (param i64) (result i64)))
209+
(import "extism:host/env" "store_u8" (func $extism_store_u8 (param i64 i32)))
210+
(import "extism:host/env" "output_set" (func $extism_output_set (param i64 i64)))
211+
(import "extism:host/env" "length" (func $extism_length (param i64) (result i64)))
212212

213213
(; store a string to send to the host. ;)
214214
(memory $memory (export "mem")

extism/extism.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,8 @@ def hello_world(plugin, params, results):
636636
# example.wat = \"""
637637
# (module
638638
# (import "example" "hello_world" (func $hello (param i64)))
639-
# (import "env" "extism_alloc" (func $extism_alloc (param i64) (result i64)))
640-
# (import "env" "extism_store_u8" (func $extism_store_u8 (;6;) (param i64 i32)))
639+
# (import "extism:host/env" "alloc" (func $extism_alloc (param i64) (result i64)))
640+
# (import "extism:host/env" "store_u8" (func $extism_store_u8 (;6;) (param i64 i32)))
641641
#
642642
# (memory $memory (export "mem")
643643
# (data "Hello from WAT!\00")
@@ -688,7 +688,7 @@ def host_fn(
688688
689689
:param name: The function name to expose to the guest plugin. If not given, inferred from the
690690
wrapped function name.
691-
:param namespace: The namespace to install the function into; defaults to "env" if not given.
691+
:param namespace: The namespace to install the function into; defaults to "extism:host/user" if not given.
692692
:param signature: A tuple of two arrays representing the function parameter types and return value types.
693693
If not given, types will be inferred from ``typing`` annotations.
694694
:param userdata: Any custom userdata to associate with the function.

0 commit comments

Comments
 (0)