Zig 0.17.0-dev (Split by item)
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.
Zig › std/ › c.zig › SOCK
SOCK
c.SOCK
pub const SOCK = switch (native_os )
File
Code
pub const SOCK = switch (native_os ) {
.linux => linux .SOCK ,
.emscripten => emscripten .SOCK ,
.windows => ws2_32 .SOCK ,
.driverkit , .ios , .maccatalyst , .macos , .tvos , .visionos , .watchos => struct {
pub const STREAM = 1 ;
pub const DGRAM = 2 ;
pub const RAW = 3 ;
pub const RDM = 4 ;
pub const SEQPACKET = 5 ;
pub const MAXADDRLEN = 255 ;
pub const CLOEXEC = 1 << 15 ;
pub const NONBLOCK = 1 << 16 ;
},
.freebsd => struct {
pub const STREAM = 1 ;
pub const DGRAM = 2 ;
pub const RAW = 3 ;
pub const RDM = 4 ;
pub const SEQPACKET = 5 ;
pub const CLOEXEC = 0x10000000 ;
pub const NONBLOCK = 0x20000000 ;
},
.illumos => struct {
pub const DGRAM = 1 ;
pub const STREAM = 2 ;
pub const RAW = 4 ;
pub const RDM = 5 ;
pub const SEQPACKET = 6 ;
pub const NONBLOCK = 0x100000 ;
pub const NDELAY = 0x200000 ;
pub const CLOEXEC = 0x080000 ;
},
.netbsd => struct {
pub const STREAM = 1 ;
pub const DGRAM = 2 ;
pub const RAW = 3 ;
pub const RDM = 4 ;
pub const SEQPACKET = 5 ;
pub const CONN_DGRAM = 6 ;
pub const DCCP = CONN_DGRAM ;
pub const CLOEXEC = 0x10000000 ;
pub const NONBLOCK = 0x20000000 ;
pub const NOSIGPIPE = 0x40000000 ;
pub const FLAGS_MASK = 0xf0000000 ;
},
.dragonfly => struct {
pub const STREAM = 1 ;
pub const DGRAM = 2 ;
pub const RAW = 3 ;
pub const RDM = 4 ;
pub const SEQPACKET = 5 ;
pub const MAXADDRLEN = 255 ;
pub const CLOEXEC = 0x10000000 ;
pub const NONBLOCK = 0x20000000 ;
},
.haiku => struct {
pub const STREAM = 1 ;
pub const DGRAM = 2 ;
pub const RAW = 3 ;
pub const SEQPACKET = 5 ;
pub const MISC = 255 ;
pub const NONBLOCK = 0x40000 ;
pub const CLOEXEC = 0x80000 ;
},
.openbsd => struct {
pub const STREAM = 1 ;
pub const DGRAM = 2 ;
pub const RAW = 3 ;
pub const RDM = 4 ;
pub const SEQPACKET = 5 ;
pub const CLOEXEC = 0x8000 ;
pub const NONBLOCK = 0x4000 ;
},
.serenity => struct {
pub const STREAM = 1 ;
pub const DGRAM = 2 ;
pub const RAW = 3 ;
pub const RDM = 4 ;
pub const SEQPACKET = 5 ;
pub const NONBLOCK = 0o4000 ;
pub const CLOEXEC = 0o2000000 ;
},
else => void ,
}