Skip to content

Commit

Permalink
Merge branch 'The-Z-Labs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
fermat-prime authored May 16, 2024
2 parents 59bfad1 + 9a28a59 commit a06214d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions bofs/src/simple-chain/wSimpleChainShared.zig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub const State = struct {
number: u32,
handle: *anyopaque,
};
2 changes: 2 additions & 0 deletions bofs/src/simple-chain/wSimpleChainStage1.zig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const std = @import("std");
const beacon = @import("bof_api").beacon;
const w32 = @import("bof_api").win32;
const shared = @import("wSimpleChainShared.zig");

pub export fn go(args: ?[*]u8, args_len: i32) callconv(.C) u8 {
Expand All @@ -12,6 +13,7 @@ pub export fn go(args: ?[*]u8, args_len: i32) callconv(.C) u8 {
};

state.number += 1;
state.handle = w32.GetCurrentProcess();

return 0;
}
4 changes: 3 additions & 1 deletion examples/integration-with-c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ int main(int argc, char *argv[]) {
printf("Running BOF from command line C application...\n");

BofContext* bof_context = NULL;
if (bofObjectRun(bof_handle, NULL, 0, &bof_context) < 0) return 1;
if (bofObjectRunAsyncThread(bof_handle, NULL, 0, NULL, NULL, &bof_context) < 0) return 1;
if (bof_context == NULL) return 1;

bofContextWait(bof_context);

const char* output = bofContextGetOutput(bof_context, NULL);
if (output)
printf("\n%s\n", output);
Expand Down

0 comments on commit a06214d

Please sign in to comment.