the.bay.news

How to use root.zig effectively? (How to expose a good external Zig API?)

Ziggit
How to use root.zig effectively? (How to expose a good external Zig API?)
I currently have a project like this. myproj$ tree . . ├── build.zig ├── build.zig.zon ├── src │ ├── foo.zig │ ├── bar.zig └── └── root.zig And my foo.zig has a function like this. // myproj/foo.zig pub fn print(msg: []const u8) void {} Within the same project, the name print seems fine. For example in bar.zig, I call it like this. // myproj/bar.zig const foo = @import("foo.zig"); fn bar() void { // It's a foo-printer, makes sense. foo.print("hi"); } The part I’m not sure about is...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.