This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.
fnaddress4ToPosix(a: net.Ip4Address) posix.sockaddr.in {
// The byte order of `a.bytes` is already equivalent to a network byte order address.constaddr_raw: *align(1) constu32 = @ptrCast(&a.bytes);
return .{
.port = std.mem.nativeToBig(u16, a.port),
.addr = addr_raw.*,
};
}