std.process.Environ
The entries of std.process.Environ in the Zig reference. This page has 63 cards.
On WASI without libc, this is `void` because the environment has to be queried and heap-allocated at runtime.
- Kind
- type
- Module
std.process.Environ
pub fn contains(environ: Environ, gpa: Allocator, key: []const u8) ContainsError!bool
On Windows, if `key` is not valid [WTF-8](https://wtf-8.codeberg.page/), then `error.InvalidWtf8` is returned.
- Kind
- function
- Module
std.process.Environ
pub fn containsConstant(environ: Environ, comptime key: []const u8) bool
This function is unavailable on WASI without libc due to the memory allocation requirement.
- Kind
- function
- Module
std.process.Environ
- Kind
- error set
- Module
std.process.Environ
pub fn containsUnempty(environ: Environ, gpa: Allocator, key: []const u8) ContainsError!bool
On Windows, if `key` is not valid [WTF-8](https://wtf-8.codeberg.page/), then `error.InvalidWtf8` is returned.
- Kind
- function
- Module
std.process.Environ
pub fn containsUnemptyConstant(environ: Environ, comptime key: []const u8) bool
This function is unavailable on WASI without libc due to the memory allocation requirement.
- Kind
- function
- Module
std.process.Environ
pub fn createMap(env: Environ, allocator: Allocator) CreateMapError!Map
Allocates a `Map` and copies environment block into it.
- Kind
- function
- Module
std.process.Environ
- Kind
- error set
- Module
std.process.Environ
pub fn createPosixBlock(existing: Environ, gpa: Allocator, options: CreatePosixBlockOptions) Allocator.Error!PosixBlock
Creates a null-delimited environment variable block in the format expected by POSIX, from a different one.
- Kind
- function
- Module
std.process.Environ
- Kind
- struct
- Module
std.process.Environ
pub fn createWindowsBlock(existing: Environ, gpa: Allocator, options: CreateWindowsBlockOptions) Allocator.Error!WindowsBlock
Creates a null-delimited environment variable block in the format expected by POSIX, from a different one.
- Kind
- function
- Module
std.process.Environ
- Kind
- struct
- Module
std.process.Environ
- Kind
- constant
- Module
std.process.Environ
pub fn getAlloc(environ: Environ, gpa: Allocator, key: []const u8) GetAllocError![]u8
Caller owns returned memory.
- Kind
- function
- Module
std.process.Environ
- Kind
- error set
- Module
std.process.Environ
pub fn getPosix(environ: Environ, key: []const u8) ?[:0]const u8
This function is unavailable on WASI without libc due to the memory allocation requirement.
- Kind
- function
- Module
std.process.Environ
pub fn getWindows(environ: Environ, key: [*:0]const u16) ?[:0]const u16
Windows-only.
- Kind
- function
- Module
std.process.Environ
- Kind
- struct
- Module
std.process.Environ
pub fn deinit(_: GlobalBlock, _: Allocator) void
- Kind
- function
- Module
std.process.Environ
- Kind
- constant
- Module
std.process.Environ
- Kind
- constant
- Module
std.process.Environ
pub fn isEmpty(block: GlobalBlock) bool
- Kind
- function
- Module
std.process.Environ
Each key and each value are allocated independently and owned by this data structure.
- Kind
- struct
- Module
std.process.Environ
pub fn clearRetainingCapacity(m: *Map) void
Set the length to zero, freeing all key and value memory, not freeing the allocation for the entries.
- Kind
- function
- Module
std.process.Environ
pub fn clone(m: *const Map, gpa: Allocator) Allocator.Error!Map
Returns a full copy of `em` allocated with `gpa`, which is not necessarily the same allocator used to allocate `em`.
- Kind
- function
- Module
std.process.Environ
pub fn contains(m: *const Map, key: []const u8) bool
On Windows, asserts that `key` is valid [WTF-8](https://wtf-8.codeberg.page/).
- Kind
- function
- Module
std.process.Environ
pub fn count(self: Map) Size
Returns the number of KV pairs stored in the map.
- Kind
- function
- Module
std.process.Environ
pub fn createPosixBlock(map: *const Map, gpa: Allocator, options: CreatePosixBlockOptions) Allocator.Error!PosixBlock
Creates a null-delimited environment variable block in the format expected by POSIX, from a hash map plus options.
- Kind
- function
- Module
std.process.Environ
pub fn createWindowsBlock(map: *const Map, gpa: Allocator, options: CreateWindowsBlockOptions) error
Caller owns result.
- Kind
- function
- Module
std.process.Environ
pub fn deinit(self: *Map) void
Free the backing storage of the map, as well as all of the stored keys and values.
- Kind
- function
- Module
std.process.Environ
- Kind
- struct
- Module
std.process.Environ
pub fn eql(self: @This(), a: []const u8, b: []const u8, b_index: usize) bool
- Kind
- function
- Module
std.process.Environ
pub fn hash(self: @This(), s: []const u8) u32
- Kind
- function
- Module
std.process.Environ
pub fn get(self: Map, key: []const u8) ?[]const u8
Return the map's copy of the value associated with a key.
- Kind
- function
- Module
std.process.Environ
pub fn getPtr(self: Map, key: []const u8) ?*[]const u8
Find the address of the value associated with a key.
- Kind
- function
- Module
std.process.Environ
pub fn init(allocator: Allocator) Map
Create a Map backed by a specific allocator.
- Kind
- function
- Module
std.process.Environ
pub fn iterator(self: *const Map) ArrayHashMap.Iterator
Returns an iterator over entries in the map.
- Kind
- function
- Module
std.process.Environ
pub fn keys(map: *const Map) [][]const u8
- Kind
- function
- Module
std.process.Environ
pub fn orderedRemove(self: *Map, key: []const u8) bool
If there is an entry with a matching key, it is deleted from the map.
- Kind
- function
- Module
std.process.Environ
pub fn put(self: *Map, key: []const u8, value: []const u8) Allocator.Error!void
`key` and `value` are copied into the Map.
- Kind
- function
- Module
std.process.Environ
pub fn putAll(m: *Map, other: *const Map) Allocator.Error!void
Adds all the key-value pairs from `other` into this `m`.
- Kind
- function
- Module
std.process.Environ
pub fn putMove(self: *Map, key: []u8, value: []u8) Allocator.Error!void
Same as `put` but the key and value become owned by the Map rather than being copied.
- Kind
- function
- Module
std.process.Environ
pub fn putPosixBlock(map: *Map, view: PosixBlock.View) Allocator.Error!void
- Kind
- function
- Module
std.process.Environ
pub fn putWindowsBlock(map: *Map, view: WindowsBlock.View) Allocator.Error!void
- Kind
- function
- Module
std.process.Environ
- Kind
- type
- Module
std.process.Environ
pub fn swapRemove(self: *Map, key: []const u8) bool
If there is an entry with a matching key, it is deleted from the hash map.
- Kind
- function
- Module
std.process.Environ
pub fn validateKeyForFetch(key: []const u8) bool
- Kind
- function
- Module
std.process.Environ
pub fn validateKeyForPut(key: []const u8) bool
- Kind
- function
- Module
std.process.Environ
pub fn values(map: *const Map) [][]const u8
- Kind
- function
- Module
std.process.Environ
- Kind
- struct
- Module
std.process.Environ
pub fn deinit(block: PosixBlock, gpa: Allocator) void
- Kind
- function
- Module
std.process.Environ
- Kind
- constant
- Module
std.process.Environ
pub fn isEmpty(block: PosixBlock) bool
- Kind
- function
- Module
std.process.Environ
- Kind
- struct
- Module
std.process.Environ
pub fn view(block: PosixBlock) View
- Kind
- function
- Module
std.process.Environ
pub fn isEmpty(v: View) bool
- Kind
- function
- Module
std.process.Environ
- Kind
- struct
- Module
std.process.Environ
pub fn deinit(block: WindowsBlock, gpa: Allocator) void
- Kind
- function
- Module
std.process.Environ
- Kind
- constant
- Module
std.process.Environ
pub fn isEmpty(block: WindowsBlock) bool
- Kind
- function
- Module
std.process.Environ
- Kind
- struct
- Module
std.process.Environ
pub fn view(block: WindowsBlock) View
- Kind
- function
- Module
std.process.Environ
pub fn isEmpty(v: View) bool
- Kind
- function
- Module
std.process.Environ