Skip to content

Commit

Permalink
chore: update to use new extism namespaces (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Oct 30, 2023
1 parent 8512d24 commit d983184
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ Guest Code
(module
(; code between winking-emoji parenthesis is a WAT comment! ;)

(import "env" "hello_world" (func $hello (param i64) (result i64)))
(import "env" "extism_alloc" (func $extism_alloc (param i64) (result i64)))
(import "env" "extism_store_u8" (func $extism_store_u8 (param i64 i32)))
(import "env" "extism_output_set" (func $extism_output_set (param i64 i64)))
(import "env" "extism_length" (func $extism_length (param i64) (result i64)))
(import "extism:host/user" "hello_world" (func $hello (param i64) (result i64)))
(import "extism:host/env" "alloc" (func $extism_alloc (param i64) (result i64)))
(import "extism:host/env" "store_u8" (func $extism_store_u8 (param i64 i32)))
(import "extism:host/env" "output_set" (func $extism_output_set (param i64 i64)))
(import "extism:host/env" "length" (func $extism_length (param i64) (result i64)))

(; store a string to send to the host. ;)
(memory $memory (export "mem")
Expand Down
6 changes: 3 additions & 3 deletions extism/extism.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,8 @@ def hello_world(plugin, params, results):
# example.wat = \"""
# (module
# (import "example" "hello_world" (func $hello (param i64)))
# (import "env" "extism_alloc" (func $extism_alloc (param i64) (result i64)))
# (import "env" "extism_store_u8" (func $extism_store_u8 (;6;) (param i64 i32)))
# (import "extism:host/env" "alloc" (func $extism_alloc (param i64) (result i64)))
# (import "extism:host/env" "store_u8" (func $extism_store_u8 (;6;) (param i64 i32)))
#
# (memory $memory (export "mem")
# (data "Hello from WAT!\00")
Expand Down Expand Up @@ -688,7 +688,7 @@ def host_fn(
:param name: The function name to expose to the guest plugin. If not given, inferred from the
wrapped function name.
:param namespace: The namespace to install the function into; defaults to "env" if not given.
:param namespace: The namespace to install the function into; defaults to "extism:host/user" if not given.
:param signature: A tuple of two arrays representing the function parameter types and return value types.
If not given, types will be inferred from ``typing`` annotations.
:param userdata: Any custom userdata to associate with the function.
Expand Down

0 comments on commit d983184

Please sign in to comment.