DoxigAlpha

setName

Thread-safe. Bytes after '0' in new_name are ignored.

Function parameters

Parameters

#
new_name:[]const u8

Type definitions in this namespace

Types

#
Node
Represents one unit of progress.

Initializes a global Progress instance.

Functions

#
start
Initializes a global Progress instance.
lockStdErr
Allows the caller to freely write to stderr until `unlockStdErr` is called.
lockStderrWriter
Allows the caller to freely write to the returned `Writer`,

= switch (builtin.os.tag) { .wasi, .freestanding, .windows => false, else => true, }

Values

#
have_ipc
= switch (builtin.os.tag) { .wasi, .freestanding, .windows => false, else => true, }

Source

Implementation

#
pub fn setName(n: Node, new_name: []const u8) void {
    const index = n.index.unwrap() orelse return;
    const storage = storageByIndex(index);

    const name_len = @min(max_name_len, std.mem.indexOfScalar(u8, new_name, 0) orelse new_name.len);

    copyAtomicStore(storage.name[0..name_len], new_name[0..name_len]);
    if (name_len < storage.name.len)
        @atomicStore(u8, &storage.name[name_len], 0, .monotonic);
}