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 standard library.
std › Io › Dispatch › processCurrentPath Private Function processCurrentPath Doc Source Private Function std.Io.Dispatch.processCurrentPath
fn processCurrentPath (userdata : ?*anyopaque , buffer : []u8 ) process .CurrentPathError !usize Params userdata : ?*anyopaque buffer : []u8 File Io/Dispatch.zig: 4029
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041 fn processCurrentPath (userdata : ?*anyopaque , buffer : []u8 ) process .CurrentPathError !usize {
const ev : *Evented = @ptrCast (@alignCast (userdata ));
_ = ev ;
const err : c .E = if (c .getcwd (buffer .ptr , buffer .len )) |_ | .SUCCESS else @fromBackingInt (@intCast (c ._errno ().*));
switch (err ) {
.SUCCESS => return std .mem .findScalar (u8 , buffer , 0 ).?,
.NOENT => return error .CurrentDirUnlinked ,
.RANGE => return error .NameTooLong ,
.FAULT => |e | return errnoBug (e ),
.INVAL => |e | return errnoBug (e ),
else => return unexpectedErrno (err ),
}
}