Skip to content

Commit

Permalink
chore: use namespaced ExtismValType (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko authored May 21, 2024
1 parent 8f0248c commit 896cb52
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,16 @@ defer KV_STORE.deinit();
var f_read = extism.Function.init(
"kv_read",
&[_]extism.c.ExtismValType{extism.c.I64},
&[_]extism.c.ExtismValType{extism.c.I64},
&[_]extism.c.ExtismValType{extism.PTR},
&[_]extism.c.ExtismValType{extism.PTR},
&kv_read,
@constCast(@as(*const anyopaque, @ptrCast("user data"))),
);
defer f_read.deinit();
var f_write = extism.Function.init(
"kv_write",
&[_]extism.c.ExtismValType{extism.c.I64, extism.c.I64},
&[_]extism.c.ExtismValType{extism.PTR, extism.PTR},
&[_]extism.c.ExtismValType{},
&kv_write,
@constCast(@as(*const anyopaque, @ptrCast("user data"))),
Expand Down
2 changes: 1 addition & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ pub fn extismVersion() []const u8 {
return version;
}

pub const PTR = c.I64;
pub const PTR = c.ExtismValType_I64;
16 changes: 8 additions & 8 deletions test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ test "Single threaded tests" {

var f = Function.init(
"hello_world",
&[_]sdk.c.ExtismValType{sdk.c.I64},
&[_]sdk.c.ExtismValType{sdk.c.I64},
&[_]sdk.c.ExtismValType{sdk.c.ExtismValType_I64},
&[_]sdk.c.ExtismValType{sdk.c.ExtismValType_I64},
&hello_world,
@constCast(@as(*const anyopaque, @ptrCast("user data"))),
);
Expand Down Expand Up @@ -76,8 +76,8 @@ test "Multi threaded tests" {
fn _test() !void {
var f = Function.init(
"hello_world",
&[_]sdk.c.ExtismValType{sdk.c.I64},
&[_]sdk.c.ExtismValType{sdk.c.I64},
&[_]sdk.c.ExtismValType{sdk.c.ExtismValType_I64},
&[_]sdk.c.ExtismValType{sdk.c.ExtismValType_I64},
&hello_world,
@constCast(@as(*const anyopaque, @ptrCast("user data"))),
);
Expand All @@ -96,8 +96,8 @@ test "Multi threaded tests" {

var f = Function.init(
"hello_world",
&[_]sdk.c.ExtismValType{sdk.c.I64},
&[_]sdk.c.ExtismValType{sdk.c.I64},
&[_]sdk.c.ExtismValType{sdk.c.ExtismValType_I64},
&[_]sdk.c.ExtismValType{sdk.c.ExtismValType_I64},
&hello_world,
@constCast(@as(*const anyopaque, @ptrCast("user data"))),
);
Expand All @@ -116,8 +116,8 @@ test "Plugin Cancellation" {
_ = sdk.setLogFile("test.log", .Debug);
var f = Function.init(
"hello_world",
&[_]sdk.c.ExtismValType{sdk.c.I64},
&[_]sdk.c.ExtismValType{sdk.c.I64},
&[_]sdk.c.ExtismValType{sdk.c.ExtismValType_I64},
&[_]sdk.c.ExtismValType{sdk.c.ExtismValType_I64},
&hello_world,
@constCast(@as(*const anyopaque, @ptrCast("user data"))),
);
Expand Down

0 comments on commit 896cb52

Please sign in to comment.