Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Private Function

windowsWriteBuffer

Private Function
std.Io.Threaded.windowsWriteBuffer
fn windowsWriteBuffer(header: []const u8, data: []const []const u8, splat: usize) []const u8

Since Windows only supports writing one contiguous buffer, returns the first one, while also limiting it to a length representable by 32-bit unsigned integer.

Params

  • header: []const u8
  • data: []const []const u8
  • splat: usize

File

Io/Threaded.zig:3315
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
fn windowsWriteBuffer(header: []const u8, data: []const []const u8, splat: usize) []const u8 {
    const buffer = b: {
        if (header.len != 0) break :b header;
        for (data[0 .. data.len - 1]) |buffer| {
            if (buffer.len != 0) break :b buffer;
        }
        if (splat == 0) return &.{};
        break :b data[data.len - 1];
    };
    return buffer[0..std.math.lossyCast(u32, buffer.len)];
}