I want to use functions from Zig std in another lang and call them using FFI. My approach was to just write a Zig shared lib that wraps the functions I want in an export fn and call them the typical way. One example I was interested in was from std.net:
pub fn tcpConnectToHost(allocator: mem.Allocator, name: []const u8, port: u16) TcpConnectToHostError!Stream
This returns an !std.net.Stream that I'm not sure how to convert to a C type my FFI can handle. Technically I don't even need to interpret the return value since I plan to have any modifications handled by Zig using a different export fn.
Any advice on how to approach this?