pub const WindowsBlock = struct slice: [:0]const u16pub fn deinit(block: WindowsBlock, gpa: Allocator) voidpub fn isEmpty(block: WindowsBlock) boolpub fn view(block: WindowsBlock) View74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97pub const WindowsBlock = struct {
slice: [:0]const u16,
pub const empty: WindowsBlock = .{ .slice = &.{0} };
pub fn deinit(block: WindowsBlock, gpa: Allocator) void {
gpa.free(block.slice);
}
pub fn isEmpty(block: WindowsBlock) bool {
return block.slice[0] == 0;
}
pub const View = struct {
ptr: [*:0]const u16,
pub fn isEmpty(v: View) bool {
return v.ptr[0] == 0;
}
};
pub fn view(block: WindowsBlock) View {
return .{ .ptr = block.slice.ptr };
}
}